How ssrssudharshanreddy/hospital_app works
The product is a hospital patient and consultation queue system. Reception staff register and find patients, book doctor-specific consultations with emergency priority, and doctors process queues; the frontend communicates with a C++ REST backend, which owns the queue logic and persistence. The graph preserves dashboard, doctor, records, and cancellation capabilities documented by the README. Some page and server implementation details were not excerpted, so those links rely on README documentation or are omitted where the caller is uncertain.
Main entry points: App.jsx Routes and shell · api.js HTTP API client · hospital_dsa.cpp Patient and consultation engine · database_manager.cpp Database manager
Components 19
React application
- Routes and shell
frontend/src/App.jsx - Patient management
frontend/src/pages - Consultation booking
frontend/src/pages/NewConsultation/index.jsx - Queue workstation
frontend/src/pages/ProcessPatient/index.jsx - Records and cancellation
frontend/src/pages - Dashboard telemetry
frontend/src/pages/Dashboard/index.jsx - Doctor directory and queues
frontend/src/pages - Shared UI components
frontend/src/components - HTTP API client
frontend/src/services/api.js
REST service
- HTTP route handler
backend/api/server.cpp - Backend startup
backend/src/main.cpp
Clinical domain
- Patient and consultation engine
backend/dsa/hospital_dsa.cpp - Circular patient queues
backend/dsa/patient_queue.cpp - Patient and visit records
backend/dsa/structures.h - Input validation
backend/include/utils/validation.h
Persistence
- Database manager
backend/database/database_manager.cpp - Mongo configuration
backend/database/db_config.h
Other components
- Clinic staff
- MongoDB
Connections 30
- Clinic staff → Routes and shell: uses
- Routes and shell → Patient management: routes to
frontend/src/App.jsx - Routes and shell → Consultation booking: routes to
frontend/src/App.jsx - Routes and shell → Queue workstation: routes to
frontend/src/App.jsx - Routes and shell → Records and cancellation: routes to
frontend/src/App.jsx - Routes and shell → Dashboard telemetry: routes to
frontend/src/App.jsx - Routes and shell → Doctor directory and queues: routes to
frontend/src/App.jsx - Patient management → HTTP API client: requests data
frontend/src/pages/Dashboard/index.jsx - Consultation booking → HTTP API client: books visits
frontend/src/pages/NewConsultation/index.jsx - Queue workstation → HTTP API client: processes queue
frontend/src/pages/ProcessPatient/index.jsx - Records and cancellation → HTTP API client: requests records
frontend/src/pages/Dashboard/index.jsx - Dashboard telemetry → HTTP API client: requests metrics
frontend/src/pages/Dashboard/index.jsx - Doctor directory and queues → HTTP API client: requests doctors
frontend/src/pages/Dashboard/index.jsx - Patient management → Shared UI components: renders with
frontend/src/pages/RegisterPatient/index.jsx - Consultation booking → Shared UI components: renders with
frontend/src/pages/NewConsultation/index.jsx - Queue workstation → Shared UI components: renders with
frontend/src/pages/ProcessPatient/index.jsx - Records and cancellation → Shared UI components: renders with
frontend/src/pages/CancelConsultation/index.jsx - HTTP API client → HTTP route handler: sends REST JSON
- Backend startup → HTTP route handler: starts
backend/src/main.cpp - HTTP route handler → Patient and consultation engine: delegates domain work
- HTTP route handler → Database manager: uses persistence
- Patient and consultation engine → Circular patient queues: uses queues
- Patient and consultation engine → Patient and visit records: manages records
- Patient and consultation engine → Input validation: validates inputs
backend/dsa/hospital_dsa.cpp - Database manager → Patient and visit records: stores records
- Backend startup → Database manager: initializes
backend/src/main.cpp - Backend startup → Patient and consultation engine: initializes
backend/src/main.cpp - Database manager → MongoDB: reads and writes
- Database manager → Mongo configuration: uses configuration
- Backend startup → Mongo configuration: configures
backend/src/main.cpp