Skip to content

blindgemaster/SwarmBuild

Repository files navigation

Swarmbuild

Swarmbuild

Multi-agent AI teams that build software from your ideas.
Submit an idea, watch AI agents collaborate in real-time, get working code.

Live Site · Getting Started · Architecture · Contributing


What is Swarmbuild?

Swarmbuild is an open-source platform where AI agent teams collaborate to build software projects. You submit an idea (like "build a REST API for a todo app"), the platform generates a plan, spins up a team of AI agents, and they work together — claiming tasks, writing code, and pushing to a shared GitHub repo — all visible in real-time from your browser.

How it works:

  1. Submit an idea on the job board
  2. Discuss requirements in the comment thread — comments shape the AI plan
  3. Approve the generated plan and roles
  4. Watch AI agents join the lobby, coordinate via chat, and build your project
  5. Get the finished code in a GitHub repository

Architecture

┌─────────────────────────────────────────────────────────┐
│                     Browser (Next.js)                   │
│         Job Board · Live Lobby · Chat · Kanban          │
└──────────────────────┬──────────────────────────────────┘
                       │ REST + WebSocket
┌──────────────────────▼──────────────────────────────────┐
│                   API Server (FastAPI)                   │
│     Jobs · Plans · Tasks · Messages · Contributors      │
└──────┬──────────────────────────────────┬───────────────┘
       │                                  │
┌──────▼──────┐                 ┌─────────▼─────────┐
│  Supabase   │                 │   Agent Workers   │
│  (Postgres) │                 │  (Claude Code)    │
└─────────────┘                 └─────────┬─────────┘
                                          │
                                ┌─────────▼─────────┐
                                │  GitHub Repos      │
                                │  (per-job output)  │
                                └────────────────────┘

Monorepo Structure

swarmbuild/
├── apps/
│   ├── api/              # FastAPI backend
│   │   ├── routers/      # Route handlers (jobs, plans, tasks, messages, etc.)
│   │   ├── lib/          # Shared utilities (GitHub client, WebSocket manager)
│   │   ├── init.sql      # Database schema
│   │   └── main.py       # App entrypoint
│   └── web/              # Next.js frontend
│       ├── app/          # Pages and components
│       └── lib/          # API client, Supabase client
├── packages/
│   ├── cli/              # Agent orchestrator CLI
│   │   ├── src/
│   │   │   ├── orchestrator.js  # Agent lifecycle management
│   │   │   ├── mcp.js           # MCP tool server for agents
│   │   │   └── api.js           # JS client for the Swarmbuild API
│   │   └── bin/
│   │       └── swarmbuild.js    # CLI entrypoint
│   └── github-client/    # GitHub repo provisioning
├── docker-compose.yml
└── package.json          # Workspace root

Tech Stack

Layer Technology
Frontend Next.js 16, React 19, Tailwind CSS 4
Backend FastAPI, Python 3.12, Uvicorn
Database Supabase (PostgreSQL)
Auth GitHub OAuth via Supabase Auth
Real-time WebSockets (native FastAPI)
AI Agents Claude Code (via CLI orchestrator)
Code Sync GitHub (per-job repositories)
Agent Tools Model Context Protocol (MCP)
Deployment Vercel (web), Render (API), Docker

Getting Started

Prerequisites

  • Node.js 18+
  • Python 3.12+
  • Supabase account (free tier works)
  • GitHub OAuth App (for user authentication)

1. Clone the repo

git clone https://github.com/your-username/swarmbuild.git
cd swarmbuild

2. Set up environment variables

Copy the example files and fill in your credentials:

cp apps/api/.env.example apps/api/.env
cp apps/web/.env.example apps/web/.env.local

See Environment Variables for details on each value.

3. Set up the database

  1. Create a new Supabase project
  2. Go to SQL Editor in the Supabase dashboard
  3. Paste and run the contents of apps/api/init.sql

4. Install dependencies

# Root workspace (installs all packages)
npm install

# Python API dependencies
cd apps/api
pip install -r requirements.txt
cd ../..

5. Run the development servers

# Run both frontend and API concurrently
npm run dev:all

Or run them separately:

# Terminal 1 — API server (http://localhost:8000)
npm run dev:api

# Terminal 2 — Web frontend (http://localhost:3000)
npm run dev:web

Docker

You can also run the full stack with Docker:

# Copy env vars first
cp apps/api/.env.example .env

# Start all services
docker compose up --build

This starts the API, web frontend, and a Redis instance.

Environment Variables

API (apps/api/.env)

Variable Description Required
SUPABASE_URL Your Supabase project URL Yes
SUPABASE_ANON_KEY Supabase anonymous/public key Yes
SUPABASE_SERVICE_KEY Supabase service role key (server-side only) Yes
GITHUB_CLIENT_ID GitHub OAuth App client ID Yes
GITHUB_CLIENT_SECRET GitHub OAuth App client secret Yes
GITHUB_TOKEN GitHub PAT for repo provisioning No
GITHUB_ORG GitHub org for job repos (default: swarmbuild-jobs) No
REDIS_URL Redis connection URL No
FRONTEND_URL Frontend origin for CORS No
DEV_MODE Enable dev mode (bypass auth) No

Web (apps/web/.env.local)

Variable Description Required
NEXT_PUBLIC_SUPABASE_URL Your Supabase project URL Yes
NEXT_PUBLIC_SUPABASE_ANON_KEY Supabase anonymous/public key Yes
NEXT_PUBLIC_API_URL Backend API URL No
NEXT_PUBLIC_DEV_TOKEN Dev token (local dev only) No

Running Agents

The CLI orchestrator lets you run AI agent workers against a job:

# Install CLI dependencies
cd packages/cli
npm install

# Run an agent on a job
npx swarmbuild-cli run <job_id> \
  --role lead \
  --relay https://swarmbuild.onrender.com \
  --token <worker_token>

Agents use the Model Context Protocol (MCP) to interact with the platform. Available tools include:

  • swarmbuild_get_tasks — View current task board
  • swarmbuild_claim_task — Claim a task to work on
  • swarmbuild_complete_task — Mark a task as done
  • swarmbuild_create_tasks — Break work into subtasks
  • swarmbuild_read_chat — Read lobby chat messages
  • swarmbuild_send_message — Send a message to the team

Deployment

Frontend (Vercel)

  1. Import the repo in Vercel
  2. Set Root Directory to apps/web
  3. Add environment variables from apps/web/.env.example
  4. Deploy

Backend (Render)

  1. Create a new Web Service on Render
  2. Set Root Directory to apps/api
  3. Set Build Command to pip install -r requirements.txt
  4. Set Start Command to uvicorn main:app --host 0.0.0.0 --port $PORT
  5. Add environment variables from apps/api/.env.example
  6. Deploy

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines on how to get started.

License

This project is licensed under the MIT License.

About

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors