How philip-afk249/clinic_management_fe works
This is a multi-role clinic workflow frontend, built with React and TypeScript. Users enter through patient booking, kiosk check-in, or staff portals; the application also covers reception queues, doctor encounters, pharmacy dispensing, and administration. Routing is visible in src/App.tsx; sampled hooks and service clients show selected auth, intake, and clinical integrations. Most page internals were not sampled, and the README describes only a Vite template, so links between unsampled domain stages are omitted rather than inferred.
Main entry points: App.tsx Role-based routes · intakeApi.ts Intake and queue API · useAmbientConsultation.ts Ambient consultation · clinicalApi.ts Clinical consultation API
Components 29
Application routing
- Role-based routes
src/App.tsx
Identity and access
- Session provider
src/context/AuthProvider.tsx - Auth context hook
src/context/useAuth.ts - Login and registration
src/pages/auth/LoginPage.tsx
Patient services
- Patient booking
src/pages/patient/BookingPage.tsx - Patient dashboard
src/pages/patient/PatientDashboardPage.tsx - Active booking state
src/pages/patient/data/activeBooking.ts - Patient ticket state
src/pages/patient/hooks/usePatientTicket.ts - Kiosk check-in
src/pages/kiosk/KioskPage.tsx - Kiosk session
src/pages/kiosk/hooks/useKioskSession.ts
Clinical care
- Doctor EHR
src/pages/doctor/DoctorEHRPage.tsx - Ambient consultation
src/pages/doctor/hooks/useAmbientConsultation.ts - Ambient encounter mapping
src/pages/doctor/data/ambientMapper.ts - Prescription mapping
src/pages/doctor/data/rxMapper.ts - Drug catalog hook
src/hooks/useDrugCatalog.ts
Clinic operations
- Reception desk
src/pages/reception/ReceptionDeskPage.tsx - Reception intake form
src/pages/reception/hooks/useIntakeForm.ts - Nurse history queue
src/pages/nurse/hooks/useNurseHistoryQueue.ts - Pharmacy queue
src/pages/pharmacy/hooks/usePharmacyQueue.ts - Administration dashboard
src/pages/admin/AdminDashboardPage.tsx - Knowledge base management
src/pages/admin/hooks/useKnowledgeBase.ts
Backend services
- Authentication API
src/services/authApi.ts - Session token storage
src/services/authToken.ts - Intake and queue API
src/services/intakeApi.ts - Voice triage API
src/services/voiceTriageApi.ts - Clinical consultation API
src/services/clinicalApi.ts - AI gateway admin API
src/services/aiGatewayAdminApi.ts - OCR service
src/services/ocrApi.ts
Other components
- Patient or staff
Connections 31
- Patient or staff → Role-based routes: opens portal
src/App.tsx - Role-based routes → Login and registration: routes to
src/App.tsx - Role-based routes → Patient booking: routes to
src/App.tsx - Role-based routes → Patient dashboard: routes to
src/App.tsx - Role-based routes → Kiosk check-in: routes to
src/App.tsx - Role-based routes → Doctor EHR: routes to
src/App.tsx - Role-based routes → Reception desk: routes to
src/App.tsx - Role-based routes → Pharmacy queue: routes to
src/App.tsx - Role-based routes → Administration dashboard: routes to
src/App.tsx - Role-based routes → Auth context hook: guards routes
src/App.tsx - Session provider → Authentication API: authenticates
src/context/AuthProvider.tsx - Session provider → Session token storage: persists session
src/context/AuthProvider.tsx - Auth context hook → Session provider: reads context
src/context/useAuth.ts - Login and registration → Auth context hook: uses session
src/pages/auth/LoginPage.tsx - Kiosk session → Intake and queue API: issues check-in
src/pages/kiosk/hooks/useKioskSession.ts - Active booking state → Intake and queue API: loads booking
src/pages/patient/data/activeBooking.ts - Patient ticket state → Intake and queue API: manages ticket
src/pages/patient/hooks/usePatientTicket.ts - Reception intake form → Intake and queue API: submits intake
src/pages/reception/hooks/useIntakeForm.ts - Reception intake form → OCR service: requests OCR
src/pages/reception/hooks/useIntakeForm.ts - Nurse history queue → Intake and queue API: loads queue
src/pages/nurse/hooks/useNurseHistoryQueue.ts - Ambient consultation → Clinical consultation API: sends consultation
src/pages/doctor/hooks/useAmbientConsultation.ts - Ambient consultation → Drug catalog hook: uses formulary
src/pages/doctor/hooks/useAmbientConsultation.ts - Ambient consultation → Ambient encounter mapping: maps encounter
src/pages/doctor/hooks/useAmbientConsultation.ts - Ambient consultation → Prescription mapping: maps prescription
src/pages/doctor/hooks/useAmbientConsultation.ts - Drug catalog hook → Clinical consultation API: loads drugs
src/hooks/useDrugCatalog.ts - Pharmacy queue → Clinical consultation API: loads prescriptions
src/pages/pharmacy/hooks/usePharmacyQueue.ts - Pharmacy queue → Drug catalog hook: uses formulary
src/pages/pharmacy/hooks/usePharmacyQueue.ts - Knowledge base management → AI gateway admin API: manages knowledge
src/pages/admin/hooks/useKnowledgeBase.ts - Authentication API → Session token storage: attaches bearer token
src/services/authApi.ts - Intake and queue API → Session token storage: attaches bearer token
src/services/intakeApi.ts - Clinical consultation API → Session token storage: attaches bearer token
src/services/clinicalApi.ts