How ace-ify/swadhikaar works
Swadhikaar is a voice-first care operations platform spanning walk-in intake, prescription understanding, hospital access, emergency response, and longitudinal follow-up. The principal flow runs from patient or staff workflows through frontend and Supabase Edge Functions into durable clinical state; voice calls use a dedicated LiveKit worker. README statements establish the broad architecture and product capabilities; source excerpts support the shown intake, dispatch, risk, and recovery relationships. Unsampled subsystems are represented at their exact tree paths, without asserting unverified internal calls.
Main entry points: agent.py Voice agent · page.tsx Patient portal · case-session/index.ts Walk-in case session · incident-complete/index.ts Recovery handoff
Components 25
Care experiences
- Walk-in kiosk
frontend/src/app/kiosk/page.tsx - Patient portal
frontend/src/app/patient/pmjay/page.tsx - Clinical dashboards
frontend/src/app/doctor/dashboard/page.tsx - Operations dashboards
frontend/src/app/admin/dispatch/page.tsx
Access and records
- Prescription OCR
frontend/src/app/api/ocr/route.ts - Medication schedule
frontend/src/components/kiosk/medication-schedule.tsx - PM-JAY guidance
frontend/src/components/pmjay/ask-box.tsx - Walk-in case session
supabase/functions/case-session/index.ts - Clinical summary
supabase/functions/case-summary/summary_builder.ts - ABDM gateway
supabase/functions/abdm-gateway/index.ts - FHIR export bundle
supabase/functions/export-abdm/bundle.ts
Acute response
- Emergency SOS
frontend/src/app/patient/sos/page.tsx - Incident intake
supabase/functions/incident-intake/index.ts - Risk assessment
supabase/functions/risk-predict/index.ts - Ambulance dispatch
frontend/src/app/admin/dispatch/page.tsx
Voice and follow-up
- Recovery handoff
supabase/functions/incident-complete/index.ts - Voice call setup
supabase/functions/start-voice-call/index.ts - Voice agent
backend/voice_agent/agent.py - Care conversation prompts
backend/voice_agent/prompts/system_prompts.py - Weather outreach
supabase/functions/heat-advisory/index.ts
Supabase platform
- Clinical and operational state
Other components
- Patient
- Care staff
- LiveKit telephony
- Empanelled hospitals
Connections 28
- Patient → Walk-in kiosk: starts intake
- Care staff → Clinical dashboards: reviews care
- Care staff → Operations dashboards: operates response
- Patient → Patient portal: seeks guidance
- Walk-in kiosk → Walk-in case session: opens session
supabase/functions/case-session/index.ts - Walk-in case session → LiveKit telephony: creates room
supabase/functions/case-session/index.ts - Patient portal → Prescription OCR: submits prescription
- Prescription OCR → Medication schedule: enables schedule
- Patient portal → PM-JAY guidance: requests guidance
- PM-JAY guidance → Empanelled hospitals: finds hospitals
- Clinical dashboards → Clinical summary: supports review
- ABDM gateway → FHIR export bundle: builds bundle
supabase/functions/abdm-gateway/index.ts - ABDM gateway → Clinical and operational state: reads care context
supabase/functions/abdm-gateway/index.ts - Patient → Emergency SOS: requests help
- Emergency SOS → Incident intake: submits incident
supabase/functions/incident-intake/index.ts - Incident intake → Clinical and operational state: records incident
supabase/functions/incident-intake/index.ts - Operations dashboards → Ambulance dispatch: coordinates response
frontend/src/app/admin/dispatch/page.tsx - Ambulance dispatch → Recovery handoff: completes incident
- Recovery handoff → Clinical and operational state: writes recovery record
supabase/functions/incident-complete/index.ts - Recovery handoff → Voice agent: schedules follow-up
supabase/functions/incident-complete/index.ts - Voice call setup → LiveKit telephony: creates call room
supabase/functions/start-voice-call/index.ts - LiveKit telephony → Voice agent: dispatches agent
- Voice agent → Care conversation prompts: loads prompts
backend/voice_agent/agent.py - Voice agent → Clinical and operational state: updates care state
- Weather outreach → Clinical and operational state: queues outreach calls
supabase/functions/heat-advisory/index.ts - Weather outreach → LiveKit telephony: places calls later
- Walk-in case session → Clinical and operational state: writes session data
supabase/functions/case-session/index.ts - Risk assessment → Emergency SOS: assesses risk