How muhiltamil206-commits/hospital-management-system works
Purpose and Entry Points
This repository implements a hospital food-management and operations system: a React client for role-specific hospital workflows and a Django backend exposing APIs for hospital entities and food delivery. Frontend bootstraps at hospital-food-management-frontend/src/index.js into hospital-food-management-frontend/src/App.js. Django starts through hospital_Management/hospital_backend/manage.py, with HTTP/ASGI/WSGI configuration under hospital_Management/hospital_backend/hospital_backend/.
Frontend Application Shell and Access Control
The client is a single-page React application. hospital-food-management-frontend/src/App.js composes routing/application views, while hospital-food-management-frontend/src/components/Layout.js supplies shared page structure. Authentication state is centralized in hospital-food-management-frontend/src/context/AuthContext.js; protected role-sensitive navigation is enforced by hospital-food-management-frontend/src/components/PrivateRoute.js. API calls cross the frontend/backend boundary through hospital-food-management-frontend/src/api/axios.js.
Role-Oriented Operational Workspaces
The UI separates hospital operational roles into focused screens: manager oversight in hospital-food-management-frontend/src/components/ManagerDashboard.js, pantry workflow in hospital-food-management-frontend/src/components/PantryDashboard.js, and meal delivery workflow in hospital-food-management-frontend/src/components/DeliveryDashboard.js. These views consume backend resources rather than owning persistent state, enabling role-specific handling of diets, preparation, and delivery.
Clinical Scheduling, Capacity, and Queues
Appointment, bed, and queue domains are modeled independently but collectively support patient flow. Backend persistence resides in hospital_Management/hospital_backend/api/models/appointment.py, hospital_Management/hospital_backend/api/models/bed.py, and hospital_Management/hospital_backend/api/models/live_queue.py. Request handlers and endpoint registration are split by domain, for example hospital_Management/hospital_backend/api/views/appointment_views.py and hospital_Management/hospital_backend/api/urls/appointment_urls.py. Corresponding client views include hospital-food-management-frontend/src/components/AppointmentBooking.js, hospital-food-management-frontend/src/components/BedTracking.js, and hospital-food-management-frontend/src/components/LiveQueue.js.
Food, Delivery, and AI Diet Guidance
Diet charts and delivery records form the core food-management pipeline: durable entities in hospital_Management/hospital_backend/api/models/dietchart.py and hospital_Management/hospital_backend/api/models/delivery.py are serialized and exposed via their dedicated view/URL layers. AI diet assistance is a separate API boundary at hospital_Management/hospital_backend/api/views/ai_diet_view.py and hospital_Management/hospital_backend/api/urls/ai_diet_urls.py, consumed by hospital-food-management-frontend/src/components/AIDietAssistant.js. The external AI provider is not identifiable from the supplied tree.
Communication, Reports, and Notifications
Supporting care coordination includes chat messages, medical reports, and notifications, persisted in hospital_Management/hospital_backend/api/models/chat.py, hospital_Management/hospital_backend/api/models/medical_report.py, and hospital_Management/hospital_backend/api/models/notification.py. Their API handlers mediate client access; key UI consumers are hospital-food-management-frontend/src/components/DoctorChat.js, hospital-food-management-frontend/src/components/MedicalReports.js, and hospital-food-management-frontend/src/components/NotificationPanel.js.
Backend Boundaries and Infrastructure
Django REST-style layering follows URL modules → views → serializers → models: e.g., hospital_Management/hospital_backend/api/urls/delivery_urls.py, hospital_Management/hospital_backend/api/views/delivery_views.py, and hospital_Management/hospital_backend/api/serializers/delivery_serializer.py. Authorization is role-based through hospital_Management/hospital_backend/api/permissions/role_permissions.py. The checked-in hospital_Management/hospital_backend/db.sqlite3 indicates SQLite as the current persistence runtime; schema evolution is managed by Django migrations under hospital_Management/hospital_backend/api/migrations/.
Main entry points: App.js Application shell · axios.js API client · delivery_serializer.py Resource serializers · appointment_urls.py Domain URL routes
Components 20
React Client
- React bootstrap
hospital-food-management-frontend/src/index.js - Application shell
hospital-food-management-frontend/src/App.js - Auth and route guard · Central authentication state and protected role-sensitive navigation.
hospital-food-management-frontend/src/context/AuthContext.js - Shared layout
hospital-food-management-frontend/src/components/Layout.js - Role workspaces · Manager, pantry, and delivery operational screens.
hospital-food-management-frontend/src/components/ManagerDashboard.js - Clinical flow UI · Appointment booking, bed tracking, and live queue views.
hospital-food-management-frontend/src/components/AppointmentBooking.js - Food and AI UI · Diet assistance and delivery workflow screens.
hospital-food-management-frontend/src/components/AIDietAssistant.js - Care coordination UI · Chat, medical report, and notification consumers.
hospital-food-management-frontend/src/components/DoctorChat.js - API client
hospital-food-management-frontend/src/api/axios.js
Django API
- Django entry
hospital_Management/hospital_backend/manage.py - Domain URL routes · Registers appointment, delivery, and AI diet endpoints.
hospital_Management/hospital_backend/api/urls/appointment_urls.py - API handlers · Domain request handlers for operational resources.
hospital_Management/hospital_backend/api/views/appointment_views.py - Role permissions
hospital_Management/hospital_backend/api/permissions/role_permissions.py - Resource serializers · Maps API payloads to persisted delivery and domain entities.
hospital_Management/hospital_backend/api/serializers/delivery_serializer.py - Clinical flow models · Appointments, beds, and live queue records.
hospital_Management/hospital_backend/api/models/appointment.py - Diet and delivery models · Diet charts and delivery records drive the food pipeline.
hospital_Management/hospital_backend/api/models/dietchart.py - Coordination models · Chat messages, medical reports, and notifications.
hospital_Management/hospital_backend/api/models/chat.py - AI diet endpoint · Separate diet-assistance endpoint; provider is unspecified.
hospital_Management/hospital_backend/api/views/ai_diet_view.py
Persistence
- SQLite database
hospital_Management/hospital_backend/db.sqlite3 - Schema migrations
Connections 24
- React bootstrap → Application shell: mounts
- Application shell → Shared layout: composes
- Application shell → Auth and route guard: uses
- Auth and route guard → Role workspaces: authorizes
- Application shell → Clinical flow UI: routes to
- Application shell → Food and AI UI: routes to
- Application shell → Care coordination UI: routes to
- Role workspaces → API client: requests
- Clinical flow UI → API client: requests
- Food and AI UI → API client: requests
- Care coordination UI → API client: requests
- API client → Domain URL routes: HTTP API
- Django entry → Domain URL routes: serves
- Domain URL routes → API handlers: dispatches
- Domain URL routes → AI diet endpoint: AI diet route
- API handlers → Role permissions: enforces
- API handlers → Resource serializers: serializes
- Resource serializers → Clinical flow models: maps
- Resource serializers → Diet and delivery models: maps
- Resource serializers → Coordination models: maps
- Clinical flow models → SQLite database: persists
- Diet and delivery models → SQLite database: persists
- Coordination models → SQLite database: persists
- Schema migrations → SQLite database: evolves schema