Everything through Phase 1 + Phase 2 (Patients + OPD) is included. Dev mode skips Firebase and logs you in as Super Admin automatically.
brew install node@22 docker # then OPEN Docker Desktop and wait for the whale to go solid
corepack enable # pnpmunzip hms-project.zip && cd hmspnpm services:up
docker ps # note the postgres container NAME (e.g. hms-postgres-1)pnpm install
pnpm --filter @hms/db exec prisma generatecp apps/api/.env.example apps/api/.env
cp apps/web/.env.example apps/web/.env.local
cp packages/db/.env.example packages/db/.env(Using the container so you don't need psql installed. Adjust the container name if step 2 showed a different one.)
docker exec -i hms-postgres-1 psql -U postgres -d hms -c "CREATE ROLE hms_app LOGIN PASSWORD 'app_pw'; GRANT USAGE ON SCHEMA public TO hms_app; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT,INSERT,UPDATE,DELETE ON TABLES TO hms_app;"
pnpm db:setup # migrate -> apply RLS -> seed (incl. the dev admin user)
docker exec -i hms-postgres-1 psql -U postgres -d hms -c "GRANT SELECT,INSERT,UPDATE,DELETE ON ALL TABLES IN SCHEMA public TO hms_app;"Note: the
rlsstep insidedb:setuprunspsqlagainstADMIN_URL. If your Mac's psql errors on a local socket, apply RLS via the container instead:docker exec -i hms-postgres-1 psql -U postgres -d hms < packages/db/sql/rls.sqlthen runpnpm --filter @hms/db seed.
pnpm dev # API :3000 + web :3001The API line should now read (AUTH_MODE=dev) automatically — no inline prefix needed.
http://localhost:3001 → you're auto-logged-in as Super Admin (no manual user insert needed).
- Hospitals (/platform) — provision / suspend / activate tenant hospitals.
- Patients (/patients) — register patients with ABHA/Ayushman IDs + consent. Pick the hospital up top.
- OPD (/opd) — add walk-ins (auto token), book appointments, check in, watch the live queue (5s refresh).
docker exec -i hms-postgres-1 psql -U postgres -d hms -c "SELECT name,status FROM tenant; SELECT mrn,\"fullName\" FROM patient; SELECT \"tokenNumber\",status FROM encounter WHERE type='OPD';"ADMIN_URL="postgresql://postgres:postgres@localhost:5432/postgres" \
APP_URL="postgresql://hms_app:app_pw@localhost:5432/postgres" \
pnpm --filter @hms/db proof # expect: 5 passed, 0 failedSet AUTH_MODE=prod (api/.env) + NEXT_PUBLIC_AUTH_MODE=prod (web/.env.local), add Firebase keys,
and provision users with pnpm --filter api provision. See README-auth.md.
Doctor consultation + prescriptions + role dashboards. Then Phase 3: billing, SMS, deploy.