# calebgesami/agrimax2 architecture

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

- Interactive diagram: https://gitdiagram.com/calebgesami/agrimax2
- Repository: https://github.com/calebgesami/agrimax2

## Overview

AgriMax is a farmer-facing companion for farm profiles, financial planning, irrigation advice, and agricultural insights. A farmer creates or restores a profile, then uses the dashboard to reach finance, irrigation, and AI tools; the finance view calculates farm returns and retrieves scheme information, while irrigation requests weather-based recommendations. The README also describes market prices and AI crop, disease, yield, and chat features. Those unsampled feature modules are represented from the tree and documentation; their internal wiring is not inferred. The backend excerpt supports scheme and weather routes, including an OpenWeatherMap call.

Main entry points: [`frontend/src/App.jsx`](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/App.jsx) (App coordinator), [`frontend/src/components/FinanceDashboard.jsx`](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/FinanceDashboard.jsx) (Finance helper), [`frontend/src/components/AIDashboard.jsx`](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/AIDashboard.jsx) (AI assistant hub), [`backend/server.js`](https://github.com/calebgesami/agrimax2/blob/main/backend/server.js) (Weather advice route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Farmer experience"]
  node_app["App coordinator<br/>[App.jsx]"]
  node_profile["Farmer profile<br/>[FarmerProfile.jsx]"]
  node_dashboard["Farm dashboard<br/>[Dashboard.jsx]"]
  node_navigation["Navigation<br/>[Navigation.jsx]"]
  node_market["Market prices<br/>[MarketPrices.jsx]"]
end

subgraph group_farm_tools["Farm tools"]
  node_finance["Finance helper"]
  node_profit["Profit and ROI"]
  node_schemes["Scheme matching"]
  node_scheme_details["Scheme documents"]
  node_irrigation["Irrigation scheduler"]
end

subgraph group_ai_insights["AI insights"]
  node_ai_dashboard["AI assistant hub<br/>[AIDashboard.jsx]"]
  node_crop_advisor["Crop advisor<br/>[AICropAdvisor.jsx]"]
  node_disease_detector["Disease detector"]
  node_yield_predictor["Yield predictor"]
  node_farmer_assistant["Farming chatbot"]
end

subgraph group_services["Backend services"]
  node_scheme_api["Schemes endpoint<br/>[server.js]"]
  node_scheme_data["Scheme catalog<br/>[schemes.json]"]
  node_weather_advice["Weather advice route<br/>[server.js]"]
  node_irrigation_rules["Irrigation rules<br/>[server.js]"]
end

node_farmer(("Farmer"))
node_weather_api["OpenWeatherMap"]
node_local_storage[("Browser local storage")]

node_farmer -->|"uses"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"renders"| node_profile
node_app -->|"renders"| node_dashboard
node_app -->|"opens"| node_finance
node_app -->|"opens"| node_irrigation
node_app -->|"opens"| node_ai_dashboard
node_app -->|"reads and writes profile"| node_local_storage
node_dashboard -->|"renders"| node_market
node_finance -->|"calculates"| node_profit
node_finance -->|"checks eligibility"| node_schemes
node_finance -->|"fetches schemes"| node_scheme_api
node_finance -->|"shows details"| node_scheme_details
node_scheme_api -->|"reads"| node_scheme_data
node_irrigation -->|"requests advice"| node_weather_advice
node_weather_advice -->|"fetches forecast"| node_weather_api
node_weather_advice -->|"generates advice"| node_irrigation_rules
node_ai_dashboard -->|"offers"| node_crop_advisor
node_ai_dashboard -->|"offers"| node_disease_detector
node_ai_dashboard -->|"offers"| node_yield_predictor
node_ai_dashboard -->|"offers"| node_farmer_assistant

click node_app "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/App.jsx"
click node_profile "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/FarmerProfile.jsx"
click node_dashboard "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/Dashboard.jsx"
click node_navigation "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/Navigation.jsx"
click node_market "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/MarketPrices.jsx"
click node_finance "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/FinanceDashboard.jsx"
click node_profit "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/FinanceDashboard.jsx"
click node_schemes "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/FinanceDashboard.jsx"
click node_scheme_details "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/FinanceDashboard.jsx"
click node_scheme_api "https://github.com/calebgesami/agrimax2/blob/main/backend/server.js"
click node_scheme_data "https://github.com/calebgesami/agrimax2/blob/main/backend/schemes.json"
click node_irrigation "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/IrrigationScheduler.jsx"
click node_weather_advice "https://github.com/calebgesami/agrimax2/blob/main/backend/server.js"
click node_irrigation_rules "https://github.com/calebgesami/agrimax2/blob/main/backend/server.js"
click node_ai_dashboard "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/AIDashboard.jsx"
click node_crop_advisor "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/AICropAdvisor.jsx"
click node_disease_detector "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/AIDiseaseDetector.jsx"
click node_yield_predictor "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/AIYieldPredictor.jsx"
click node_farmer_assistant "https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/AIFarmerAssistant.jsx"

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_profile,node_dashboard,node_navigation,node_market toneBlue
class node_finance,node_profit,node_schemes,node_scheme_details,node_irrigation,node_local_storage toneAmber
class node_ai_dashboard,node_crop_advisor,node_disease_detector,node_yield_predictor,node_farmer_assistant toneMint
class node_scheme_api,node_scheme_data,node_weather_advice,node_irrigation_rules toneRose
class node_farmer,node_weather_api toneIndigo
```

## Components

### Farmer experience

- [App coordinator](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Farmer profile](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/FarmerProfile.jsx): `frontend/src/components/FarmerProfile.jsx`
- [Farm dashboard](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/Dashboard.jsx): `frontend/src/components/Dashboard.jsx`
- [Navigation](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/Navigation.jsx): `frontend/src/components/Navigation.jsx`
- [Market prices](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/MarketPrices.jsx): `frontend/src/components/MarketPrices.jsx`

### Farm tools

- [Finance helper](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/FinanceDashboard.jsx): `frontend/src/components/FinanceDashboard.jsx`
- [Profit and ROI](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/FinanceDashboard.jsx): `frontend/src/components/FinanceDashboard.jsx`
- [Scheme matching](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/FinanceDashboard.jsx): `frontend/src/components/FinanceDashboard.jsx`
- [Scheme documents](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/FinanceDashboard.jsx): `frontend/src/components/FinanceDashboard.jsx`
- [Irrigation scheduler](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/IrrigationScheduler.jsx): `frontend/src/components/IrrigationScheduler.jsx`

### AI insights

- [AI assistant hub](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/AIDashboard.jsx): `frontend/src/components/AIDashboard.jsx`
- [Crop advisor](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/AICropAdvisor.jsx): `frontend/src/components/AICropAdvisor.jsx`
- [Disease detector](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/AIDiseaseDetector.jsx): `frontend/src/components/AIDiseaseDetector.jsx`
- [Yield predictor](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/AIYieldPredictor.jsx): `frontend/src/components/AIYieldPredictor.jsx`
- [Farming chatbot](https://github.com/calebgesami/agrimax2/blob/main/frontend/src/components/AIFarmerAssistant.jsx): `frontend/src/components/AIFarmerAssistant.jsx`

### Backend services

- [Schemes endpoint](https://github.com/calebgesami/agrimax2/blob/main/backend/server.js): `backend/server.js`
- [Scheme catalog](https://github.com/calebgesami/agrimax2/blob/main/backend/schemes.json): `backend/schemes.json`
- [Weather advice route](https://github.com/calebgesami/agrimax2/blob/main/backend/server.js): `backend/server.js`
- [Irrigation rules](https://github.com/calebgesami/agrimax2/blob/main/backend/server.js): `backend/server.js`

### Other components

- **Farmer**
- **OpenWeatherMap**
- **Browser local storage**

## Connections

- Farmer → App coordinator: uses
- App coordinator → Navigation: renders
- App coordinator → Farmer profile: renders
- App coordinator → Farm dashboard: renders
- App coordinator → Finance helper: opens
- App coordinator → Irrigation scheduler: opens
- App coordinator → AI assistant hub: opens
- App coordinator → Browser local storage: reads and writes profile
- Farm dashboard → Market prices: renders
- Finance helper → Profit and ROI: calculates
- Finance helper → Scheme matching: checks eligibility
- Finance helper → Schemes endpoint: fetches schemes
- Finance helper → Scheme documents: shows details
- Schemes endpoint → Scheme catalog: reads
- Irrigation scheduler → Weather advice route: requests advice
- Weather advice route → OpenWeatherMap: fetches forecast
- Weather advice route → Irrigation rules: generates advice
- AI assistant hub → Crop advisor: offers
- AI assistant hub → Disease detector: offers
- AI assistant hub → Yield predictor: offers
- AI assistant hub → Farming chatbot: offers
