The problem multi-tenant healthcare SaaS has to solve A clinic management product looks simple from the outside: appointments, patients, prescriptions, billing. The hard part isn't features — it's the tenancy model . Real clinics broke my early assumptions fast: One doctor often owns multiple clinics (a downtown branch + a hospital affiliation). A receptionist can work at clinic A in the morning and clinic B in the evening . A patient may have visits at multiple clinics of the same doctor — same medical history. Each clinic has its own subscription lifecycle — active, trial, expired, suspended. Walk-ins outnumber scheduled appointments in this market, so the queue is the product , not the calendar. A naive "one tenant = one customer" model breaks on day one. This post walks through the architecture I shipped for TabeebHub : a NestJS + Prisma + Postgres stack with a shared database, row-level tenant scoping, role-based access, and clinic-scoped subscriptions.…