RaisFastRaisFast
SSG Integration

SSG Integration

Use RaisFast as the backend for your Hugo, Astro, Hexo, or any static site generator. Comments, search, auth, ecommerce, and payment — all in one binary.

Static Sites Need a Backend

Static site generators (SSGs) like Hugo, Astro, Jekyll, Hexo, and 11ty are incredibly fast and simple. But they have a fundamental limitation: they only generate static HTML. The moment you need dynamic features, you're stuck.

The Current Approach: Stitch Together 5+ Services

Most SSG users end up assembling a fragmented stack:

Hugo / Astro (static pages)
  + Disqus or Giscus        → comments
  + Algolia or DocSearch    → search
  + Netlify Forms           → form submissions
  + Cloudinary              → media management
  + Auth0 or Firebase Auth  → user login
  + Stripe                  → payment
  = 5-8 accounts, bills, API keys, and maintenance

The RaisFast Approach: One Binary

Hugo / Astro (static pages)
  + RaisFast → comments + search + forms + media + auth + payment
  = One binary, one data source, one deployment

What RaisFast Provides for SSGs

FeatureHow SSG Users Typically Solve ItRaisFast
CommentsDisqus (ads in free tier) or Giscus (GitHub-dependent)Built-in comment system, zero ads
SearchAlgolia (limited free tier) or client-side onlyTantivy full-text search, no limits
FormsNetlify Forms or Formspree (limited submissions)Unlimited form submissions
AuthAuth0 or Firebase (complex setup)JWT + OAuth, simple API
MediaCloudinary (paid) or Git-basedLocal storage or S3
EcommerceNo good option for static sitesCart, orders, products built-in
PaymentStripe integration from scratchAlipay, WeChat Pay, Stripe built-in
Admin UIEdit Markdown files manuallyReact admin dashboard
APINoneAuto-generated REST API
Multi-tenantNot possibleDomain-based tenant isolation

Architecture

┌─────────────────────────────────────────┐
│            User Browser                 │
│                                         │
│  Static HTML (from Hugo/Astro)          │
│       +                                 │
│  Dynamic Data (from RaisFast API)       │
│    - Comments widget                    │
│    - Search bar                         │
│    - Login / signup                     │
│    - Shopping cart                      │
└─────────────┬───────────────────────────┘

     ┌────────┴────────┐
     │                 │
     ▼                 ▼
  CDN/Nginx        RaisFast
  (static files)   (API server)
                   port 9898
                   ┌─────────────┐
                   │ SQLite / PG │
                   │ Auth        │
                   │ Comments    │
                   │ Search      │
                   │ Ecommerce   │
                   │ Payment     │
                   └─────────────┘

Quick Start

1. Start RaisFast

curl -fsSL https://raisfast.com/install.sh | sh
raisfast

2. Your SSG builds static pages as usual

# Hugo
hugo build

# Astro
astro build

3. Connect via API

// Fetch posts from RaisFast during build
const res = await fetch("http://localhost:9898/api/v1/posts");
const posts = await res.json();

// Or use the JS SDK in the browser for dynamic features
import { RaisFast } from "@raisfast/sdk";
const rf = new RaisFast({ baseUrl: "http://localhost:9898/api" });

Choose Your SSG

SSGGuideBest For
HugoHugo + RaisFast →Tech blogs, docs sites, personal sites
AstroAstro + RaisFast →Modern content sites, developer blogs
HexoHexo + RaisFast →Chinese tech blogs
Any SSGComments & Search →Universal comment and search integration

Deployment

Both your SSG output and RaisFast can run on the same server:

# Nginx config
server {
    listen 80;

    # Static files from Hugo/Astro
    location / {
        root /var/www/static;
        try_files $uri $uri/ /index.html;
    }

    # RaisFast API
    location /api/ {
        proxy_pass http://127.0.0.1:9898;
    }

    # RaisFast Admin
    location /admin {
        proxy_pass http://127.0.0.1:9898;
    }
}

One server, one RaisFast binary, one Nginx config. That's your complete website stack.

On this page