A Lovable-style AI app generator running entirely on Cloudflare. Describe an app in chat and the platform generates and deploys a full-stack app — frontend, Worker backend, D1 database, and auth — in minutes.
- Describe your app in the chat prompt
- The AI agent (Claude Sonnet) generates three files:
worker.js,index.html, andmigration.sql - Files are stored in R2 and deployed as a live Cloudflare Worker via Workers for Platforms
- Iterate by chatting — the agent reads the existing files, patches what changed, and redeploys
- Deploy when ready using the Deploy button in the preview header
- CRUD apps with user auth (register, login, JWT sessions)
- Multi-table relational data models (D1/SQLite)
- Dashboards, trackers, admin panels, booking systems
- Apps with multiple views and client-side routing
- External API integrations (proxied through the Worker)
- File storage via R2
Generated apps use: Preact + htm + Tailwind CSS (CDN) on the frontend, Cloudflare Workers + D1 + R2 on the backend. No npm dependencies — everything runs natively on the edge.
- Builder UI — served at
/, single-page app with sidebar chat and preview iframe - Platform Worker (Hono) — API routes for auth, chat, projects, and build pipeline
- Claude Agent loop —
claude-sonnet-4-6with tool use: reads/writes files to R2, triggers deploy - Cloudflare Workflows — durable build pipeline with retries; survives timeouts
- Workers for Platforms — each generated app is its own Worker in a dispatch namespace
- Per-app resources — each project gets a dedicated D1 database and a shared R2 bucket for code storage
- SSE build events — real-time progress stream from agent to UI during builds
POST /api/auth/registerPOST /api/auth/loginPOST /api/auth/change-password
GET /api/projects— list user's projectsPOST /api/projects— create project (AI-generates name from description)GET /api/projects/:id— get projectPOST /api/projects/:id/build— trigger build workflowGET /api/projects/:id/stream— SSE stream of build eventsGET /api/projects/:id/events— poll build eventsGET /api/projects/:id/files— list R2 files for projectDELETE /api/projects/:id— delete project and all resources
POST /api/chat— send message, triggers agent workflowGET /api/chat/:projectId/history— fetch message history
GET /apps/:projectId/*— dispatches to the project's deployed Worker
- Node 18+
- Cloudflare account (paid plan required for Workers for Platforms)
- Wrangler CLI (
npm install -g wrangler) - Anthropic API key
-
Install dependencies
npm install
-
Create Cloudflare resources
-
D1 (platform DB)
npx wrangler d1 create platform-db
Copy the
database_idintowrangler.tomlunder[[d1_databases]]. -
R2 bucket
npx wrangler r2 bucket create user-code
-
KV namespace
npx wrangler kv namespace create SESSIONS
Copy the
idintowrangler.tomlunder[[kv_namespaces]]. -
Dispatch namespace In the Cloudflare dashboard: Workers for Platforms → Create dispatch namespace → name it
user-apps.
-
-
Run platform migrations
npm run db:migrate:local # local dev npm run db:migrate # remote
-
Set secrets
npx wrangler secret put ANTHROPIC_API_KEY npx wrangler secret put CLOUDFLARE_API_TOKEN npx wrangler secret put PLATFORM_JWT_SECRET
The
CLOUDFLARE_API_TOKENneeds: Workers Scripts Write, D1 Edit, R2 Object Read/Write, Account Settings Read. ThePLATFORM_JWT_SECRETcan be any long random string (openssl rand -hex 32). -
Set account ID
In
wrangler.tomlunder[vars], setCLOUDFLARE_ACCOUNT_IDto your Cloudflare account ID. -
Local dev
npm run dev
Open
http://localhost:8787, register, describe your app, and hit Build. -
Deploy
npm run deploy
src/
index.ts # Hono app entrypoint: routing, /apps/:id/* dispatch
agent.ts # Claude tool-use agent loop (generate → write → deploy)
build.ts # Build pipeline: reads conversation, calls agent
workflow.ts # Cloudflare Workflow: durable agent execution with retries
builderScript.ts # Browser JS for the builder UI (served at /builder-app.js)
ui.ts # Builder UI HTML shell
auth.ts # Password hashing (SHA-256 + salt) and JWT (HMAC-SHA256)
middleware.ts # JWT auth middleware
cf-api.ts # Cloudflare REST API: D1, Worker deploy/delete, R2
teardown.ts # Delete project Worker, D1 database, and R2 files
types.ts # Shared TypeScript types and Env interface
ai.ts # (legacy) Workers AI helpers
routes/
auth.ts # Register, login, change-password
chat.ts # Send message, chat history
projects.ts # Projects CRUD, build trigger, SSE stream, file list
schema/
platform.sql # Platform D1 schema (users, projects, chat_messages, build_events, build_logs)
- Each agent build run makes several Anthropic API calls (Claude Sonnet 4.6)
- Each deployed app is a Worker in the dispatch namespace with its own D1 database
- Workers, D1, R2, KV, and Workers for Platforms are billed per Cloudflare pricing
- Project names are AI-generated using Claude Haiku (lightweight, fast)