Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Zerostart

One-click OpenClaw/Moltbot provisioning for instant AI assistant deployment.

███████╗███████╗██████╗  ██████╗ ███████╗████████╗ █████╗ ██████╗ ████████╗
╚══███╔╝██╔════╝██╔══██╗██╔═══██╗██╔════╝╚══██╔══╝██╔══██╗██╔══██╗╚══██╔══╝
  ███╔╝ █████╗  ██████╔╝██║   ██║███████╗   ██║   ███████║██████╔╝   ██║   
 ███╔╝  ██╔══╝  ██╔══██╗██║   ██║╚════██║   ██║   ██╔══██║██╔══██╗   ██║   
███████╗███████╗██║  ██║╚██████╔╝███████║   ██║   ██║  ██║██║  ██║   ██║   
╚══════╝╚══════╝╚═╝  ╚═╝ ╚═════╝ ╚══════╝   ╚═╝   ╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝   

Overview

Zerostart is a backend provisioning engine that automates Digital Ocean droplet creation with Cloudflare DNS management. Users get their own dedicated OpenClaw (Moltbot) AI assistant server with a custom subdomain in minutes.

Live: https://zerostart.cloud

What is OpenClaw?

OpenClaw (formerly Moltbot/Clawd) is an open-source personal AI assistant that runs on your own infrastructure. It connects to messaging apps you already use (WhatsApp, Telegram, Slack, Discord) and provides a web-based control UI.

Architecture

flowchart TB
    subgraph User["👤 User"]
        Browser[Browser]
    end

    subgraph Frontend["🌐 Frontend (Vercel)"]
        Dashboard[Zerostart Dashboard]
        Auth[Supabase Auth]
    end

    subgraph Backend["⚙️ Zerostart API (Railway)"]
        API[Express API]
        Provisioner[Provisioner Service]
    end

    subgraph Services["☁️ External Services"]
        Supabase[(Supabase DB)]
        DO[Digital Ocean API]
        CF[Cloudflare API]
    end

    subgraph Droplets["🖥️ User Droplets (Moltbot Image)"]
        D1["zerocool.zerostart.cloud<br/>OpenClaw + Caddy SSL"]
        D2["alice.zerostart.cloud<br/>OpenClaw + Caddy SSL"]
        D3["bob.zerostart.cloud<br/>OpenClaw + Caddy SSL"]
    end

    Browser --> Dashboard
    Dashboard --> Auth
    Dashboard --> API
    API --> Provisioner
    Provisioner --> Supabase
    Provisioner --> DO
    Provisioner --> CF
    DO --> D1
    DO --> D2
    DO --> D3
Loading

Provisioning Flow

sequenceDiagram
    participant U as 👤 User
    participant FE as 🌐 Frontend
    participant API as ⚙️ Zerostart API
    participant SB as 🗄️ Supabase
    participant DO as 🌊 Digital Ocean
    participant CF as ☁️ Cloudflare

    U->>FE: Click "Create Instance"
    FE->>API: POST /api/droplets {subdomain: "zerocool"}
    API->>SB: Create droplet record (status: provisioning)
    API->>DO: Create droplet with Moltbot image
    DO-->>API: Return droplet_id
    API-->>FE: Return {status: provisioning}
    
    loop Poll every 5s
        FE->>API: GET /api/droplets/me
        API->>DO: Get droplet status & IP
        DO-->>API: Return IP when ready
    end

    API->>CF: Create DNS A record (zerocool → IP)
    API->>SB: Update status: active, ip_address
    API-->>FE: Return {status: active, ip_address}
    
    U->>D1: Access https://IP or https://zerocool.zerostart.cloud
    D1-->>U: OpenClaw Dashboard (first-time setup wizard)
Loading

Droplet Lifecycle

stateDiagram-v2
    [*] --> Provisioning: User creates instance
    Provisioning --> Active: Droplet ready + DNS configured
    Provisioning --> Error: Creation failed
    Active --> Destroyed: User deletes instance
    Error --> Destroyed: Cleanup
    Destroyed --> [*]
    
    Active --> Active: User accesses OpenClaw
Loading

Tech Stack

mindmap
    root((Zerostart))
        Backend
            Node.js 20+
            TypeScript
            Express
        Database
            Supabase
            PostgreSQL
        Infrastructure
            Digital Ocean Droplets
            Moltbot 1-Click Image
            Cloudflare DNS
        Deployment
            Railway
            Vercel
        Auth
            Supabase Auth
            JWT Tokens
Loading

API Endpoints

Method Endpoint Auth Description
GET /health No Health check
POST /api/droplets Yes Create droplet for user
GET /api/droplets/me Yes Get user's droplet (includes IP)
DELETE /api/droplets/me Yes Destroy user's droplet

Full API documentation: See API.md

Environment Variables

Backend (Railway)

# Digital Ocean
DO_API_TOKEN=dop_v1_xxx
DO_SSH_KEY_ID=53775063

# Supabase
SUPABASE_URL=https://xxx.supabase.co
SUPABASE_SERVICE_KEY=eyJxxx

# Cloudflare
CLOUDFLARE_API_TOKEN=xxx
CLOUDFLARE_ZONE_ID=xxx

