DrawToCloud is an AI-assisted AWS architecture builder. Users describe an app, get a live diagram, iterate through chat/canvas edits, and export Terraform with cost and architecture explanations.
- Frontend: Next.js 14 (
frontend/) with App Router, Supabase auth, React Flow canvas. - Backend: FastAPI (
backend/) with HTTP + WebSocket orchestration and multi-agent generation pipeline. - Database/Auth: Supabase (external project; schema in
supabase/migrations/). - Dev proxy: Nginx (
proxy/nginx.conf) routes:/-> frontend/api/*-> backend/ws-> backend websocket
Generation pipeline (backend):
- Requirements agent
- Architect agent (streams diagram events)
- In parallel: Coder (Terraform), Cost Analyst, Description agent
frontend/: UI routes, chat/canvas pipeline, auth/session UXbackend/: FastAPI API, websocket protocol, orchestration, agentssupabase/migrations/: SQL schema, RLS policies, RPCsproxy/: Nginx config for same-origin Docker devtests/docker/test_compose_proxy.sh: Docker compose/proxy regression checkdev.sh: tmux-based local dev launcher (frontend + backend)docker-up.sh: helper to start compose and print app URL
Choose either Docker or local runtimes.
- Docker path:
- Docker + Docker Compose
- Local path:
- Python +
uv(backend) - Node.js +
pnpm(frontend) tmux(optional, for./dev.sh)
- Python +
Create a root .env file for Docker Compose (or set env vars in your shell). Minimum set:
SUPABASE_URL=https://<project-ref>.supabase.co
SUPABASE_PUBLISHABLE_KEY=<publishable-key>
SUPABASE_SECRET_KEY=<secret-key>
# At least one provider key unless users will always use BYOK
ANTHROPIC_API_KEY=...
# OPENAI_API_KEY=...
# OPENROUTER_API_KEY=...
# Optional
ADMIN_EMAILS=you@example.com,another@example.comBackend-specific optional vars:
ALLOWED_ORIGINS(default:http://localhost:3000)WEB_CONCURRENCY(must remain1)LLM_KEY_ENCRYPTION_SECRET(required if using BYOK key storage)
Frontend .env (for local frontend outside Docker), based on frontend/.env.example:
NEXT_PUBLIC_SUPABASE_URL=<supabase-url>
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=<publishable-key>
NEXT_PUBLIC_WS_URL=ws://localhost:8000/ws
NEXT_PUBLIC_API_URL=http://localhost:8000
NEXT_PUBLIC_DEFAULT_TEMPLATE_SLUG=<template-slug>
# Optional domain/feature flags
NEXT_PUBLIC_APP_DOMAIN=app.drawtocloud.com
NEXT_PUBLIC_LANDING_DOMAIN=drawtocloud.com
NEXT_PUBLIC_ENABLE_SOCIAL_AUTH=false# from repo root
docker compose up -d
# or
./docker-up.shCompose starts frontend, backend, and proxy. Proxy exposes container port 80 on a random host port.
Find URL:
docker compose port proxy 80./dev.shBackend:
cd backend
uv sync
uv run uvicorn main:app --host 0.0.0.0 --port 8000 --reload --reload-exclude '.venv/*' --reload-exclude '.pytest_cache/*' --reload-exclude '__pycache__/*'Frontend:
cd frontend
pnpm install
pnpm devBackend tests:
cd backend
uv run pytestDocker/proxy config check:
bash tests/docker/test_compose_proxy.shFrontend currently has lint/build scripts but no test script:
cd frontend
pnpm lint
pnpm buildSchema and RPC definitions are in supabase/migrations/.
Notable database capabilities defined there include:
profiles,projects, anduser_llm_keystables- RLS policies for ownership/public sharing
- Atomic RPC helpers like
append_chat_messageandcheck_and_reserve_quota
Apply migrations using your Supabase workflow (CLI or SQL editor) against your project before running the app.
HTTP endpoints (backend):
GET /healthGET /health/readyPOST /api/questionnairePOST /api/generations/startGET /api/me/entitlementsPOST /api/llm-keyGET /api/llm-keyDELETE /api/llm-key
WebSocket endpoint:
/ws
- Backend is intentionally single-worker. Multi-worker (
WEB_CONCURRENCY > 1oruvicorn --workers > 1) is blocked because in-memory runtime/subscriber state is used. - Cost analyst can use
infracostwhen available and falls back when unavailable. - Share pages are public by slug (
/p/[slug]) while edit capabilities depend on ownership/auth.
backend/README.mdis empty andfrontend/README.mdis still boilerplate; this root README is the main project entry.- Frontend has no automated test suite configured in
package.json. - There is a Python version mismatch to resolve:
backend/pyproject.tomlrequires>=3.12whilebackend/Dockerfile.devcurrently usespython:3.11-slim.