How karthikdavuluri/asha works
ASHA is an offline-first companion for frontline health workers, backed by an optional FastAPI server. The main documented workflow is recording household visits offline and synchronizing them with the server; related server capabilities cover referrals, facility reports, and protocol-based health questions with deterministic safety escalation. The graph preserves major backend domains and central indexed modules. Several routes and services were not sampled, so their connections are omitted or marked unverified rather than inferred.
Main entry points: router.py API routes · synchronization/service.py Synchronization · visits/service.py Visits and follow-up · referrals/service.py Referrals
Components 24
Worker app
- Offline companion
health-worker-app
API and access
- FastAPI server
health-worker-backend/app/main.py - API routes
health-worker-backend/app/api/v1/router.py
Care records
- Households
health-worker-backend/app/services/households/service.py - Visits and follow-up
health-worker-backend/app/services/visits/service.py - Referrals
health-worker-backend/app/services/referrals/service.py
Health guidance
- Health Q&A
health-worker-backend/app/services/health_qa/orchestrator.py - Protocol retrieval
health-worker-backend/app/services/protocol_retrieval/service.py - Safety escalation
health-worker-backend/app/services/safety/engine.py - Protocol import
health-worker-backend/app/services/protocol_import/importer.py
Sync and reporting
- Synchronization
health-worker-backend/app/services/synchronization/service.py - Facility reports
health-worker-backend/app/services/reports/service.py - Dataset import
health-worker-backend/app/services/dataset_import/importer.py - Dataset manifest
health-worker-backend/app/services/dataset_import/manifest.py
Shared foundations
- Application database
health-worker-backend/app/db/base.py - Database sessions
health-worker-backend/app/db/session.py - Configuration
health-worker-backend/app/core/config.py - Worker identity
health-worker-backend/app/core/principal.py - Domain types
health-worker-backend/app/domain.py - Domain schemas
health-worker-backend/app/schemas/domain.py - Audit records
health-worker-backend/app/repositories/audit.py - Service helpers
health-worker-backend/app/services/_common.py - Text normalization
health-worker-backend/app/services/text.py
Other components
- ASHA / ANM worker
Connections 30
- ASHA / ANM worker → Offline companion: uses
- Offline companion → FastAPI server: optionally syncs
- FastAPI server → API routes: mounts
health-worker-backend/app/main.py - API routes → Synchronization: routes to
- API routes → Health Q&A: routes to
- API routes → Households: routes to
- API routes → Visits and follow-up: routes to
- API routes → Referrals: routes to
- API routes → Facility reports: routes to
- Health Q&A → Protocol retrieval: queries
health-worker-backend/app/services/health_qa/orchestrator.py - Health Q&A → Safety escalation: checks safety
health-worker-backend/app/services/health_qa/orchestrator.py - Protocol retrieval → Text normalization: normalizes text
health-worker-backend/app/services/protocol_retrieval/service.py - Safety escalation → Text normalization: normalizes text
health-worker-backend/app/services/safety/engine.py - Synchronization → Households: creates records
health-worker-backend/app/services/synchronization/service.py - Synchronization → Visits and follow-up: creates records
health-worker-backend/app/services/synchronization/service.py - Synchronization → Referrals: creates records
health-worker-backend/app/services/synchronization/service.py - Visits and follow-up → Households: loads household
health-worker-backend/app/services/visits/service.py - Visits and follow-up → Audit records: records changes
health-worker-backend/app/services/visits/service.py - Referrals → Audit records: records changes
health-worker-backend/app/services/referrals/service.py - Facility reports → Application database: reads and saves
health-worker-backend/app/services/reports/service.py - Dataset import → Dataset manifest: loads datasets
health-worker-backend/app/services/dataset_import/importer.py - Dataset import → Application database: imports records
health-worker-backend/app/services/dataset_import/importer.py - Protocol retrieval → Application database: loads passages
health-worker-backend/app/services/protocol_retrieval/service.py - Database sessions → Configuration: reads settings
health-worker-backend/app/db/session.py - FastAPI server → Configuration: loads settings
health-worker-backend/app/main.py - Visits and follow-up → Service helpers: uses helpers
health-worker-backend/app/services/visits/service.py - Referrals → Service helpers: uses helpers
health-worker-backend/app/services/referrals/service.py - Synchronization → Domain schemas: validates payloads
health-worker-backend/app/services/synchronization/service.py - Referrals → Worker identity: checks access
health-worker-backend/app/services/referrals/service.py - Protocol import → Application database: imports protocols