Team: Warissa Hossain, Gemma Truong, Sky Tran, Jesus E. Gutierrez
Team 41 · BeachHack 9.0 — GitHub repo
FastAPI + Vite/React monorepo. Architecture, roles, and hackathon planning live under docs/MASTER_PLAN.md and docs/plans/ (T1–T4).
cd backend
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env # optional: edit later for real keys
uvicorn app.main:app --reload --port 8000- Health: http://127.0.0.1:8000/health
- OpenAPI: http://127.0.0.1:8000/docs
cd frontend
npm install
cp .env.example .env.local # default points API at http://127.0.0.1:8000
npm run devOpen the printed local URL (usually http://127.0.0.1:5173).
Do not commit real keys. Copy examples and fill locally:
| File | Purpose |
|---|---|
backend/.env.example |
Server + internal webhook secret + Mongo + Gemini (google-genai) + Twilio |
frontend/.env.example |
VITE_API_URL for browser → FastAPI |
Backend (pytest) — logic and request/response shape without requiring a real MongoDB or external APIs:
cd backend
source .venv/bin/activate
pytest- Tests live in
backend/tests/. - Prefer pure functions and Pydantic models for anything you want easy unit coverage.
Frontend (Vitest) — components and small modules in isolation:
cd frontend
npm run testBackend integration uses FastAPI’s TestClient to hit the real app in-process (Twilio/Mongo/Gemini still optional depending on .env):
cd backend
pytest -m integrationRun everything including integration-marked tests:
pytestThe integration marker is defined in backend/pytest.ini.
- Terminal A: from
backend/, runuvicorn app.main:app --reload --port 8000. - Terminal B: from
frontend/, runnpm run dev. - Confirm the UI shows healthy and a plan response from the API (stub if
GEMINI_API_KEYis unset; otherwise Gemini).
For WhatsApp / Fetch / Mongo: add keys to backend/.env, then repeat and point Twilio sandbox + Fetch callbacks at your deployed HTTPS URL.
Use this checklist when Mongo + Twilio are configured. If Mongo is unavailable and the app falls back to demo mode, the UI and WhatsApp replies still work, but saved-plan/session checks below will not persist server-side.
- Create a guest user and web plan from the onboarding flow.
Expected: a single new
plan-<plan_id>project appears in the web UI. - In WhatsApp, send
PLAN finish linked lists assignment. Expected: WhatsApp replies withPlan readyplus the first step. The web app shows one plan project for that newplan_id, not duplicates. - Reply
BUILD. Expected: WhatsApp returns the same saved plan. No secondplansrow should be created for that thread, and the web UI should still show one project for thatplan_id. - Reply
STUCK. Expected: the nudge resolves against the currently linked plan from WhatsApp rather than falling back to an unrelated task. - Reply
DONE. Expected: WhatsApp replies with completion guidance, the linked thread keeps itsactive_plan_id, and Mongo records a completed session for thatplan_ideven if no session had been started before. - After
DONE, send a free-form message likekeep going. Expected: old grocery/task conversation text does not leak back in; the WhatsApp draft memory was cleared onDONE. - Optional: send
PLAN a different task. Expected: WhatsApp seeds a fresh draft and saves a new canonical plan for that new task. The web UI switches to the newplan-<plan_id>project without creating duplicates for the same plan.
Production deploy (team default): Railway for backend/ (HTTPS). Vercel for frontend/; set VITE_API_URL to the Railway API origin. Add your Vercel URL(s) to backend CORS_ORIGINS on Railway. Details: docs/MASTER_PLAN.md and docs/plans/T4_DEVOPS_FETCH.md.
- Browser →
VITE_API_URL(seefrontend/.env.example). - FastAPI enables CORS for local dev; in production include your Vercel origin(s) in
CORS_ORIGINS. POST /planreturns the shared JSON shape; seedocs/MASTER_PLAN.md.
backend/ FastAPI app, Pydantic schemas, routers, pytest
frontend/ Vite + React + TypeScript
docs/ Master plan + per-role playbooks (T1–T4)