Build Guide / 01
What EBsoft HMS is, and how it's put together
EBsoft HMS is a hospital management platform covering OPD, IPD, diagnostics, pharmacy, HR and accounts for a single institution. Everything — the patient-facing portal, the billing engine, and the admin console — lives in one repository and one deploy.
Why it's built this way
Three constraints shape almost every decision in this codebase:
- One department, many workflows. A hospital isn't one app — it's OPD reception, IPD nursing, a pharmacy counter, a diagnostics lab and an accounts office, each with its own screens but the same patient record underneath. The route tree (231 routes) mirrors that directly instead of trying to unify it.
- Money has to reconcile. Billing, discounts, refunds and dues touch almost every module, so invoicing logic is centralized in shared hooks and libs rather than re-implemented per department.
- No dedicated ops team. Firestore + Firebase Auth + Netlify Functions was chosen so the app has no server to patch, no database to back up manually, and a deploy is a git push.
The shape of the codebase
At a glance, the repository is a standard Vite + React SPA with one twist: an
Express server (server.ts / server-app.ts) sits in
front of it for local development and for anything that needs privileged
Firebase Admin access — scheduled jobs, server-side PDF/report generation,
and the Gemini-powered AI assistant. In production that same Express app is
wrapped as a single Netlify Function.
This guide documents the codebase as shipped: a hospital system called
EBsoft Bangladesh, project id ebsoft-hms-25f69,
originally scaffolded through Google AI Studio and since built out into a
full HMS.
Read this guide in order
Each section builds on the last: stack → architecture → modules → database → folder layout → local setup → build & deploy. Use the sidebar to jump around, or use Next at the bottom of each page.