Push code. Claude configures it. Spawn deploys it. The self-healer fixes it.
GitHub Push → Webhook → Deploy Queue (BullMQ)
↓
Claude Opus 4.6 Analysis
(Dockerfile + RAM + config)
↓
Fly.io Machines API deploy
↓
Health Monitor (every 30s)
→ Auto-restart → Scale → Claude heal
↓
Email / Webhook notification
- Bun installed
- Fly.io account +
flyctlinstalled and authenticated - Supabase project
- GitHub App created
- Redis (local:
brew install redis && brew services start redis)
- Permissions: Contents (read), Metadata (read)
- Subscribe to events: Push
- Callback URL:
http://localhost:3001/github/callback - Webhook URL:
http://localhost:3001/github/webhook(use ngrok for local dev)
- Create a new project
- Run
apps/api/src/db/schema.sqlin the SQL editor - Run
apps/api/src/db/functions.sqlin the SQL editor - Enable GitHub OAuth in Authentication → Providers
cp apps/api/.env.example apps/api/.env
cp apps/web/.env.example apps/web/.env.local
# Fill in all valuesbun install
bun run dev # starts both API (3001) and web (3000)
bun run worker # start deploy worker + health checker in separate terminal| File | Purpose |
|---|---|
apps/api/src/agents/analyzer.ts |
Claude Opus 4.6 — analyzes repo, generates Dockerfile |
apps/api/src/agents/analyzer.ts (diagnoseCrash) |
Claude diagnoses crashes, returns fix |
apps/api/src/workers/deploy.ts |
Full deploy pipeline (clone → analyze → build → deploy) |
apps/api/src/workers/healer.ts |
Self-healing loop (health checks + auto-scale + Claude) |
apps/api/src/services/fly.ts |
Fly.io Machines API wrapper |
apps/web/app/deploy/page.tsx |
One-click deploy UI |
apps/web/app/dashboard/page.tsx |
App dashboard |
Health check fails
→ 1st/2nd failure: restart machine
→ 3rd+ failure: send crash logs to Claude Opus 4.6
→ OOM detected? scale_memory (double RAM)
→ Code error? redeploy_with_fix (patch Dockerfile)
→ Transient? restart
→ Unknown? notify_only (email user)
Memory > 85%? → scale_memory proactively (1.5x RAM)