# App
DOMAIN=zerostart.cloud
PORT=3000
NODE_ENV=production

Frontend (Vercel)

NEXT_PUBLIC_SUPABASE_URL=https://xxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJxxx
NEXT_PUBLIC_API_URL=https://zerostart-production.up.railway.app

Database Schema

CREATE TABLE droplets (
  id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
  user_id TEXT NOT NULL,
  droplet_id BIGINT NOT NULL DEFAULT 0,
  name TEXT NOT NULL,
  ip_address TEXT,
  subdomain TEXT NOT NULL,
  region TEXT NOT NULL DEFAULT 'nyc3',
  size TEXT NOT NULL DEFAULT 's-2vcpu-4gb',
  status TEXT NOT NULL DEFAULT 'provisioning',
  created_at TIMESTAMPTZ DEFAULT NOW(),
  updated_at TIMESTAMPTZ DEFAULT NOW()
);

-- Allow subdomain reuse after destroyed/error
CREATE UNIQUE INDEX droplets_subdomain_active_unique 
ON droplets (subdomain) 
WHERE status IN ('provisioning', 'active');

CREATE INDEX idx_droplets_user_id ON droplets(user_id);

Moltbot Image Details

The moltbot Digital Ocean 1-Click image includes:

  • Ubuntu 24.04 LTS
  • OpenClaw/Clawdbot pre-installed
  • Caddy web server with auto-SSL
  • Systemd service for auto-start

Accessing OpenClaw

Once droplet is active:

  1. Via IP (immediate): https://{ip_address}
  2. Via subdomain (after DNS ~2-5 min): https://{subdomain}.zerostart.cloud

First-Time Setup

Users see a setup wizard on first access:

  1. Select AI provider (Anthropic recommended)
  2. Enter API key
  3. Configure messaging channels (optional)

Management Commands (SSH)

# Check status
systemctl status clawdbot

# View logs
journalctl -u clawdbot -f

# Restart
systemctl restart clawdbot

# Update
/opt/update-clawdbot.sh

Local Development

# Clone repo
git clone https://github.com/your-org/zerostart.git
cd zerostart

# Install dependencies
npm install

# Create .env
cp .env.example .env
# Edit .env with your values

# Run development server
npm run dev

# Build for production
npm run build

# Start production server
npm start

Deployment

Railway (Backend)

  1. Connect GitHub repo to Railway
  2. Add environment variables
  3. Deploy automatically on push

Vercel (Frontend)

  1. Connect GitHub repo to Vercel
  2. Add environment variables
  3. Deploy automatically on push

Project Structure

zerostart/
├── src/
│   ├── config/
│   │   └── index.ts          # Environment config
│   ├── routes/
│   │   ├── droplets.ts       # Droplet CRUD endpoints
│   │   └── health.ts         # Health check
│   ├── services/
│   │   ├── digitalocean.ts   # DO API integration
│   │   ├── cloudflare.ts     # CF DNS management
│   │   └── supabase.ts       # Database operations
│   ├── utils/
│   │   ├── auth.ts           # JWT validation
│   │   ├── cors.ts           # CORS middleware
│   │   └── banner.ts         # ASCII banner
│   ├── types/
│   │   └── index.ts          # TypeScript types
│   └── index.ts              # Express app entry
├── package.json
├── tsconfig.json
├── API.md                    # API documentation
└── README.md

Cloudflare Configuration

DNS Records

Type Name Content Proxy
A @ Vercel IP Yes
CNAME www cname.vercel-dns.com Yes
A {subdomain} Droplet IP Yes

SSL/TLS Settings

  • Mode: Full (strict)
  • Always Use HTTPS: On
  • Minimum TLS: 1.2

Troubleshooting

Droplet not becoming active

  1. Check Railway logs for DO API errors
  2. Verify DO_API_TOKEN is valid
  3. Check DO dashboard for droplet status

DNS not resolving

  1. Check Cloudflare DNS records
  2. Verify CLOUDFLARE_API_TOKEN has DNS edit permissions
  3. Wait 2-5 minutes for propagation

521 Error (Cloudflare)

  1. Droplet might still be booting (wait 2-3 min)
  2. Check if OpenClaw service is running: systemctl status clawdbot
  3. Verify Cloudflare SSL mode is "Full" or "Full (strict)"

CORS Errors

  1. Check src/utils/cors.ts includes frontend origin
  2. Verify OPTIONS preflight is handled
  3. Check Railway deployment has latest code

Security Notes

  • All API endpoints require Supabase JWT authentication
  • Droplets are created with SSH key access only (no password)
  • OpenClaw dashboard uses gateway tokens for access
  • Cloudflare proxy hides origin IP addresses
  • HTTPS enforced via Cloudflare and Caddy

Cost Estimates

Resource Cost
Droplet (s-2vcpu-4gb) $24/month per user
Railway ~$5/month
Cloudflare Free
Supabase Free tier
Vercel Free tier

Contributing

  1. Fork the repo
  2. Create feature branch: git checkout -b feature/amazing
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push: git push origin feature/amazing
  5. Open Pull Request

License

MIT


Links

About

zerostart for openclaw

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages