# saiganesh-kota/agrovision_aws architecture

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

- Interactive diagram: https://gitdiagram.com/saiganesh-kota/agrovision_aws
- Repository: https://github.com/saiganesh-kota/agrovision_aws

## Overview

AgroVision AI is a farmer-facing crop-health and farm-intelligence platform. Farmers use the React application to submit crop scans; the Flask service runs diagnosis and returns results that support treatment guidance and follow-on farm tools. Separate product branches cover geospatial disease risk, schemes, crop calendars, yield estimates, alerts, and an AI assistant. The sampled pipeline excerpt establishes its diagnosis and recommendation stages, but does not expose the complete backend orchestration; several backend links are therefore omitted. The README documents the AWS deployment and broad service boundary.

Main entry points: [`backend/app.py`](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/app.py) (Flask API), [`frontend/src/App.jsx`](https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/App.jsx) (React application), [`frontend/src/api/api.js`](https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/api/api.js) (REST client), [`backend/pipeline.py`](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/pipeline.py) (Inference pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Farmer application"]
  node_webapp["React application<br/>[App.jsx]"]
  node_scan["Crop scanning<br/>[ScanPage.jsx]"]
  node_analysis["Diagnosis results<br/>[AnalysisPage.jsx]"]
  node_dashboard["Farm dashboard<br/>[DashboardPage.jsx]"]
  node_geo_view["Geo map<br/>[GeoMapPage.jsx]"]
  node_recommend_view["Recommendations"]
  node_schemes_view["Scheme discovery<br/>[SchemesPage.jsx]"]
  node_calendar_view["Crop calendar"]
  node_yield_view["Yield estimator"]
  node_assistant_view["RaithuMitra assistant<br/>[ChatBot.jsx]"]
  node_api_client["REST client<br/>[api.js]"]
end

subgraph group_diagnosis["Crop diagnosis"]
  node_flask["Flask API<br/>[app.py]"]
  node_pipeline["Inference pipeline<br/>[pipeline.py]"]
  node_treatments["Disease treatments"]
  node_action_sim["Action simulation"]
end

subgraph group_intelligence["Farm intelligence"]
  node_geo_engine["Spatial intelligence"]
  node_geo_forecast["Spread forecasting"]
  node_weather["Weather insights"]
  node_soil["Soil insights<br/>[soil_api.py]"]
end

subgraph group_guidance["Advice and discovery"]
  node_schemes["Government schemes<br/>[schemes_data.py]"]
  node_suppliers["Local suppliers<br/>[supplier_engine.py]"]
  node_pest_alerts["Pest alerts<br/>[pest_alerts.py]"]
end

subgraph group_learning["Feedback and improvement"]
  node_feedback["Feedback collection"]
  node_retraining["Model retraining<br/>[retrain_service.py]"]
  node_database[("Application data<br/>[db.py]")]
  node_storage["Storage adapter<br/>[storage.py]"]
end

node_farmer(("Farmer"))

node_farmer -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_scan
node_webapp -->|"routes to"| node_analysis
node_webapp -->|"routes to"| node_dashboard
node_webapp -->|"routes to"| node_geo_view
node_webapp -->|"routes to"| node_schemes_view
node_webapp -->|"routes to"| node_calendar_view
node_scan -.->|"requests"| node_api_client
node_analysis -.->|"requests"| node_api_client
node_dashboard -.->|"requests"| node_api_client
node_geo_view -.->|"requests"| node_api_client
node_recommend_view -.->|"requests"| node_api_client
node_schemes_view -.->|"requests"| node_api_client
node_assistant_view -->|"sends chat"| node_api_client
node_api_client -->|"REST requests"| node_flask
node_flask -.->|"runs diagnosis"| node_pipeline
node_pipeline -->|"uses disease data"| node_treatments
node_pipeline -->|"simulates actions"| node_action_sim
node_flask -.->|"serves geo intelligence"| node_geo_engine
node_geo_forecast -->|"uses spatial data"| node_geo_engine
node_flask -.->|"serves weather insights"| node_weather
node_flask -.->|"serves soil insights"| node_soil
node_flask -.->|"serves scheme data"| node_schemes
node_flask -.->|"serves suppliers"| node_suppliers
node_flask -.->|"serves alerts"| node_pest_alerts
node_flask -.->|"collects feedback"| node_feedback
node_feedback -.->|"supports adaptation"| node_retraining
node_database -->|"uses adapter"| node_storage

click node_webapp "https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/App.jsx"
click node_scan "https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/ScanPage.jsx"
click node_analysis "https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/AnalysisPage.jsx"
click node_dashboard "https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/DashboardPage.jsx"
click node_geo_view "https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/GeoMapPage.jsx"
click node_recommend_view "https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/RecommendationPage.jsx"
click node_schemes_view "https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/SchemesPage.jsx"
click node_calendar_view "https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/CropCalendarPage.jsx"
click node_yield_view "https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/YieldEstimatorPage.jsx"
click node_assistant_view "https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/components/ChatBot.jsx"
click node_api_client "https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/api/api.js"
click node_flask "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/app.py"
click node_pipeline "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/pipeline.py"
click node_treatments "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/disease_treatments.py"
click node_action_sim "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/action_simulator.py"
click node_geo_engine "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/geo_spatial_engine.py"
click node_geo_forecast "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/geo_forecast_engine.py"
click node_weather "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/weather_disease_engine.py"
click node_soil "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/soil_api.py"
click node_schemes "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/schemes_data.py"
click node_suppliers "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/supplier_engine.py"
click node_pest_alerts "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/pest_alerts.py"
click node_feedback "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/feedback_collector.py"
click node_retraining "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/retrain_service.py"
click node_database "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/db.py"
click node_storage "https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/storage.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_webapp,node_scan,node_analysis,node_dashboard,node_geo_view,node_recommend_view,node_schemes_view,node_calendar_view,node_yield_view,node_assistant_view,node_api_client toneBlue
class node_flask,node_pipeline,node_treatments,node_action_sim toneAmber
class node_geo_engine,node_geo_forecast,node_weather,node_soil toneMint
class node_schemes,node_suppliers,node_pest_alerts toneRose
class node_feedback,node_retraining,node_database,node_storage,node_farmer toneIndigo
```

## Components

### Farmer application

- [React application](https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Crop scanning](https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/ScanPage.jsx): `frontend/src/pages/ScanPage.jsx`
- [Diagnosis results](https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/AnalysisPage.jsx): `frontend/src/pages/AnalysisPage.jsx`
- [Farm dashboard](https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/DashboardPage.jsx): `frontend/src/pages/DashboardPage.jsx`
- [Geo map](https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/GeoMapPage.jsx): `frontend/src/pages/GeoMapPage.jsx`
- [Recommendations](https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/RecommendationPage.jsx): `frontend/src/pages/RecommendationPage.jsx`
- [Scheme discovery](https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/SchemesPage.jsx): `frontend/src/pages/SchemesPage.jsx`
- [Crop calendar](https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/CropCalendarPage.jsx): `frontend/src/pages/CropCalendarPage.jsx`
- [Yield estimator](https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/pages/YieldEstimatorPage.jsx): `frontend/src/pages/YieldEstimatorPage.jsx`
- [RaithuMitra assistant](https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/components/ChatBot.jsx): `frontend/src/components/ChatBot.jsx`
- [REST client](https://github.com/saiganesh-kota/agrovision_aws/blob/main/frontend/src/api/api.js): `frontend/src/api/api.js`

### Crop diagnosis

- [Flask API](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/app.py): `backend/app.py`
- [Inference pipeline](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/pipeline.py): `backend/pipeline.py`
- [Disease treatments](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/disease_treatments.py): `backend/disease_treatments.py`
- [Action simulation](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/action_simulator.py): `backend/action_simulator.py`

### Farm intelligence

- [Spatial intelligence](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/geo_spatial_engine.py): `backend/geo_spatial_engine.py`
- [Spread forecasting](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/geo_forecast_engine.py): `backend/geo_forecast_engine.py`
- [Weather insights](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/weather_disease_engine.py): `backend/weather_disease_engine.py`
- [Soil insights](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/soil_api.py): `backend/soil_api.py`

### Advice and discovery

- [Government schemes](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/schemes_data.py): `backend/schemes_data.py`
- [Local suppliers](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/supplier_engine.py): `backend/supplier_engine.py`
- [Pest alerts](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/pest_alerts.py): `backend/pest_alerts.py`

### Feedback and improvement

- [Feedback collection](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/feedback_collector.py): `backend/feedback_collector.py`
- [Model retraining](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/retrain_service.py): `backend/retrain_service.py`
- [Application data](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/db.py): `backend/db.py`
- [Storage adapter](https://github.com/saiganesh-kota/agrovision_aws/blob/main/backend/storage.py): `backend/storage.py`

### Other components

- **Farmer**

## Connections

- Farmer → React application: uses (evidence: `README.md`)
- React application → Crop scanning: routes to (evidence: `frontend/src/App.jsx`)
- React application → Diagnosis results: routes to (evidence: `frontend/src/App.jsx`)
- React application → Farm dashboard: routes to (evidence: `frontend/src/App.jsx`)
- React application → Geo map: routes to (evidence: `frontend/src/App.jsx`)
- React application → Scheme discovery: routes to (evidence: `frontend/src/App.jsx`)
- React application → Crop calendar: routes to (evidence: `frontend/src/App.jsx`)
- Crop scanning → REST client: requests (evidence: `frontend/src/pages/ScanPage.jsx`)
- Diagnosis results → REST client: requests (evidence: `frontend/src/pages/AnalysisPage.jsx`)
- Farm dashboard → REST client: requests (evidence: `frontend/src/pages/DashboardPage.jsx`)
- Geo map → REST client: requests (evidence: `frontend/src/pages/GeoMapPage.jsx`)
- Recommendations → REST client: requests (evidence: `frontend/src/pages/RecommendationPage.jsx`)
- Scheme discovery → REST client: requests (evidence: `frontend/src/pages/SchemesPage.jsx`)
- RaithuMitra assistant → REST client: sends chat (evidence: `frontend/src/components/ChatBot.jsx`)
- REST client → Flask API: REST requests (evidence: `README.md`)
- Flask API → Inference pipeline: runs diagnosis (evidence: `backend/app.py`)
- Inference pipeline → Disease treatments: uses disease data (evidence: `backend/pipeline.py`)
- Inference pipeline → Action simulation: simulates actions (evidence: `backend/pipeline.py`)
- Flask API → Spatial intelligence: serves geo intelligence (evidence: `backend/app.py`)
- Spread forecasting → Spatial intelligence: uses spatial data (evidence: `backend/geo_forecast_engine.py`)
- Flask API → Weather insights: serves weather insights (evidence: `backend/app.py`)
- Flask API → Soil insights: serves soil insights (evidence: `backend/app.py`)
- Flask API → Government schemes: serves scheme data (evidence: `backend/app.py`)
- Flask API → Local suppliers: serves suppliers (evidence: `backend/app.py`)
- Flask API → Pest alerts: serves alerts (evidence: `backend/app.py`)
- Flask API → Feedback collection: collects feedback (evidence: `backend/app.py`)
- Feedback collection → Model retraining: supports adaptation
- Application data → Storage adapter: uses adapter (evidence: `backend/db.py`)
