How shivam-kumar-emf-portrait/health-emergency-app works
Health Assist is a hospital-capacity and emergency-coordination system, with hospital staff tools and a user-facing health chat. The principal emergency workflow is exposed through the Express API: emergency requests are handled by the emergency controller and matcher, while hospitals manage cases and operational resources through protected endpoints. The README also documents availability, blood-bank, equipment, and doctor-availability capabilities. Source excerpts do not show the browser-to-API wiring or all controller implementations, so those links are omitted where they cannot be supported.
Main entry points: app.js Express application · staffController.js Shifts and attendance · emergencyController.js Emergency case handling · hospitalController.js Hospital operations and cases
Components 27
API and access
- Express application
backend/src/app.js - Authentication routes
backend/src/routes/authRoutes.js - Account registration and login
backend/src/controllers/authController.js - Token authorization
backend/src/middleware/authMiddleware.js - User records
backend/src/models/User.js
Emergency coordination
- Emergency routes
backend/src/routes/emergencyRoutes.js - Emergency case handling
backend/src/controllers/emergencyController.js - Hospital matching
backend/src/services/emergencyMatcher.js - Distance calculation
backend/src/utils/distance.js - Emergency case records
backend/src/models/EmergencyCase.js
Hospital operations
- Hospital records and resources
backend/src/models/Hospital.js - Hospital routes
backend/src/routes/hospitalRoutes.js - Hospital operations and cases
backend/src/controllers/hospitalController.js
Staff management
- Doctor records
backend/src/models/Doctor.js - Doctor management
backend/src/controllers/doctorController.js - Staff routes
backend/src/routes/staffRoutes.js - Shifts and attendance
backend/src/controllers/staffController.js - Shift records
backend/src/models/Shift.js - Attendance records
backend/src/models/Attendance.js - Nurse management
backend/src/controllers/nurseController.js - Nurse records
backend/src/models/Nurse.js
Health chat
- Normal-mode routes
backend/src/routes/normalModeRoutes.js - Health chat handling
backend/src/controllers/normalModeController.js - Chat sessions
backend/src/models/ChatSession.js - OpenRouter chat service
backend/src/services/openRouterService.js
Other components
- Patient or visitor
- Hospital administrator
Connections 31
- Express application → Authentication routes: mounts routes
backend/src/app.js - Express application → Emergency routes: mounts routes
backend/src/app.js - Express application → Hospital routes: mounts routes
backend/src/app.js - Express application → Staff routes: mounts routes
backend/src/app.js - Express application → Normal-mode routes: mounts routes
backend/src/app.js - Authentication routes → Account registration and login: dispatches to
backend/src/routes/authRoutes.js - Account registration and login → User records: reads and creates
backend/src/controllers/authController.js - Account registration and login → Hospital records and resources: reads and creates
backend/src/controllers/authController.js - Emergency routes → Emergency case handling: dispatches to
backend/src/routes/emergencyRoutes.js - Emergency routes → Token authorization: protects routes
backend/src/routes/emergencyRoutes.js - Emergency case handling → Hospital matching: requests matching
backend/src/controllers/emergencyController.js - Emergency case handling → Hospital records and resources: reads hospitals
backend/src/controllers/emergencyController.js - Emergency case handling → Emergency case records: reads and writes cases
backend/src/controllers/emergencyController.js - Hospital matching → Distance calculation: uses distance
backend/src/services/emergencyMatcher.js - Hospital routes → Hospital operations and cases: dispatches to
backend/src/routes/hospitalRoutes.js - Hospital routes → Token authorization: protects routes
backend/src/routes/hospitalRoutes.js - Hospital operations and cases → Hospital records and resources: reads and updates
backend/src/controllers/hospitalController.js - Hospital operations and cases → Emergency case records: reads and updates
backend/src/controllers/hospitalController.js - Hospital operations and cases → Doctor records: assigns and queries
backend/src/controllers/hospitalController.js - Staff routes → Shifts and attendance: dispatches to
backend/src/routes/staffRoutes.js - Staff routes → Token authorization: protects routes
backend/src/routes/staffRoutes.js - Shifts and attendance → Shift records: creates and reads
backend/src/controllers/staffController.js - Shifts and attendance → Attendance records: records and reads
backend/src/controllers/staffController.js - Shifts and attendance → Doctor records: references staff
backend/src/controllers/staffController.js - Shifts and attendance → Nurse records: references staff
backend/src/controllers/staffController.js - Normal-mode routes → Health chat handling: dispatches to
backend/src/routes/normalModeRoutes.js - Normal-mode routes → Token authorization: protects routes
backend/src/routes/normalModeRoutes.js - Health chat handling → OpenRouter chat service: requests chat response
backend/src/controllers/normalModeController.js - Health chat handling → Chat sessions: reads and writes
backend/src/controllers/normalModeController.js - Doctor management → Doctor records: manages doctors
backend/src/controllers/doctorController.js - Nurse management → Nurse records: manages nurses
backend/src/controllers/nurseController.js