How dinesh-2007/swasthai works
SwasthAI is a mobile-first health screening and care-coordination product for citizens and health workers, backed by an API and an administrative web console. The main citizen workflow gathers symptoms, vitals, or an image, runs on-device screening and clinical reasoning, then presents a result and guidance. Other visible capabilities include local health Q&A, patient management, reports, referrals, and data sync. Source evidence is partial; unverified connections are omitted or shown as dashed.
Main entry points: repository App repositories · AIEngineManager.kt Screening orchestrator · ClinicalReasoningEngine.kt Clinical reasoning · SwasthAIApiService.kt Mobile API client
Components 26
Mobile app
- App navigation
SwasthAI/app/src/main/java/com/swasthai/app/navigation/HealthWorkerNavGraph.kt - Screening experience
SwasthAI/app/src/main/java/com/swasthai/app/feature/citizen/screening/ScreeningViewModel.kt - Screening results
SwasthAI/app/src/main/java/com/swasthai/app/feature/citizen/diagnosis/ScreeningResultScreen.kt - Health chat
SwasthAI/app/src/main/java/com/swasthai/app/feature/citizen/aichat/AiChatEngine.kt - Worker patient care
SwasthAI/app/src/main/java/com/swasthai/app/feature/healthworker/patients/PatientViewModel.kt - Follow-up and referral
SwasthAI/app/src/main/java/com/swasthai/app/feature/healthworker/screening/ScheduleAndReferScreens.kt - Worker reports
SwasthAI/app/src/main/java/com/swasthai/app/feature/healthworker/reports/HWReportsScreen.kt - Offline data sync
SwasthAI/app/src/main/java/com/swasthai/app/sync/SyncWorker.kt
Clinical intelligence
- Screening orchestrator
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/AIEngineManager.kt - Image classifier
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/ImageClassifier.kt - Scan model registry
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/ScanType.kt - Clinical reasoning
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/ClinicalReasoningEngine.kt - Clinical knowledge
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/ClinicalKnowledge.kt - Disease advice base
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/DiseaseKnowledgeBase.kt - Local RAG retrieval
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/LocalRagRetriever.kt - RAG documents
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/RagDocument.kt
Data services
- App repositories
SwasthAI/app/src/main/java/com/swasthai/app/data/repository - Local health database
SwasthAI/app/src/main/java/com/swasthai/app/data/local/database/SwasthAIDatabase.kt - User preferences
SwasthAI/app/src/main/java/com/swasthai/app/data/local/datastore/UserPreferences.kt - Mobile API client
SwasthAI/app/src/main/java/com/swasthai/app/data/remote/api/SwasthAIApiService.kt
Backend API
- Backend endpoints
backend/main.py - Backend database
backend/database.py
Admin console
- Admin dashboard
web/src/app/(admin)/overview/page.tsx - Admin API routes
web/src/app/api/patients/route.ts
Other components
- Citizen or worker
- Remote service
Connections 24
- Citizen or worker → App navigation: opens app
- App navigation → Screening experience: routes to
SwasthAI/app/src/main/java/com/swasthai/app/navigation/HealthWorkerNavGraph.kt - Screening experience → Screening orchestrator: requests screening
- Screening orchestrator → Image classifier: classifies image
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/AIEngineManager.kt - Screening orchestrator → Clinical reasoning: reasons symptoms
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/AIEngineManager.kt - Screening orchestrator → Screening results: returns diagnosis
- Image classifier → Scan model registry: uses scan types
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/ImageClassifier.kt - Clinical reasoning → Clinical knowledge: uses clinical rules
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/ClinicalReasoningEngine.kt - Clinical reasoning → Disease advice base: uses disease data
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/ClinicalReasoningEngine.kt - Clinical reasoning → Local RAG retrieval: retrieves context
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/ClinicalReasoningEngine.kt - Health chat → Local RAG retrieval: retrieves answers
SwasthAI/app/src/main/java/com/swasthai/app/feature/citizen/aichat/AiChatEngine.kt - Local RAG retrieval → RAG documents: reads documents
SwasthAI/app/src/main/java/com/swasthai/app/ai/engine/LocalRagRetriever.kt - Worker patient care → App repositories: uses patient data
- Follow-up and referral → App navigation: routes follow-up
SwasthAI/app/src/main/java/com/swasthai/app/navigation/HealthWorkerNavGraph.kt - Worker reports → App repositories: loads reports
- Offline data sync → App repositories: syncs records
- App repositories → Local health database: reads and writes
- App repositories → Mobile API client: uploads data
- Mobile API client → Remote service: sends requests
- Mobile API client → User preferences: gets session token
SwasthAI/app/src/main/java/com/swasthai/app/data/remote/api/SwasthAIApiService.kt - Backend endpoints → Backend database: uses database session
backend/main.py - Remote service → Backend endpoints: serves API requests
- Admin dashboard → Admin API routes: loads admin data
- Admin API routes → Backend endpoints: requests records