How elitedebuggers/swasth works
Swasth+ is a patient-and-clinician healthcare portal. Users enter through the routed React app, then manage appointments, records, medications, and clinical workflows; patients can also consult the AI assistant. The README documents Supabase-backed data, offline caching and queued writes, document-upload fallback, and local AI triage. The graph combines those documented capabilities with source-index references and excerpts; unsampled feature internals and some runtime wiring are represented only where the README supports them.
Main entry points: App.tsx Route dispatcher · PatientDashboard.tsx Patient dashboard · MedicalRecords.tsx Medical records · resilience.ts Resilience engine
Components 33
App entry and shell
- Route dispatcher
src/App.tsx - Sign-in
src/modules/shared/Login.tsx - Shared portal shell
src/components/SharedLayout.tsx - Chat layout state
src/components/LayoutContext.tsx
Patient care
- Public home
src/modules/patient/Home.tsx - Patient dashboard
src/modules/patient/PatientDashboard.tsx - AI assistant
src/modules/patient/components/PatientAIAssistant.tsx - Health timeline
src/modules/patient/components/HealthTimeline.tsx - Medical records
src/modules/patient/MedicalRecords.tsx - Record approvals
src/modules/patient/components/PendingApprovalsModal.tsx - Document viewer
src/modules/shared/DocumentView.tsx - Document deletion
src/modules/shared/DeleteDocumentModal.tsx - Medication tracking
src/modules/patient/Medications.tsx - Doctor discovery
src/modules/patient/Doctors.tsx - Appointment booking
src/modules/patient/components/AppointmentBookingModal.tsx - Patient appointments
src/modules/patient/Appointments.tsx - Patient messages
src/modules/patient/Messages.tsx - Patient settings
src/modules/patient/Settings.tsx
Clinician workflows
- Shift scheduler
src/modules/doctor/Schedule.tsx - Appointment approvals
src/modules/doctor/Appointments.tsx - Patient records workspace
src/modules/doctor/Patients.tsx - Doctor dashboard
src/modules/doctor/DoctorDashboard.tsx - Doctor settings
src/modules/doctor/Settings.tsx
Data and resilience
- Medication helpers
src/lib/medications.ts - Supabase client
src/lib/supabase.ts - Supabase services
- Resilience engine
src/lib/resilience.ts - Local document store
src/lib/documents.ts - Offline sync queue
src/lib/resilience.ts - Resilience console
src/modules/shared/ResilienceHUD.tsx - Local triage rules
src/lib/resilience.ts
Other components
- Patient or doctor
- Groq / Grok AI
Connections 44
- Patient or doctor → Route dispatcher: opens portal
src/App.tsx - Route dispatcher → Public home: routes to
src/App.tsx - Route dispatcher → Sign-in: routes to
src/App.tsx - Route dispatcher → Patient dashboard: routes to
src/App.tsx - Route dispatcher → Medical records: routes to
src/App.tsx - Route dispatcher → Medication tracking: routes to
src/App.tsx - Route dispatcher → Doctor discovery: routes to
src/App.tsx - Route dispatcher → Patient appointments: routes to
src/App.tsx - Route dispatcher → Patient messages: routes to
src/App.tsx - Route dispatcher → Patient settings: routes to
src/App.tsx - Route dispatcher → Shift scheduler: routes to
src/App.tsx - Route dispatcher → Appointment approvals: routes to
src/App.tsx - Route dispatcher → Patient records workspace: routes to
src/App.tsx - Route dispatcher → Doctor settings: routes to
src/App.tsx - Route dispatcher → Document viewer: routes to
src/App.tsx - Patient dashboard → AI assistant: renders
src/modules/patient/PatientDashboard.tsx - Patient dashboard → Health timeline: renders
src/modules/patient/PatientDashboard.tsx - Patient dashboard → Shared portal shell: uses shell
src/modules/patient/PatientDashboard.tsx - Medical records → Record approvals: uses modal
src/modules/patient/MedicalRecords.tsx - Medical records → Document deletion: uses modal
src/modules/patient/MedicalRecords.tsx - Medical records → Medication helpers: uses helpers
src/modules/patient/MedicalRecords.tsx - Medical records → Local document store: saves documents
src/modules/patient/MedicalRecords.tsx - Patient dashboard → Local document store: saves documents
src/modules/patient/PatientDashboard.tsx - Document viewer → Local document store: reads fallback
README.md - Medication tracking → Medication helpers: uses helpers
src/modules/patient/Medications.tsx - Doctor discovery → Appointment booking: starts booking
README.md - Patient appointments → Appointment booking: uses modal
src/modules/patient/Appointments.tsx - Appointment approvals → Shift scheduler: uses clinician slots
README.md - Patient records workspace → Document deletion: uses modal
src/modules/doctor/Patients.tsx - Patient records workspace → Medication helpers: uses helpers
src/modules/doctor/Patients.tsx - Patient records workspace → Shared portal shell: uses shell
src/modules/doctor/Patients.tsx - Doctor dashboard → Document deletion: uses modal
src/modules/doctor/DoctorDashboard.tsx - Doctor dashboard → Medication helpers: uses helpers
src/modules/doctor/DoctorDashboard.tsx - Supabase client → Resilience engine: configures fetch
src/lib/supabase.ts - Supabase client → Supabase services: connects
README.md - Resilience engine → Supabase services: fetches or syncs
README.md - Resilience engine → Offline sync queue: queues writes
README.md - Resilience engine → Local document store: caches reads
README.md - AI assistant → Groq / Grok AI: requests AI
README.md - AI assistant → Local triage rules: falls back to
src/modules/patient/components/PatientAIAssistant.tsx - Local triage rules → AI assistant: returns advice
src/modules/patient/components/PatientAIAssistant.tsx - Shared portal shell → Resilience console: renders console
src/components/SharedLayout.tsx - Resilience console → Resilience engine: monitors controls
src/components/SharedLayout.tsx - Shared portal shell → Chat layout state: reads context
src/components/SharedLayout.tsx