# jeetpramanick07/scheme_sathi architecture

> Architecture diagram of the GitHub repository jeetpramanick07/scheme_sathi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jeetpramanick07/scheme_sathi
- Repository: https://github.com/jeetpramanick07/scheme_sathi

## Overview

SchemaSaathi is a benefits-discovery and application-support platform, with a web client and a Fastify backend. The citizen workflow starts with a household questionnaire, evaluates scheme eligibility, then supports saving claims, planning documents, and tracking applications. The backend also manages household profiles and scheme data, with an admin dataset-ingestion path and documented voice, SMS, prefill, help, and partner capabilities. Edges follow shown imports/calls or the source index; several unsampled subsystems are included from the tree but their internal wiring is not asserted.

Main entry points: [`HACK_KUMBH/schemesaathi-backend/src/server.ts`](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/server.ts) (HTTP server), [`HACK_KUMBH/schemesaathi-backend/src/db/schema.ts`](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/db/schema.ts) (Relational database), [`HACK_KUMBH/schemesaathi-backend/src/modules/households/routes.ts`](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/households/routes.ts) (Household routes), [`HACK_KUMBH/schemesaathi-backend/src/ingest/pipeline.ts`](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/ingest/pipeline.ts) (Dataset ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Citizen web"]
  node_webapp["Application routes<br/>[App.tsx]"]
  node_questionnaire["Questionnaire"]
  node_householdctx["Household state"]
  node_profileview["Profile dashboard"]
  node_api_client["API client<br/>[client.ts]"]
end

subgraph group_api["Backend API"]
  node_server["HTTP server<br/>[server.ts]"]
  node_eligibility_routes["Eligibility routes<br/>[routes.ts]"]
  node_household_routes["Household routes<br/>[routes.ts]"]
  node_auth_routes["Authentication<br/>[routes.ts]"]
  node_catalogue["Scheme catalogue<br/>[routes.ts]"]
  node_applications["Applications<br/>[routes.ts]"]
end

subgraph group_domain["Benefits domain"]
  node_engine["Eligibility engine<br/>[service.ts]"]
  node_answer_service["Answer handling<br/>[answers-service.ts]"]
  node_normalizer["Attribute normalization<br/>[normalizer.ts]"]
  node_profile_sections["Profile sections"]
end

subgraph group_data["Data operations"]
  node_database[("Relational database<br/>[schema.ts]")]
  node_ingestion["Dataset ingestion<br/>[pipeline.ts]"]
  node_admin["Admin operations<br/>[routes.ts]"]
end

subgraph group_support["Access and support"]
  node_voice["Voice accessibility<br/>[routes.ts]"]
  node_sms["SMS messaging<br/>[routes.ts]"]
  node_prefill["Identity prefill<br/>[routes.ts]"]
  node_reminders["Reminders<br/>[service.ts]"]
  node_help["Help centres"]
end

node_citizen(("Citizen"))

node_citizen -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_questionnaire
node_webapp -->|"routes to"| node_profileview
node_questionnaire -->|"reads state"| node_householdctx
node_questionnaire -->|"requests data"| node_api_client
node_householdctx -->|"requests updates"| node_api_client
node_api_client -.->|"sends HTTP requests"| node_server
node_server -->|"registers routes"| node_eligibility_routes
node_server -->|"registers routes"| node_household_routes
node_server -->|"registers routes"| node_auth_routes
node_server -->|"registers routes"| node_catalogue
node_server -->|"registers routes"| node_applications
node_server -->|"registers routes"| node_admin
node_server -->|"registers routes"| node_voice
node_server -->|"registers routes"| node_sms
node_server -->|"registers routes"| node_prefill
node_eligibility_routes -->|"evaluates eligibility"| node_engine
node_eligibility_routes -->|"reads household data"| node_database
node_household_routes -->|"stores answers"| node_answer_service
node_household_routes -->|"loads profile"| node_profile_sections
node_household_routes -.->|"reads and writes"| node_database
node_auth_routes -->|"reads and writes"| node_database
node_catalogue -->|"queries schemes"| node_database
node_applications -.->|"manages applications"| node_database
node_admin -->|"starts import"| node_ingestion
node_admin -->|"queries records"| node_database
node_ingestion -->|"writes schemes"| node_database
node_ingestion -->|"normalizes attributes"| node_normalizer
node_ingestion -->|"validates sections"| node_profile_sections
node_voice -.->|"uses scheme content"| node_database
node_sms -->|"records messages"| node_database
node_reminders -.->|"supports reminder flow"| node_household_routes

click node_webapp "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-web/src/App.tsx"
click node_questionnaire "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-web/src/components/citizen/QuestionnaireView.tsx"
click node_householdctx "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-web/src/context/HouseholdContext.tsx"
click node_profileview "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-web/src/components/citizen/ProfileDashboardView.tsx"
click node_api_client "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-web/src/api/client.ts"
click node_server "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/server.ts"
click node_eligibility_routes "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/eligibility/routes.ts"
click node_household_routes "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/households/routes.ts"
click node_auth_routes "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/auth/routes.ts"
click node_catalogue "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/catalogue/routes.ts"
click node_applications "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/applications/routes.ts"
click node_engine "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/eligibility/service.ts"
click node_answer_service "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/households/answers-service.ts"
click node_normalizer "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/engine/normalizer.ts"
click node_profile_sections "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/services/profile-sections.ts"
click node_database "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/db/schema.ts"
click node_ingestion "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/ingest/pipeline.ts"
click node_admin "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/admin/routes.ts"
click node_voice "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/voice/routes.ts"
click node_sms "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/sms/routes.ts"
click node_prefill "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/prefill/routes.ts"
click node_reminders "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/reminders/service.ts"
click node_help "https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-web/src/components/help/HelpCentresView.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_questionnaire,node_householdctx,node_profileview,node_api_client toneBlue
class node_server,node_eligibility_routes,node_household_routes,node_auth_routes,node_catalogue,node_applications toneAmber
class node_engine,node_answer_service,node_normalizer,node_profile_sections toneMint
class node_database,node_ingestion,node_admin toneRose
class node_voice,node_sms,node_prefill,node_reminders,node_help,node_citizen toneIndigo
```

## Components

### Citizen web

- [Application routes](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-web/src/App.tsx): `HACK_KUMBH/schemesaathi-web/src/App.tsx`
- [Questionnaire](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-web/src/components/citizen/QuestionnaireView.tsx): `HACK_KUMBH/schemesaathi-web/src/components/citizen/QuestionnaireView.tsx`
- [Household state](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-web/src/context/HouseholdContext.tsx): `HACK_KUMBH/schemesaathi-web/src/context/HouseholdContext.tsx`
- [Profile dashboard](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-web/src/components/citizen/ProfileDashboardView.tsx): `HACK_KUMBH/schemesaathi-web/src/components/citizen/ProfileDashboardView.tsx`
- [API client](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-web/src/api/client.ts): `HACK_KUMBH/schemesaathi-web/src/api/client.ts`

### Backend API

- [HTTP server](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/server.ts): `HACK_KUMBH/schemesaathi-backend/src/server.ts`
- [Eligibility routes](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/eligibility/routes.ts): `HACK_KUMBH/schemesaathi-backend/src/modules/eligibility/routes.ts`
- [Household routes](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/households/routes.ts): `HACK_KUMBH/schemesaathi-backend/src/modules/households/routes.ts`
- [Authentication](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/auth/routes.ts): `HACK_KUMBH/schemesaathi-backend/src/modules/auth/routes.ts`
- [Scheme catalogue](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/catalogue/routes.ts): `HACK_KUMBH/schemesaathi-backend/src/modules/catalogue/routes.ts`
- [Applications](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/applications/routes.ts): `HACK_KUMBH/schemesaathi-backend/src/modules/applications/routes.ts`

### Benefits domain

- [Eligibility engine](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/eligibility/service.ts): `HACK_KUMBH/schemesaathi-backend/src/modules/eligibility/service.ts`
- [Answer handling](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/households/answers-service.ts): `HACK_KUMBH/schemesaathi-backend/src/modules/households/answers-service.ts`
- [Attribute normalization](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/engine/normalizer.ts): `HACK_KUMBH/schemesaathi-backend/src/engine/normalizer.ts`
- [Profile sections](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/services/profile-sections.ts): `HACK_KUMBH/schemesaathi-backend/src/services/profile-sections.ts`

### Data operations

- [Relational database](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/db/schema.ts): `HACK_KUMBH/schemesaathi-backend/src/db/schema.ts`
- [Dataset ingestion](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/ingest/pipeline.ts): `HACK_KUMBH/schemesaathi-backend/src/ingest/pipeline.ts`
- [Admin operations](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/admin/routes.ts): `HACK_KUMBH/schemesaathi-backend/src/modules/admin/routes.ts`

### Access and support

- [Voice accessibility](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/voice/routes.ts): `HACK_KUMBH/schemesaathi-backend/src/modules/voice/routes.ts`
- [SMS messaging](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/sms/routes.ts): `HACK_KUMBH/schemesaathi-backend/src/modules/sms/routes.ts`
- [Identity prefill](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/prefill/routes.ts): `HACK_KUMBH/schemesaathi-backend/src/modules/prefill/routes.ts`
- [Reminders](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-backend/src/modules/reminders/service.ts): `HACK_KUMBH/schemesaathi-backend/src/modules/reminders/service.ts`
- [Help centres](https://github.com/jeetpramanick07/scheme_sathi/blob/main/HACK_KUMBH/schemesaathi-web/src/components/help/HelpCentresView.tsx): `HACK_KUMBH/schemesaathi-web/src/components/help/HelpCentresView.tsx`

### Other components

- **Citizen**

## Connections

- Citizen → Application routes: uses (evidence: `HACK_KUMBH/schemesaathi-web/src/App.tsx`)
- Application routes → Questionnaire: routes to (evidence: `HACK_KUMBH/schemesaathi-web/src/App.tsx`)
- Application routes → Profile dashboard: routes to (evidence: `HACK_KUMBH/schemesaathi-web/src/App.tsx`)
- Questionnaire → Household state: reads state (evidence: `HACK_KUMBH/schemesaathi-web/src/components/citizen/QuestionnaireView.tsx`)
- Questionnaire → API client: requests data (evidence: `HACK_KUMBH/schemesaathi-web/src/components/citizen/QuestionnaireView.tsx`)
- Household state → API client: requests updates (evidence: `HACK_KUMBH/schemesaathi-web/src/context/HouseholdContext.tsx`)
- API client → HTTP server: sends HTTP requests
- HTTP server → Eligibility routes: registers routes (evidence: `HACK_KUMBH/schemesaathi-backend/src/server.ts`)
- HTTP server → Household routes: registers routes (evidence: `HACK_KUMBH/schemesaathi-backend/src/server.ts`)
- HTTP server → Authentication: registers routes (evidence: `HACK_KUMBH/schemesaathi-backend/src/server.ts`)
- HTTP server → Scheme catalogue: registers routes (evidence: `HACK_KUMBH/schemesaathi-backend/src/server.ts`)
- HTTP server → Applications: registers routes (evidence: `HACK_KUMBH/schemesaathi-backend/src/server.ts`)
- HTTP server → Admin operations: registers routes (evidence: `HACK_KUMBH/schemesaathi-backend/src/server.ts`)
- HTTP server → Voice accessibility: registers routes (evidence: `HACK_KUMBH/schemesaathi-backend/src/server.ts`)
- HTTP server → SMS messaging: registers routes (evidence: `HACK_KUMBH/schemesaathi-backend/src/server.ts`)
- HTTP server → Identity prefill: registers routes (evidence: `HACK_KUMBH/schemesaathi-backend/src/server.ts`)
- Eligibility routes → Eligibility engine: evaluates eligibility (evidence: `HACK_KUMBH/schemesaathi-backend/src/modules/eligibility/routes.ts`)
- Eligibility routes → Relational database: reads household data (evidence: `HACK_KUMBH/schemesaathi-backend/src/modules/eligibility/routes.ts`)
- Household routes → Answer handling: stores answers (evidence: `HACK_KUMBH/schemesaathi-backend/src/modules/households/routes.ts`)
- Household routes → Profile sections: loads profile (evidence: `HACK_KUMBH/schemesaathi-backend/src/modules/households/routes.ts`)
- Household routes → Relational database: reads and writes (evidence: `HACK_KUMBH/schemesaathi-backend/src/modules/households/routes.ts`)
- Authentication → Relational database: reads and writes (evidence: `HACK_KUMBH/schemesaathi-backend/src/modules/auth/routes.ts`)
- Scheme catalogue → Relational database: queries schemes (evidence: `HACK_KUMBH/schemesaathi-backend/src/modules/catalogue/routes.ts`)
- Applications → Relational database: manages applications
- Admin operations → Dataset ingestion: starts import (evidence: `HACK_KUMBH/schemesaathi-backend/src/modules/admin/routes.ts`)
- Admin operations → Relational database: queries records (evidence: `HACK_KUMBH/schemesaathi-backend/src/modules/admin/routes.ts`)
- Dataset ingestion → Relational database: writes schemes (evidence: `HACK_KUMBH/schemesaathi-backend/src/ingest/pipeline.ts`)
- Dataset ingestion → Attribute normalization: normalizes attributes (evidence: `HACK_KUMBH/schemesaathi-backend/src/ingest/pipeline.ts`)
- Dataset ingestion → Profile sections: validates sections (evidence: `HACK_KUMBH/schemesaathi-backend/src/ingest/pipeline.ts`)
- Voice accessibility → Relational database: uses scheme content
- SMS messaging → Relational database: records messages (evidence: `HACK_KUMBH/schemesaathi-backend/src/modules/sms/routes.ts`)
- Reminders → Household routes: supports reminder flow (evidence: `HACK_KUMBH/schemesaathi-backend/src/modules/households/routes.ts`)
