AjaxCMS

November 20, 2025 ยท View on GitHub

A lightweight, database-free CMS powered by JavaScript and Node.js

AjaxCMS is a modern content management system that generates dynamic websites from static files. No database required, no complex setup - just pure JavaScript magic with animated themes and powerful content helpers.

โœจ Perfect for AI/LLM-Assisted Development - Simple architecture, well-documented code, and clear patterns make it ideal for creating content and themes with AI assistants like Claude Code.

๐ŸŒ Live Demo โ€ข ๐Ÿ“– Documentation โ€ข ๐Ÿค– AI Development Guide

What is AjaxCMS?

AjaxCMS is a single-page application (SPA) that dynamically builds websites from directory structures. It uses a Node.js backend to serve JSON directory listings, which the front-end JavaScript transforms into beautiful, navigable websites.

Think of it as a static site generator that runs in real-time, with the flexibility of a CMS.

Key Features

โœจ No Database - Content lives in simple HTML and Markdown files ๐Ÿš€ Multi-Site Ready - Host unlimited sites from one installation ๐ŸŽจ Animated Themes - Canvas-based backgrounds with 15+ built-in themes ๐Ÿ“ Markdown Support - Write content in Markdown or HTML ๐Ÿ”ง Helper Syntax - Custom {{helper}} tags for dynamic content ๐ŸŒ Single Page App - Fast navigation with smooth transitions ๐Ÿ“ฑ Responsive - Built with Bootstrap, works on all devices ๐ŸŽฏ Blog Support - Built-in blog functionality with pagination ๐Ÿ”„ Resource Sharing - Share JavaScript, themes, and images across all sites โšก Fast Setup - Get running in minutes, not hours

Quick Start

Development Mode (HTTP only, port 3000)

# 1. Install dependencies
npm install

# 2. Create your first site
mkdir -p sites/mysite.com
cp -r index.html pages/ sites/mysite.com/

# 3. Start the development server
./start-dev.sh

Visit http://localhost:3000 to see the sites index!

