How syedmurtaza15/subhan-care-hms-supabase works
Subhan Care is a role-aware hospital management frontend backed by Supabase, with local demo-data fallback. Users enter through public authentication or protected dashboard routes; role-aware pages support patient and appointment workflows alongside prescriptions, inventory, billing, staff administration, and reporting. Shared contexts and services manage identity and domain data, with persistence delegated to Supabase or browser storage. The route map and data/auth service excerpts support the main wiring shown; unsampled page implementations and database policies limit finer-grained call-flow detail.
Main entry points: DashboardLayout.jsx Dashboard shell · AppRoutes.jsx Route dispatcher · authService.js Auth service · dataService.js Data service
Components 21
Access and navigation
- Route dispatcher
src/routes/AppRoutes.jsx - Authentication pages
src/pages/auth - Authentication state
src/context/AuthContext.jsx - Auth service
src/services/authService.js - Dashboard shell
src/layouts/DashboardLayout.jsx
Clinical operations
- Patient records and history
src/pages/dashboard/patients - Appointment scheduling
src/pages/dashboard/appointments - Doctor directory
src/pages/dashboard/doctors - Prescriptions
src/pages/dashboard/prescriptions - Patient appointments
src/pages/dashboard/MyAppointmentsPage.jsx
Hospital administration
- Medication inventory
src/pages/dashboard/inventory - Billing and invoices
src/pages/dashboard/billing - Staff management
src/pages/dashboard/staff/StaffPage.jsx - Reports and analytics
src/pages/dashboard/reports/ReportsPage.jsx - Dashboard analytics
src/pages/dashboard/DashboardPage.jsx
Shared runtime and data
- Application shell
src/App.jsx - Domain data context
src/context/DataContext.jsx - Data service
src/services/dataService.js - Supabase backend
- Browser local storage
Other components
- Hospital user
Connections 22
- Hospital user → Route dispatcher: opens pages
- Application shell → Route dispatcher: renders routes
- Route dispatcher → Authentication pages: dispatches public routes
- Authentication pages → Authentication state: uses auth state
- Authentication state → Auth service: calls auth operations
- Auth service → Supabase backend: authenticates and reads profiles
- Auth service → Browser local storage: stores fallback data
- Route dispatcher → Dashboard shell: guards dashboard
- Dashboard shell → Patient records and history: hosts patient routes
- Dashboard shell → Appointment scheduling: hosts appointment routes
- Dashboard shell → Doctor directory: hosts doctor routes
- Dashboard shell → Prescriptions: hosts prescription routes
- Dashboard shell → Patient appointments: hosts patient route
- Dashboard shell → Medication inventory: hosts inventory route
- Dashboard shell → Billing and invoices: hosts billing routes
- Dashboard shell → Staff management: hosts staff route
- Dashboard shell → Reports and analytics: hosts reports route
- Dashboard shell → Dashboard analytics: hosts dashboard route
- Application shell → Domain data context: provides domain data
- Domain data context → Data service: loads and mutates data
- Data service → Supabase backend: reads and writes entities
- Data service → Browser local storage: persists demo entities