ClinicBot · Build Crew · Onboarding

Your first day.

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.

// 01 — Get it running (5 minutes, no secrets)

The app boots with credential-free stub adapters, so you can run the entire core loop before touching Supabase or Meta.

  1. Install

    corepack enable        # makes pnpm available
    pnpm install
  2. Copy env (optional, all blank works)

    cp .env.example .env.local
  3. Run the tests — this proves the core loop end to end

    pnpm test

    13 tests should pass, including the full message → booking → reply loop with fakes.

  4. Start the dev server

    pnpm dev   # http://localhost:3000

    Home page → dashboard. Health check: GET /api/webhooks/whatsapp.

// 02 — Connect the real services (when you need them)

Fill these into .env.local. Each one flips its module from stub to real — independently.

Set thisUnlocks
DATABASE_URL + DIRECT_URLReal Supabase Postgres (Drizzle adapters)
NEXT_PUBLIC_SUPABASE_*Dashboard auth (doctor login)
GEMINI_API_KEYReal intent detection (V2)
SARVAM_API_KEYReal 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)
Tenant isolation is enforced at the database too. After migrating, always apply 0001_rls.sql so a forgotten WHERE clinic_id can never leak another clinic's data.

// 03 — Who owns what

VectorYour territoryStart in
V1 Bot brainConversation logic, intents, dialog state, no-show rescuesrc/modules/bot-brain
V2 Language & voiceTelugu/Hindi NLU, Sarvam, transliterationsrc/modules/language
V3 Doctor dashboardNext.js web app, calendar, analytics, settingssrc/app/(dashboard)
V4 Integrations & infraPracto, UPI, WhatsApp API, deploy, on-callsrc/modules/integrations, booking adapters
V5 Glue / infraTenant router, DB, config, the seamssrc/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.

// 04 — The everyday commands

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

// 05 — Before you open a PR

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.