Multi-Tenant Clinic Management SaaS
A multi-tenant SaaS for running clinics: patients, appointments, doctor schedules, treatments, consent forms, billing and reports for each clinic's staff, plus a platform console for managing subscribed clinics. Built with a React and TypeScript front end and a layered .NET 8 API on PostgreSQL.
- React
- TypeScript
- .NET 8
- C#
- ASP.NET Core
- PostgreSQL
- EF Core
- Dapper
- SignalR
- Hangfire
- React Query
- Tailwind CSS
- shadcn/ui
Private project, demo on request
This is a private SaaS product, so the source code and its business rules are confidential. I'm happy to walk you through it on a call: a live demo, the architecture and selected code.
Architecture
Overview
A multi-tenant SaaS for clinics. Each clinic gets its own workspace where owners, doctors and front-desk staff manage patients, appointments, treatments, clinical documentation and billing. A separate platform console manages the clinics themselves: onboarding, subscriptions, usage and support. Patients can also book online through a public booking page.
The details of the clinical and billing workflows are confidential, so this page covers the architecture and engineering only.
System
React 18 + TypeScript SPA (Vite)
│ React Query · react-hook-form + zod · shadcn/ui
│ Clinic workspace · Platform console · Public booking
▼
ASP.NET Core 8 Minimal API (/api/v1, JWT)
│ Api → Application → Core ← Infrastructure
├──► PostgreSQL (EF Core for identity + migrations, Dapper for queries)
├──► SignalR hub (realtime notifications)
├──► Hangfire on PostgreSQL (scheduled jobs)
└──► SMTP via MailKit (per-clinic email settings)Key design decisions
Tenant isolation from the token. Every clinic-scoped request carries the clinic in a JWT claim, and the data layer filters on it. Middleware rejects requests for suspended tenants before they reach a handler.
Clean, layered back end. The .NET solution is split into Api, Application, Core and Infrastructure projects, with background jobs in their own project. Endpoints are Minimal APIs grouped by module and authenticated by default, so a public endpoint has to opt out explicitly.
EF Core where it helps, Dapper where it's faster. ASP.NET Core Identity and schema migrations use EF Core. Read-heavy queries and reports use Dapper with hand-written SQL.
Realtime and scheduled work. In-app notifications are pushed over a SignalR hub with per-user read tracking. Recurring jobs such as email digests run on Hangfire, backed by the same PostgreSQL database.
Role-based access end to end. Four roles (platform admin, clinic owner, doctor, receptionist) are enforced on the API and also drive navigation in the UI.
Typed front-end data layer. The SPA separates endpoints, repositories and React Query hooks, with forms validated by zod schemas.
Quality and security
- Sensitive stored settings, such as per-clinic SMTP credentials, are encrypted at rest with AES.
- Branded PDF documents are generated in the browser, with a rich-text editor for document templates.
- Front-end tests run on Vitest and Testing Library.
Key Implementation Highlights
Built a layered .NET 8 back end (Api, Application, Core, Infrastructure) on ASP.NET Core Minimal APIs, versioned under /api/v1
ArchitectureScoped every clinic's data through a tenant claim in the JWT, with middleware that blocks suspended tenants
Multi-tenancyImplemented ASP.NET Core Identity with JWT bearer auth and four roles enforced on the API and in the UI
SecurityCombined EF Core for identity and migrations with Dapper for fast, hand-written SQL queries and reports on PostgreSQL
DataPushed in-app notifications over a SignalR hub, with per-user read tracking
RealtimeRan scheduled email digests and notification jobs on Hangfire, backed by PostgreSQL
BackendEncrypted sensitive stored settings, such as per-clinic SMTP credentials, with AES
SecurityGenerated branded PDFs in the browser and built a rich-text template editor
DocumentsBuilt the React and TypeScript SPA with React Query, react-hook-form and zod, on shadcn/ui and Tailwind CSS
Frontend
Interested in the technical details?
Let's Talk