How sujan-kulal26/smartcare-hms works
SmartCare HMS is a web-based hospital management system for patient and doctor records, appointments, billing, and reports. The principal workflow is staff using the web interface to manage records and appointments, then create bills and view revenue reports through the Express API. The backend separates route handlers, JWT/role middleware, and Mongoose models, with MongoDB as persistence. The excerpts show backend routing and model calls; frontend-to-API wiring is not shown, so those links are marked unverified.
Main entry points: server.js HTTP server · billingRoutes.js Billing and reports · patientRoutes.js Patient operations · doctorRoutes.js Doctor operations
Components 20
Web interface
- App interface
frontend/js/app.js - Patient screens
frontend/js/patients.js - Doctor screens
frontend/js/doctors.js - Appointment screens
frontend/js/appointments.js - Billing screens
frontend/js/billing.js
API routes
- HTTP server
backend/server.js - Login and signup
backend/routes/authRoutes.js - Patient operations
backend/routes/patientRoutes.js - Doctor operations
backend/routes/doctorRoutes.js - Appointment operations
backend/routes/appointmentRoutes.js - Billing and reports
backend/routes/billingRoutes.js
Access control
- JWT validation
backend/middleware/auth.js - Role authorization
backend/middleware/role.js
Domain records
- User records
backend/models/User.js - Patient records
backend/models/Patient.js - Doctor records
backend/models/Doctor.js - Appointment records
backend/models/Appointment.js - Billing records
backend/models/Billing.js
Other components
- Hospital staff
- MongoDB
Connections 22
- Hospital staff → App interface: uses
- Patient screens → Patient operations: requests
- Doctor screens → Doctor operations: requests
- Appointment screens → Appointment operations: requests
- Billing screens → Billing and reports: requests
- HTTP server → Login and signup: mounts
backend/server.js - HTTP server → Patient operations: mounts
backend/server.js - HTTP server → Doctor operations: mounts
backend/server.js - HTTP server → Appointment operations: mounts
backend/server.js - HTTP server → Billing and reports: mounts
backend/server.js - HTTP server → MongoDB: connects
backend/server.js - Login and signup → User records: queries
backend/routes/authRoutes.js - Patient operations → Patient records: queries
backend/routes/patientRoutes.js - Doctor operations → Doctor records: queries
backend/routes/doctorRoutes.js - Appointment operations → Appointment records: queries
backend/routes/appointmentRoutes.js - Billing and reports → Billing records: queries
backend/routes/billingRoutes.js - Billing and reports → Appointment records: loads appointment
backend/routes/billingRoutes.js - Patient operations → JWT validation: checks token
backend/routes/patientRoutes.js - Doctor operations → JWT validation: checks token
backend/routes/doctorRoutes.js - Appointment operations → JWT validation: checks token
backend/routes/appointmentRoutes.js - Billing and reports → JWT validation: checks token
backend/routes/billingRoutes.js - Billing and reports → Role authorization: guards reports
backend/routes/billingRoutes.js