# git-me-harish/krishisethu architecture

> Architecture diagram of the GitHub repository git-me-harish/krishisethu, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/git-me-harish/krishisethu
- Repository: https://github.com/git-me-harish/krishisethu

## Overview

KrishiSetu is a farmer-facing agricultural platform: farmers use the web app to access identity services and agricultural capabilities, with results delivered through its API and, for disease and voice tasks, a separate inference service. Major documented branches include plots, diagnostics, soil and weather, satellite monitoring, insurance, commerce, schemes, privacy, audit, and multilingual voice. The API and ML service connect to shared persistence and external providers. Some domain implementations and runtime wiring were not sampled, so uncertain links are omitted or marked dashed.

Main entry points: [`apps/api/krishisetu/main.py`](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/main.py) (API service), [`apps/api/krishisetu/integrations`](https://github.com/git-me-harish/krishisethu/tree/main/apps/api/krishisetu/integrations) (External providers), [`apps/api/krishisetu/domains/identity/routes.py`](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/identity/routes.py) (Identity and e-KYC), [`apps/api/krishisetu/domains/disease/routes.py`](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/disease/routes.py) (Disease diagnosis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Farmer experience"]
  node_web["Web application"]
end

subgraph group_domain["API capabilities"]
  node_identity["Identity and e-KYC<br/>[routes.py]"]
  node_plots["Farmer and plots<br/>[routes.py]"]
  node_disease["Disease diagnosis<br/>[routes.py]"]
  node_soilweather["Soil and weather<br/>[routes.py]"]
  node_ndvi["Satellite NDVI<br/>[routes.py]"]
  node_insurance["Insurance and claims<br/>[routes.py]"]
  node_marketplace["Marketplace<br/>[routes.py]"]
  node_payment["Payments<br/>[routes.py]"]
  node_schemes["Government schemes<br/>[routes.py]"]
  node_voice["Voice assistant<br/>[routes.py]"]
  node_privacy["Privacy and consent<br/>[routes.py]"]
  node_audit["Audit records<br/>[routes.py]"]
end

subgraph group_intelligence["Inference and data"]
  node_ml["ML inference service<br/>[main.py]"]
  node_ml_disease["Disease classifier<br/>[disease.py]"]
  node_ml_voice["Voice processing<br/>[voice.py]"]
end

subgraph group_platform["Shared platform"]
  node_api["API service<br/>[main.py]"]
  node_database[("PostgreSQL database<br/>[database.py]")]
  node_storage[("Object storage<br/>[storage.py]")]
  node_external["External providers"]
end

node_farmer(("Farmer"))

node_farmer -->|"uses"| node_web
node_web -.->|"requests"| node_api
node_api -.->|"routes"| node_identity
node_api -.->|"routes"| node_plots
node_api -.->|"routes"| node_disease
node_api -.->|"routes"| node_soilweather
node_api -.->|"routes"| node_ndvi
node_api -.->|"routes"| node_insurance
node_api -.->|"routes"| node_marketplace
node_api -.->|"routes"| node_payment
node_api -.->|"routes"| node_schemes
node_api -.->|"routes"| node_voice
node_api -.->|"routes"| node_privacy
node_api -.->|"routes"| node_audit
node_ml -->|"registers"| node_ml_disease
node_ml -->|"registers"| node_ml_voice
node_disease -.->|"requests inference"| node_ml_disease
node_voice -.->|"requests processing"| node_ml_voice
node_identity -.->|"persists identity"| node_database
node_plots -.->|"persists plots"| node_database
node_disease -.->|"stores images"| node_storage
node_soilweather -.->|"fetches data"| node_external
node_ndvi -.->|"fetches imagery"| node_external
node_payment -->|"uses gateway"| node_external
node_identity -->|"verifies Aadhaar"| node_external

click node_web "https://github.com/git-me-harish/krishisethu/tree/main/apps/web/src/app"
click node_api "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/main.py"
click node_identity "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/identity/routes.py"
click node_plots "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/farmer/routes.py"
click node_disease "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/disease/routes.py"
click node_soilweather "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/soil_weather/routes.py"
click node_ndvi "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/ndvi/routes.py"
click node_insurance "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/insurance/routes.py"
click node_marketplace "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/marketplace/routes.py"
click node_payment "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/payment/routes.py"
click node_schemes "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/schemes/routes.py"
click node_voice "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/voice/routes.py"
click node_privacy "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/privacy/routes.py"
click node_audit "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/audit/routes.py"
click node_ml "https://github.com/git-me-harish/krishisethu/blob/main/apps/ml-inference/krishisetu_ml/main.py"
click node_ml_disease "https://github.com/git-me-harish/krishisethu/blob/main/apps/ml-inference/krishisetu_ml/api/disease.py"
click node_ml_voice "https://github.com/git-me-harish/krishisethu/blob/main/apps/ml-inference/krishisetu_ml/api/voice.py"
click node_database "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/core/database.py"
click node_storage "https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/core/storage.py"
click node_external "https://github.com/git-me-harish/krishisethu/tree/main/apps/api/krishisetu/integrations"

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_web toneBlue
class node_identity,node_plots,node_disease,node_soilweather,node_ndvi,node_insurance,node_marketplace,node_payment,node_schemes,node_voice,node_privacy,node_audit toneAmber
class node_ml,node_ml_disease,node_ml_voice toneMint
class node_api,node_database,node_storage,node_external toneRose
class node_farmer toneIndigo
```

## Components

### Farmer experience

- [Web application](https://github.com/git-me-harish/krishisethu/tree/main/apps/web/src/app): `apps/web/src/app`

### API capabilities

- [Identity and e-KYC](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/identity/routes.py): `apps/api/krishisetu/domains/identity/routes.py`
- [Farmer and plots](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/farmer/routes.py): `apps/api/krishisetu/domains/farmer/routes.py`
- [Disease diagnosis](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/disease/routes.py): `apps/api/krishisetu/domains/disease/routes.py`
- [Soil and weather](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/soil_weather/routes.py): `apps/api/krishisetu/domains/soil_weather/routes.py`
- [Satellite NDVI](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/ndvi/routes.py): `apps/api/krishisetu/domains/ndvi/routes.py`
- [Insurance and claims](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/insurance/routes.py): `apps/api/krishisetu/domains/insurance/routes.py`
- [Marketplace](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/marketplace/routes.py): `apps/api/krishisetu/domains/marketplace/routes.py`
- [Payments](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/payment/routes.py): `apps/api/krishisetu/domains/payment/routes.py`
- [Government schemes](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/schemes/routes.py): `apps/api/krishisetu/domains/schemes/routes.py`
- [Voice assistant](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/voice/routes.py): `apps/api/krishisetu/domains/voice/routes.py`
- [Privacy and consent](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/privacy/routes.py): `apps/api/krishisetu/domains/privacy/routes.py`
- [Audit records](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/domains/audit/routes.py): `apps/api/krishisetu/domains/audit/routes.py`

### Inference and data

- [ML inference service](https://github.com/git-me-harish/krishisethu/blob/main/apps/ml-inference/krishisetu_ml/main.py): `apps/ml-inference/krishisetu_ml/main.py`
- [Disease classifier](https://github.com/git-me-harish/krishisethu/blob/main/apps/ml-inference/krishisetu_ml/api/disease.py): `apps/ml-inference/krishisetu_ml/api/disease.py`
- [Voice processing](https://github.com/git-me-harish/krishisethu/blob/main/apps/ml-inference/krishisetu_ml/api/voice.py): `apps/ml-inference/krishisetu_ml/api/voice.py`

### Shared platform

- [API service](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/main.py): `apps/api/krishisetu/main.py`
- [PostgreSQL database](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/core/database.py): `apps/api/krishisetu/core/database.py`
- [Object storage](https://github.com/git-me-harish/krishisethu/blob/main/apps/api/krishisetu/core/storage.py): `apps/api/krishisetu/core/storage.py`
- [External providers](https://github.com/git-me-harish/krishisethu/tree/main/apps/api/krishisetu/integrations): `apps/api/krishisetu/integrations`

### Other components

- **Farmer**

## Connections

- Farmer → Web application: uses (evidence: `README.md`)
- Web application → API service: requests
- API service → Identity and e-KYC: routes
- API service → Farmer and plots: routes
- API service → Disease diagnosis: routes
- API service → Soil and weather: routes
- API service → Satellite NDVI: routes
- API service → Insurance and claims: routes
- API service → Marketplace: routes
- API service → Payments: routes
- API service → Government schemes: routes
- API service → Voice assistant: routes
- API service → Privacy and consent: routes
- API service → Audit records: routes
- ML inference service → Disease classifier: registers (evidence: `apps/ml-inference/krishisetu_ml/main.py`)
- ML inference service → Voice processing: registers (evidence: `apps/ml-inference/krishisetu_ml/main.py`)
- Disease diagnosis → Disease classifier: requests inference
- Voice assistant → Voice processing: requests processing
- Identity and e-KYC → PostgreSQL database: persists identity
- Farmer and plots → PostgreSQL database: persists plots
- Disease diagnosis → Object storage: stores images
- Soil and weather → External providers: fetches data
- Satellite NDVI → External providers: fetches imagery
- Payments → External providers: uses gateway (evidence: `apps/api/krishisetu/domains/payment/routes.py`)
- Identity and e-KYC → External providers: verifies Aadhaar (evidence: `apps/api/krishisetu/domains/identity/routes.py`)
