Skip to content

Architecture

The Minion system consists of three layers: HQ, Supabase, and Minion Servers.

flowchart TD
HQ["<b>HQ Server</b> — ECS Fargate<br/>Next.js + Custom Server<br/>WebSocket proxy: VNC / Terminal<br/>Google OAuth via Supabase Auth<br/>Stripe billing: Free / Pro / Enterprise<br/>API: Minion mgmt / Projects / Skills / Workflows"]
SB["<b>Supabase</b><br/>PostgreSQL — RLS by user_id<br/>Auth — Google OAuth<br/>Storage — skill files<br/>Realtime — dashboard updates"]
MS["<b>Minion Server</b> — Lightsail VPS<br/>@geekbeer/minion Fastify API :3001<br/>Claude Code CLI + MCP servers<br/>Xvfb + noVNC :6080<br/>ttyd terminal :7681<br/>Cloudflare Tunnel"]
HQ -->|"HTTPS / WSS"| SB --> MS

HQ is a Next.js-based management server deployed on ECS Fargate.

  • Custom server — Wraps Next.js and provides WebSocket proxying (VNC / Terminal)
  • Authentication — Google OAuth via Supabase Auth
  • API — Minion communication (API token auth) and dashboard operations (session auth)
  • Billing — Stripe (Free / Pro / Enterprise plans)

Each minion runs as an isolated environment on a Lightsail VPS.

PortServicePurpose
3001Fastify APIHQ communication, skill/workflow management
6080noVNC (websockify)VNC access from browser
7681ttydWeb terminal

The following jobs are executed via EventBridge Scheduler + Lambda.

JobDescription
expire-trialsFree tier trial expiration → snapshot + pause
cleanup-snapshotsDelete expired snapshots and minion records
track-usageReport compute hours to Stripe Meters