Production Mode (SSL with Let's Encrypt, ports 80 & 443)

# 1. Install dependencies
npm install
npm install -g pm2

# 2. Edit the SSL startup script with your email
nano start-ssl.sh
# Change MAINTAINER_EMAIL="your@email.com" to your actual email

# 3. Make sure your domain DNS points to your server's IP

# 4. Start with SSL (requires sudo for ports 80/443)
sudo ./start-ssl.sh

Visit http://yourdomain.com (redirects to HTTPS automatically)

Features:

  • โœ… Automatic SSL certificate provisioning via Let's Encrypt
  • โœ… Auto-discovers and registers all site domains from sites/ directory
  • โœ… HTTP (port 80) automatically redirects to HTTPS (port 443)
  • โœ… Certificates auto-renew before expiration
  • โœ… Sites index available at /sites on any domain

How It Works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Browser requests page                                  โ”‚
โ”‚  โ†“                                                       โ”‚
โ”‚  Node.js server serves JSON directory listings          โ”‚
โ”‚  โ†“                                                       โ”‚
โ”‚  JavaScript builds navigation from file structure       โ”‚
โ”‚  โ†“                                                       โ”‚
โ”‚  Content loaded dynamically with smooth transitions     โ”‚
โ”‚  โ†“                                                       โ”‚
โ”‚  Helpers processed (links, images, blogs, etc.)         โ”‚
โ”‚  โ†“                                                       โ”‚
โ”‚  Markdown converted to HTML                             โ”‚
โ”‚  โ†“                                                       โ”‚
โ”‚  Animated theme renders in background                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Why AjaxCMS?

๐ŸŽฏ Perfect For

  • Portfolio sites - Showcase your work with stunning themes
  • Documentation - Organize docs with automatic navigation
  • Blogs - Built-in blog functionality with date-based sorting
  • Multi-tenant hosting - One server, unlimited sites
  • Learning projects - Simple architecture, easy to understand

๐Ÿ’ก Benefits

  • Zero Configuration - Drop files in folders, they appear in menus
  • Easy Deployment - Just copy files, no database migrations
  • Version Control Friendly - All content in Git-friendly text files
  • Low Resource Usage - Static files = minimal server requirements
  • Offline Development - Test locally without complicated setup
  • Theme Flexibility - Override any theme per-site or share globally

โšก What Makes It Different

Unlike traditional CMSs (WordPress, Drupal) or static generators (Jekyll, Hugo):

  • โœ… No build step required
  • โœ… No database to manage
  • โœ… Changes appear immediately
  • โœ… Multi-site built-in from day one
  • โœ… Dynamic content from static files
  • โœ… Shared resources (js/, themes/, images/) across sites

Content Management

AjaxCMS has no backend editor or admin interface. Content is managed by directly editing files on the filesystem. This design keeps the system simple, version-controllable, and secure.

How to Edit Your Content

Git-Based Workflow (Recommended)

# Make changes locally
vim sites/mysite.com/pages/about.md

# Commit and push
git add .
git commit -m "Update about page"
git push

# On server
git pull

Other Methods:

  • GitHub Web UI - Edit files in browser, then git pull on server
  • SSH/SFTP - Edit files directly on server with vim/nano or upload via FileZilla/Cyberduck
  • Remote IDE - Use VSCode Remote SSH or JetBrains Gateway
  • CI/CD - Auto-deploy with GitHub Actions or git hooks
  • rsync - Sync local changes: rsync -avz ./sites/mysite/ user@server:/path/to/sites/mysite/

Why No Backend Editor?

  • Version Control - All content in Git for history and collaboration
  • Security - No admin login to hack, no database to inject
  • Simplicity - One less thing to learn, maintain, or break
  • Flexibility - Use your favorite editor/IDE with all your shortcuts
  • Backup - Git commits are automatic backups
  • Speed - No WYSIWYG editor overhead

Directory Structure

AjaxCMS/
โ”œโ”€โ”€ server.js              # Node.js multi-site server
โ”œโ”€โ”€ sites-index.html       # Sites directory index
โ”œโ”€โ”€ js/                    # Shared JavaScript (all sites)
โ”œโ”€โ”€ themes/                # Shared themes (all sites)
โ”œโ”€โ”€ images/                # Shared images (all sites)
โ””โ”€โ”€ sites/                 # Your sites
    โ”œโ”€โ”€ mysite.com/
    โ”‚   โ”œโ”€โ”€ index.html     # Site config
    โ”‚   โ”œโ”€โ”€ description.md # Shows on index
    โ”‚   โ”œโ”€โ”€ pages/         # Your content
    โ”‚   โ”‚   โ””โ”€โ”€ menus/     # Auto-discovered navigation
    โ”‚   โ””โ”€โ”€ images/        # Site images
    โ””โ”€โ”€ blog.com/
        โ””โ”€โ”€ ...

Content Helpers

AjaxCMS includes powerful helpers for dynamic content:

<!-- Links -->
{{a | about}}  <!-- Auto-finds pages/about.html -->

<!-- Images -->
{{i | logo}}   <!-- Auto-finds images/logo.png -->

<!-- Carousels -->
{{carousel:5000 | img1:alt1:caption1 | img2:alt2:caption2}}

<!-- Blogs -->
{{blog | ./pages/posts | 0 | 5}}  <!-- First 5 posts -->

<!-- File Lists -->
{{filelist | ./pages/docs}}  <!-- Auto-generated file tree -->

Themes

Choose from 15+ animated canvas themes or create your own:

  • network - Animated network connections
  • gears - Spinning mechanical gears
  • kaleidoscope - Colorful geometric patterns
  • bubbles - Floating bubble animation
  • cityscape - Parallax city skyline
  • And many more!

Set per-site in index.html:

var default_background = "gears";

Multi-Site Setup

Host multiple sites from one installation:

# Create sites
mkdir -p sites/portfolio.com sites/blog.com

# Copy templates
cp -r index.html pages/ sites/portfolio.com/
cp -r index.html pages/ sites/blog.com/

# Add descriptions
echo "My portfolio site" > sites/portfolio.com/description.md
echo "My blog" > sites/blog.com/description.md

Access via:

  • Path: http://localhost:3000/portfolio.com/
  • Domain: http://portfolio.com:3000 (with hosts file)

Documentation

  • QUICKSTART.md - Complete setup guide with deployment instructions
  • CLAUDE.md - Architecture and development guide

Production Deployment

Use the included start-ssl.sh script for automatic SSL with Let's Encrypt:

# Edit email in start-ssl.sh, then run:
sudo ./start-ssl.sh

This automatically:

  • Discovers all site domains from sites/ directory
  • Provisions SSL certificates via Let's Encrypt
  • Sets up pm2 to restart on boot
  • Listens on ports 80 (HTTP โ†’ HTTPS redirect) and 443 (HTTPS)

Option 2: Reverse Proxy with Nginx

See nginx-ajaxcms.conf for a sample nginx configuration.

Option 3: Manual PM2 Setup

# Development mode (port 3000)
./start-dev.sh

# Or customize manually:
PORT=3000 pm2 start server.js --name ajaxcms
pm2 save
pm2 startup

Full deployment instructions in QUICKSTART.md.

Requirements

  • Node.js 14+
  • npm or yarn

That's it! No database, no complex dependencies.

License

See LICENSE file for details.

Contact

Questions? Contact bhoult@gmail.com


Built with โค๏ธ for developers who love simplicity