This repo now has one enforced workflow surface. Use the root Makefile instead of ad hoc commands.
- Copy the environment templates.
cp .env.example .envcp frontend/.env.local.example frontend/.env.local - Install dependencies.
make setup - Run the explicit backend bootstrap once per fresh workspace or when the local Chroma or Supabase state needs repair.
make bootstrap
make devruns backend and frontend together.make dev-backendruns the FastAPI app onhttp://127.0.0.1:8000.make dev-frontendruns Next.js onhttp://127.0.0.1:3000.- Override local ports when needed with
make dev BACKEND_PORT=8001 FRONTEND_PORT=3001. - Rehearse against a public backend tunnel with
make dev-frontend FRONTEND_BACKEND_URL=https://<your-ngrok-host>. make test-backendrunspytest -qfrom the repo root.make test-frontendruns the frontend Node test suite.make lintruns the frontend ESLint gate.make typecheckrunstsc --noEmit.make buildruns the production Next.js build.make checkruns the full repo gate: backend tests, frontend tests, lint, typecheck, and build.
The tracked frontend is already linked to the govbot Vercel project under frontend/.vercel/project.json.
For demo deployments where Vercel serves the frontend and ngrok exposes the backend:
- In the Vercel frontend project, set:
BACKEND_URL=https://<your-ngrok-host>NEXT_PUBLIC_API_URL=https://<your-ngrok-host>NEXT_PUBLIC_FRONTEND_URL=https://<your-project>.vercel.appNEXT_PUBLIC_SUPABASE_URL=...NEXT_PUBLIC_SUPABASE_KEY=... - In the backend
.env, set:FRONTEND_URL=https://<your-project>.vercel.appBASE_URL=https://<your-project>.vercel.appCORS_ORIGINS=http://localhost:3000,https://<your-project>.vercel.app - Keep browser-visible calls on the frontend origin by using the
/api/*proxy routes instead of hard-coding the backend host in pages or components.
- CI runs
make setupandmake checkon every push and pull request. - CI installs the system
tesseract-ocrruntime before dependency setup so local OCR checks exercise the same binary expected by production containers. - Do not bypass failing lint, type, or build errors to get a green build.
- FastAPI startup is intentionally non-mutating now. If local document cleanup or RAG ingestion is needed, run
make bootstrapexplicitly.
- Work on a feature branch. Keep
mainclean. - Do not commit
.env,frontend/.env.local,.next,node_modules,chroma_db, or personal IDE state. - Before asking for review or merging, run
make check.
After workflow or user-facing changes, verify the app from the browser, not just with unit tests.
- Start the backend and frontend with
make dev. - Confirm the backend health check at
http://127.0.0.1:8000/govbot/health. - Walk the main demo routes from the frontend:
//services/official-login/documents/form-fill/renewals/bank-verify/track-search/gov-dashboard/admin - Record any flow that depends on real third-party credentials or seeded Supabase data.
- Shared Cursor MCP setup lives in
.cursor/mcp.json. - Shared agent workflow guidance lives in
AGENTS.md. - Keep manual MCP approvals enabled, especially for Supabase and Vercel.