How kkshiteej-tiwari/hospital-management-system-mern works
Meridian HMS is a role-based hospital management system: patients book appointments and access visit records and invoices; doctors manage schedules and clinical records; administrators manage staff, departments, appointments and billing. The frontend routes role-specific pages through a shared API client to an Express API, with MongoDB-backed domain data. README capabilities guide the unsampled branches; detailed service-to-model wiring is shown only where sampled source supports it.
Main entry points: controllers Resource controllers · AppRouter.jsx Role-based routes · api Resource API modules · App.jsx React application
Components 23
Web client
- React application
frontend/src/App.jsx - Role-based routes
frontend/src/routes/AppRouter.jsx - Patient portal
frontend/src/pages/patient - Doctor portal
frontend/src/pages/doctor - Admin portal
frontend/src/pages/admin - Sign-in and registration
frontend/src/pages/auth - Authentication state
frontend/src/context/AuthContext.jsx - Resource API modules
frontend/src/api - HTTP and token refresh
frontend/src/api/axiosClient.js
API boundary
- Express API
backend/src/app.js - Resource routes
backend/src/routes - Resource controllers
backend/src/controllers - Authentication and access guards
backend/src/middleware
Hospital workflows
- Authentication service
backend/src/services/auth.service.js - Appointment scheduling
backend/src/services/appointment.service.js - Clinical records
backend/src/services/medicalRecord.service.js - Billing and invoices
backend/src/services/billing.service.js - Ownership enforcement
backend/src/services/rbac.service.js
Identity and data
- Domain models
backend/src/models - MongoDB
backend/src/config/db.js
Other components
- Patient
- Doctor
- Administrator
Connections 26
- Patient → React application: uses
- Doctor → React application: uses
- Administrator → React application: uses
- React application → Role-based routes: renders
- Role-based routes → Sign-in and registration: routes
- Role-based routes → Patient portal: routes
- Role-based routes → Doctor portal: routes
- Role-based routes → Admin portal: routes
- Sign-in and registration → Authentication state: uses
- Patient portal → Resource API modules: requests
- Doctor portal → Resource API modules: requests
- Admin portal → Resource API modules: requests
- Sign-in and registration → Resource API modules: requests
- Resource API modules → HTTP and token refresh: uses
- HTTP and token refresh → Express API: HTTP requests
- Express API → Resource routes: dispatches
- Resource routes → Authentication and access guards: guards routes
- Resource routes → Resource controllers: dispatches
- Resource controllers → Authentication service: calls
- Resource controllers → Appointment scheduling: calls
- Resource controllers → Clinical records: calls
- Resource controllers → Billing and invoices: calls
- Resource controllers → Ownership enforcement: checks access
- Authentication service → Domain models: reads and writes
- Resource controllers → Domain models: reads and writes
- Domain models → MongoDB: persists data