# hemanthswamy26/kisanvue-ai architecture

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

- Interactive diagram: https://gitdiagram.com/hemanthswamy26/kisanvue-ai
- Repository: https://github.com/hemanthswamy26/kisanvue-ai

## Overview

KisanVue AI is a farmer-facing crop intelligence and advisory platform. Farmers submit crop images for diagnosis, review localized IPM guidance with weather context, and can submit a follow-up scan to assess recovery. Separate capabilities provide farm-wide weather, satellite and soil intelligence, crop recommendations, regional telemetry, and voice agronomist interaction. The frontend communicates with a FastAPI backend; weather, satellite, and soil services use live providers with documented or implemented fallback modes. Some backend endpoint calls and UI details were not shown, so uncertain links are omitted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/App.jsx) (Web application), [`backend/app/main.py`](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/main.py) (FastAPI endpoints), [`backend/app/farm_intelligence_service.py`](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/farm_intelligence_service.py) (Farm intelligence), [`frontend/src/components/AnalysisResult.jsx`](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/components/AnalysisResult.jsx) (Diagnosis report)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_farmer_ui["Farmer experience"]
  node_app["Web application<br/>[App.jsx]"]
  node_scanner["Crop scanner<br/>[CropScanner.jsx]"]
  node_diagnosis_view["Diagnosis report<br/>[AnalysisResult.jsx]"]
  node_voice["Voice agronomist"]
  node_audio["Speech playback<br/>[AudioPlayer.jsx]"]
  node_translations["Language translations<br/>[translations.js]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_diagnosis["Diagnosis and follow-up"]
  node_gemini["Pathology reasoning<br/>[gemini_service.py]"]
  node_verification["Recovery evaluation<br/>[verify_engine.py]"]
end

subgraph group_farm_intel["Farm intelligence"]
  node_weather["Weather intelligence<br/>[weather_service.py]"]
  node_satellite["Satellite intelligence"]
  node_soil["Soil intelligence<br/>[soil_service.py]"]
  node_recommendations["Crop recommendations"]
  node_farm_orchestrator["Farm intelligence"]
  node_dashboard["Regional telemetry"]
end

subgraph group_backend_core["Backend services"]
  node_backend_api["FastAPI endpoints<br/>[main.py]"]
  node_schemas["Response schemas<br/>[schemas.py]"]
end

node_farmer(("Farmer"))
node_open_meteo["Open-Meteo"]
node_sentinel["Sentinel Hub"]
node_soilgrids["SoilGrids"]
node_gemini_service["Google Gemini"]

node_farmer -->|"uses"| node_app
node_app -->|"renders"| node_scanner
node_app -->|"renders"| node_diagnosis_view
node_app -->|"renders"| node_voice
node_app -->|"calls"| node_api_client
node_app -->|"uses"| node_translations
node_diagnosis_view -->|"renders"| node_audio
node_diagnosis_view -->|"renders"| node_satellite
node_diagnosis_view -->|"renders"| node_soil
node_voice -->|"renders"| node_audio
node_api_client -->|"HTTP requests"| node_backend_api
node_backend_api -->|"validates responses"| node_schemas
node_backend_api -->|"routes farm query"| node_farm_orchestrator
node_farm_orchestrator -->|"fetches"| node_weather
node_farm_orchestrator -->|"fetches"| node_satellite
node_farm_orchestrator -->|"fetches"| node_soil
node_farm_orchestrator -->|"generates"| node_recommendations
node_backend_api -->|"uses diagnosis"| node_gemini
node_backend_api -.->|"evaluates recovery"| node_verification
node_weather -->|"queries"| node_open_meteo
node_satellite -->|"queries"| node_sentinel
node_soil -->|"queries"| node_soilgrids
node_recommendations -.->|"reasons with"| node_gemini_service
node_backend_api -.->|"serves telemetry"| node_dashboard

click node_app "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/App.jsx"
click node_scanner "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/components/CropScanner.jsx"
click node_diagnosis_view "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/components/AnalysisResult.jsx"
click node_voice "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/components/VoiceAgronomist.jsx"
click node_audio "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/components/AudioPlayer.jsx"
click node_translations "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/i18n/translations.js"
click node_api_client "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/services/api.js"
click node_backend_api "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/main.py"
click node_schemas "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/schemas.py"
click node_gemini "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/services/gemini_service.py"
click node_verification "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/services/verify_engine.py"
click node_weather "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/services/weather_service.py"
click node_satellite "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/satellite_service.py"
click node_soil "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/soil_service.py"
click node_recommendations "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/crop_recommendation_service.py"
click node_farm_orchestrator "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/farm_intelligence_service.py"
click node_dashboard "https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/services/dashboard_service.py"

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_app,node_scanner,node_diagnosis_view,node_voice,node_audio,node_translations,node_api_client toneBlue
class node_gemini,node_verification toneAmber
class node_weather,node_satellite,node_soil,node_recommendations,node_farm_orchestrator,node_dashboard toneMint
class node_backend_api,node_schemas toneRose
class node_farmer,node_open_meteo,node_sentinel,node_soilgrids,node_gemini_service toneIndigo
```

## Components

### Farmer experience

- [Web application](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Crop scanner](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/components/CropScanner.jsx): `frontend/src/components/CropScanner.jsx`
- [Diagnosis report](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/components/AnalysisResult.jsx): `frontend/src/components/AnalysisResult.jsx`
- [Voice agronomist](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/components/VoiceAgronomist.jsx): `frontend/src/components/VoiceAgronomist.jsx`
- [Speech playback](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/components/AudioPlayer.jsx): `frontend/src/components/AudioPlayer.jsx`
- [Language translations](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/i18n/translations.js): `frontend/src/i18n/translations.js`
- [API client](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Diagnosis and follow-up

- [Pathology reasoning](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/services/gemini_service.py): `backend/app/services/gemini_service.py`
- [Recovery evaluation](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/services/verify_engine.py): `backend/app/services/verify_engine.py`

### Farm intelligence

- [Weather intelligence](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/services/weather_service.py): `backend/app/services/weather_service.py`
- [Satellite intelligence](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/satellite_service.py): `backend/app/satellite_service.py`
- [Soil intelligence](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/soil_service.py): `backend/app/soil_service.py`
- [Crop recommendations](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/crop_recommendation_service.py): `backend/app/crop_recommendation_service.py`
- [Farm intelligence](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/farm_intelligence_service.py): `backend/app/farm_intelligence_service.py`
- [Regional telemetry](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/services/dashboard_service.py): `backend/app/services/dashboard_service.py`

### Backend services

- [FastAPI endpoints](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/main.py): `backend/app/main.py`
- [Response schemas](https://github.com/hemanthswamy26/kisanvue-ai/blob/main/backend/app/schemas.py): `backend/app/schemas.py`

### Other components

- **Farmer**
- **Open-Meteo**
- **Sentinel Hub**
- **SoilGrids**
- **Google Gemini**

## Connections

- Farmer → Web application: uses (evidence: `README.md`)
- Web application → Crop scanner: renders (evidence: `frontend/src/App.jsx`)
- Web application → Diagnosis report: renders (evidence: `frontend/src/App.jsx`)
- Web application → Voice agronomist: renders (evidence: `frontend/src/App.jsx`)
- Web application → API client: calls (evidence: `frontend/src/App.jsx`)
- Web application → Language translations: uses (evidence: `frontend/src/App.jsx`)
- Diagnosis report → Speech playback: renders (evidence: `frontend/src/components/AnalysisResult.jsx`)
- Diagnosis report → Satellite intelligence: renders (evidence: `frontend/src/components/AnalysisResult.jsx`)
- Diagnosis report → Soil intelligence: renders (evidence: `frontend/src/components/AnalysisResult.jsx`)
- Voice agronomist → Speech playback: renders (evidence: `frontend/src/components/VoiceAgronomist.jsx`)
- API client → FastAPI endpoints: HTTP requests (evidence: `README.md`)
- FastAPI endpoints → Response schemas: validates responses (evidence: `backend/app/main.py`)
- FastAPI endpoints → Farm intelligence: routes farm query (evidence: `backend/app/main.py`)
- Farm intelligence → Weather intelligence: fetches (evidence: `backend/app/farm_intelligence_service.py`)
- Farm intelligence → Satellite intelligence: fetches (evidence: `backend/app/farm_intelligence_service.py`)
- Farm intelligence → Soil intelligence: fetches (evidence: `backend/app/farm_intelligence_service.py`)
- Farm intelligence → Crop recommendations: generates (evidence: `backend/app/farm_intelligence_service.py`)
- FastAPI endpoints → Pathology reasoning: uses diagnosis (evidence: `backend/app/main.py`)
- FastAPI endpoints → Recovery evaluation: evaluates recovery
- Weather intelligence → Open-Meteo: queries (evidence: `backend/app/services/weather_service.py`)
- Satellite intelligence → Sentinel Hub: queries (evidence: `backend/app/satellite_service.py`)
- Soil intelligence → SoilGrids: queries (evidence: `backend/app/soil_service.py`)
- Crop recommendations → Google Gemini: reasons with
- FastAPI endpoints → Regional telemetry: serves telemetry (evidence: `backend/app/main.py`)
