Staticraft v0.1.7
Security-First Static Site Engine for Node.js

Generate Privately. Serve Statically. Update Continuously.

Staticraft decouples HTML rendering from public serving. An isolated background generator builds pages with atomic file swaps, while Nginx or CDNs serve high-speed traffic with zero exposed public app ports.

Read Documentation
$ npm install -g staticraft
🛡️ Zero Public Ports
Generator runs isolated in private network
⚡ Atomic Swaps
Zero-downtime rename(2) page updates
🔄 Timer Revalidation
Background schedule-driven HTML updates
🧩 Zero Dependencies
100% native Node.js standard library
staticraft dev --port 4455
bash
  ___ _____ _ _____ ___ ___ ___    _   ___ _____ 
 / __|_   _/_\_   _|_ _/ __| _ \  /_\ | __|_   _|  Staticraft v0.1.7
 \__ \ | |/ _ \| |  | | (__|   / / _ \| _|  | |    Generate privately.
 |___/ |_/_/ \_\_| |___\___|_|_\/_/ \_\_|   |_|    Serve statically.
                                                   Update continuously.
🚀 Staticraft Dev Server running at:
> Local: http://localhost:4455/
> Output: .raft/
> Watching: src/app/ for live changes...
[Staticraft Builder] Compiled 8 static pages into .raft/ in 85ms

Decoupled Architecture

How Staticraft Operates

By severing the connection between public web traffic and your dynamic database backend, Staticraft delivers bulletproof security, zero-downtime updates, and sub-millisecond static response times.

1. Private Network Isolated Worker

Background Generator

A daemon process running inside a private network or CI/CD runner. It pulls data from DBs, CMS, or APIs and compiles static HTML.

> server.js data()
> TemplateEngine.render()
> ScheduleManager timer
Atomic Swapper rename(2) POSIX
2. Public Workspace Zero App Ports

Nginx / Caddy / CDN

The public web server serves pre-rendered static HTML files directly from `.raft/`. Zero Node.js runtime overhead on HTTP hits.

> root .raft/
> Cache-Control: 1 Year
> error_page 404 /404.html
Zero vulnerable open application ports exposed to public web traffic
Learn how to set up Nginx / Caddy

Core Features

Built for Security, Speed, and Simplicity

Everything required for high-performance static websites without complex toolchains or runtime attack vectors.

Zero Exposed Ports

In production mode (staticraft start), the generator opens zero public HTTP listening ports. Web traffic hits only static files.

Security-First Architecture

Atomic Swapping

HTML pages are written to staging files before an atomic POSIX rename(2) swap, eliminating half-rendered pages or torn reads.

Zero-Downtime Updates

Timer Revalidation

Define revalidate: 600 to automatically refresh HTML every 10 minutes in the background without manual CI redeploys.

ScheduleManager Engine

Zero Dependencies

Zero third-party npm runtime dependencies. Built entirely with native Node.js standard modules for minimal supply-chain risk.

Native Node 18+

Asset Fingerprinting

Staticraft automatically hashes static CSS and JS assets (e.g. styles.07eef7b1.css) and rewrites template references.

Cache Busting

Auto Sitemap & Robots

Generates sitemap.xml and robots.txt out of the box during build and dev mode automatically.

Automated SEO

Developer Workflow

Clean, Expressive Code Structures

File-based routing with colocated route controllers and HTML templates.

ECMAScript Module
export default {
    // Background revalidation interval (refresh HTML every 10 minutes)
    revalidate: 600,

    // Data hook called by Staticraft rendering engine
    data: async () => {
        const res = await fetch('https://api.github.com/repos/Abhay-Vachhani/staticraft');
        const repo = await res.json();
        
        return {
            title: 'Staticraft Engine',
            stars: repo.stargazers_count || 120,
            license: repo.license?.spdx_id || 'MIT'
        };
    }
};
                
Colocated data & schedule control per route
Zero Node.js web server runtime on HTTP requests
Ready to build secure static sites?

Start Building with Staticraft Today

Zero configuration setup. Zero npm dependencies. Deploy high-performance, security-hardened static sites in minutes.