How aswin-ar5055/hospital-management-system works
This is a role-based hospital workflow system: reception registers a patient and assigns a doctor, creating a visit token; doctors review visits, record consultation findings, and prescribe medicines. The React role-specific screens call a Django REST API, whose domain apps serialize and persist users, patients, visits, and prescriptions. The README also documents JWT authentication and WhatsApp notifications; the latter is visible in the visit service. Backend view excerpts are unavailable, so view-to-model links rely on the SOURCE INDEX references.
Main entry points: axios.js Authenticated API client · App.jsx Route application · urls.py Django API routing · PatientRegister.jsx Patient intake
Components 18
React application
- Route application
frontend/src/App.jsx - Role guard
frontend/src/components/ProtectedRoute.jsx - Login and registration
frontend/src/pages/Login.jsx - Reception dashboard
frontend/src/pages/ReceptionDashboard.jsx - Patient intake
frontend/src/pages/PatientRegister.jsx - Doctor dashboard
frontend/src/pages/DoctorDashboard.jsx - Consultation entry
frontend/src/pages/Consultation.jsx - Patient history
frontend/src/pages/PatientHistory.jsx - Authenticated API client
frontend/src/api/axios.js
Django API
- Django API routing
backend/hospital/hospital/urls.py
Hospital records
- User and roles
backend/hospital/users/models.py - Patient records
backend/hospital/patients/models.py - Visit and token
backend/hospital/visits/models.py - Prescriptions
backend/hospital/prescriptions/models.py
External services
- Visit notifications
backend/hospital/visits/whatsapp_service.py - Twilio WhatsApp
Other components
- Reception staff
- Doctor
Connections 28
- Reception staff → Patient intake: registers patient
- Doctor → Doctor dashboard: reviews visits
- Route application → Role guard: protects routes
frontend/src/App.jsx - Role guard → Login and registration: redirects unauthenticated
frontend/src/components/ProtectedRoute.jsx - Route application → Login and registration: routes to
frontend/src/App.jsx - Route application → Patient intake: routes to
frontend/src/App.jsx - Route application → Consultation entry: routes to
frontend/src/App.jsx - Route application → Doctor dashboard: routes to
frontend/src/App.jsx - Route application → Patient history: routes to
frontend/src/App.jsx - Login and registration → Authenticated API client: sends requests
frontend/src/pages/Login.jsx - Patient intake → Authenticated API client: sends requests
frontend/src/pages/PatientRegister.jsx - Doctor dashboard → Authenticated API client: sends requests
frontend/src/pages/DoctorDashboard.jsx - Consultation entry → Authenticated API client: sends requests
frontend/src/pages/Consultation.jsx - Patient history → Authenticated API client: sends requests
frontend/src/pages/PatientHistory.jsx - Authenticated API client → Django API routing: calls API
- Django API routing → User and roles: routes user requests
backend/hospital/hospital/urls.py - Django API routing → Patient records: routes patient requests
backend/hospital/hospital/urls.py - Django API routing → Visit and token: routes visit requests
backend/hospital/hospital/urls.py - Django API routing → Prescriptions: routes prescription requests
backend/hospital/hospital/urls.py - Patient intake → Authenticated API client: loads doctors
frontend/src/pages/PatientRegister.jsx - Patient intake → Authenticated API client: creates patient and visit
frontend/src/pages/PatientRegister.jsx - Consultation entry → Authenticated API client: updates visit
frontend/src/pages/Consultation.jsx - Consultation entry → Authenticated API client: submits prescriptions
frontend/src/pages/Consultation.jsx - Visit notifications → Twilio WhatsApp: sends notifications
backend/hospital/visits/whatsapp_service.py - Visit and token → Patient records: references patient
backend/hospital/visits/models.py - Visit and token → User and roles: references doctor
backend/hospital/visits/models.py - Prescriptions → Visit and token: references visit
backend/hospital/prescriptions/models.py - Django API routing → Visit notifications: notification dispatch