ClinicBot · Build Crew · Onboarding
Five owners, one outcome. By the end of this page you'll have the app running locally, all tests green, and you'll know exactly where your slice lives. No one here waits to be told.
The app boots with credential-free stub adapters, so you can run the entire core loop before touching Supabase or Meta.
corepack enable # makes pnpm available
pnpm install
cp .env.example .env.local
pnpm test
13 tests should pass, including the full message → booking → reply loop with fakes.
pnpm dev # http://localhost:3000
Home page → dashboard. Health check: GET /api/webhooks/whatsapp.
Fill these into .env.local. Each one flips its module from stub to real — independently.
| Set this | Unlocks |
|---|---|
DATABASE_URL + DIRECT_URL | Real Supabase Postgres (Drizzle adapters) |
NEXT_PUBLIC_SUPABASE_* | Dashboard auth (doctor login) |
GEMINI_API_KEY | Real intent detection (V2) |
SARVAM_API_KEY | Real Telugu/Hindi translation (V2) |
WHATSAPP_* | Real inbound webhook + outbound replies (V4) |
Database setup, once you have a Supabase project:
pnpm db:generate # create the SQL migration from the schema
pnpm db:migrate # apply it
psql "$DIRECT_URL" -f drizzle/0001_rls.sql # turn on Row-Level Security
pnpm db:seed # one demo clinic (Sunshine Clinic)
0001_rls.sql so a forgotten WHERE clinic_id
can never leak another clinic's data.
| Vector | Your territory | Start in |
|---|---|---|
| V1 Bot brain | Conversation logic, intents, dialog state, no-show rescue | src/modules/bot-brain |
| V2 Language & voice | Telugu/Hindi NLU, Sarvam, transliteration | src/modules/language |
| V3 Doctor dashboard | Next.js web app, calendar, analytics, settings | src/app/(dashboard) |
| V4 Integrations & infra | Practo, UPI, WhatsApp API, deploy, on-call | src/modules/integrations, booking adapters |
| V5 Glue / infra | Tenant router, DB, config, the seams | src/modules/tenancy, src/server |
You own your slice like it has your name on the door — because it does. Everyone reviews everyone; the core (repo, CI, standards, first clinics) belongs to all of us.
pnpm dev # run the app
pnpm test # run all tests
pnpm test:watch # TDD loop
pnpm typecheck # tsc --noEmit
pnpm lint # eslint
pnpm format # prettier --write
pnpm db:studio # browse the database
Read Contributing & SOLID.
The short version: pnpm typecheck && pnpm test && pnpm lint all
green, new behaviour has a test, and any new vendor lives behind a port —
never imported into the domain.