# baddamakshaya01-star/agricast architecture

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

- Interactive diagram: https://gitdiagram.com/baddamakshaya01-star/agricast
- Repository: https://github.com/baddamakshaya01-star/agricast

## Overview

AgriCast AI helps farmers compare crop-price forecasts and field-specific crop recommendations. In the web workflow, a farmer uses the dashboard to request a forecast; the server reads market data and invokes the forecasting engine, then returns results for display. Crop recommendations are a distinct decision stage: the recommender evaluates field and risk inputs and calls the forecaster for harvest-price estimates. The CLI offers parallel access. The excerpts establish these main calls; some dashboard capabilities are documented but their individual routes are not shown.

Main entry points: [`src/data_generator.py`](https://github.com/baddamakshaya01-star/agricast/blob/main/src/data_generator.py) (Dataset Loader / Generator), [`src/server.py`](https://github.com/baddamakshaya01-star/agricast/blob/main/src/server.py) (HTTP API), [`src/cli.py`](https://github.com/baddamakshaya01-star/agricast/blob/main/src/cli.py) (Forecast CLI), [`src/recommender.py`](https://github.com/baddamakshaya01-star/agricast/blob/main/src/recommender.py) (Crop & Portfolio Advisor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_dashboard["Web Dashboard<br/>[app.js]"]
  node_translations["Translations<br/>[i18n.js]"]
  node_cli["Forecast CLI<br/>[cli.py]"]
end

subgraph group_service["Web Service"]
  node_webserver["HTTP API<br/>[server.py]"]
  node_market_ops["Market Data &amp; CSV Import<br/>[server.py]"]
end

subgraph group_engines["Decision Engines"]
  node_forecaster["Price Forecasting<br/>[forecaster.py]"]
  node_recommender["Crop &amp; Portfolio Advisor<br/>[recommender.py]"]
end

subgraph group_data["Market Data"]
  node_generator["Dataset Loader / Generator<br/>[data_generator.py]"]
  node_market_csv["Market / Weather Dataset"]
  node_market_db[("SQLite Market Store<br/>[agricast.db]")]
  node_crop_profiles["Crop Profiles<br/>[crop_profiles.json]"]
end

node_farmer(("Farmer / Planner"))

node_farmer -->|"uses"| node_dashboard
node_dashboard -->|"requests forecast"| node_webserver
node_dashboard -->|"reads translations"| node_translations
node_webserver -->|"runs forecast"| node_forecaster
node_webserver -->|"requests recommendations"| node_recommender
node_webserver -->|"loads market data"| node_generator
node_recommender -->|"forecasts harvest prices"| node_forecaster
node_recommender -->|"loads crop profiles"| node_generator
node_generator -->|"loads / writes"| node_market_csv
node_generator -->|"writes dataset"| node_market_db
node_generator -->|"reads profiles"| node_crop_profiles
node_cli -->|"loads data"| node_generator
node_cli -->|"runs forecast"| node_forecaster
node_cli -->|"requests advice"| node_recommender
node_farmer -->|"runs commands"| node_cli

click node_dashboard "https://github.com/baddamakshaya01-star/agricast/blob/main/static/app.js"
click node_translations "https://github.com/baddamakshaya01-star/agricast/blob/main/static/i18n.js"
click node_cli "https://github.com/baddamakshaya01-star/agricast/blob/main/src/cli.py"
click node_webserver "https://github.com/baddamakshaya01-star/agricast/blob/main/src/server.py"
click node_market_ops "https://github.com/baddamakshaya01-star/agricast/blob/main/src/server.py"
click node_forecaster "https://github.com/baddamakshaya01-star/agricast/blob/main/src/forecaster.py"
click node_recommender "https://github.com/baddamakshaya01-star/agricast/blob/main/src/recommender.py"
click node_generator "https://github.com/baddamakshaya01-star/agricast/blob/main/src/data_generator.py"
click node_market_csv "https://github.com/baddamakshaya01-star/agricast/blob/main/data/crop_market_weather_data.csv"
click node_market_db "https://github.com/baddamakshaya01-star/agricast/blob/main/data/agricast.db"
click node_crop_profiles "https://github.com/baddamakshaya01-star/agricast/blob/main/data/crop_profiles.json"

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_dashboard,node_translations,node_cli toneBlue
class node_webserver,node_market_ops toneAmber
class node_forecaster,node_recommender toneMint
class node_generator,node_market_csv,node_market_db,node_crop_profiles toneRose
class node_farmer toneIndigo
```

## Components

### User Interfaces

- [Web Dashboard](https://github.com/baddamakshaya01-star/agricast/blob/main/static/app.js): `static/app.js`
- [Translations](https://github.com/baddamakshaya01-star/agricast/blob/main/static/i18n.js): `static/i18n.js`
- [Forecast CLI](https://github.com/baddamakshaya01-star/agricast/blob/main/src/cli.py): `src/cli.py`

### Web Service

- [HTTP API](https://github.com/baddamakshaya01-star/agricast/blob/main/src/server.py): `src/server.py`
- [Market Data & CSV Import](https://github.com/baddamakshaya01-star/agricast/blob/main/src/server.py): `src/server.py`

### Decision Engines

- [Price Forecasting](https://github.com/baddamakshaya01-star/agricast/blob/main/src/forecaster.py): `src/forecaster.py`
- [Crop & Portfolio Advisor](https://github.com/baddamakshaya01-star/agricast/blob/main/src/recommender.py): `src/recommender.py`

### Market Data

- [Dataset Loader / Generator](https://github.com/baddamakshaya01-star/agricast/blob/main/src/data_generator.py): `src/data_generator.py`
- [Market / Weather Dataset](https://github.com/baddamakshaya01-star/agricast/blob/main/data/crop_market_weather_data.csv): `data/crop_market_weather_data.csv`
- [SQLite Market Store](https://github.com/baddamakshaya01-star/agricast/blob/main/data/agricast.db): `data/agricast.db`
- [Crop Profiles](https://github.com/baddamakshaya01-star/agricast/blob/main/data/crop_profiles.json): `data/crop_profiles.json`

### Other components

- **Farmer / Planner**

## Connections

- Farmer / Planner → Web Dashboard: uses (evidence: `README.md`)
- Web Dashboard → HTTP API: requests forecast (evidence: `static/app.js`)
- Web Dashboard → Translations: reads translations (evidence: `static/app.js`)
- HTTP API → Price Forecasting: runs forecast (evidence: `src/server.py`)
- HTTP API → Crop & Portfolio Advisor: requests recommendations (evidence: `src/server.py`)
- HTTP API → Dataset Loader / Generator: loads market data (evidence: `src/server.py`)
- Crop & Portfolio Advisor → Price Forecasting: forecasts harvest prices (evidence: `src/recommender.py`)
- Crop & Portfolio Advisor → Dataset Loader / Generator: loads crop profiles (evidence: `src/recommender.py`)
- Dataset Loader / Generator → Market / Weather Dataset: loads / writes (evidence: `src/data_generator.py`)
- Dataset Loader / Generator → SQLite Market Store: writes dataset (evidence: `src/data_generator.py`)
- Dataset Loader / Generator → Crop Profiles: reads profiles (evidence: `src/data_generator.py`)
- Forecast CLI → Dataset Loader / Generator: loads data (evidence: `src/cli.py`)
- Forecast CLI → Price Forecasting: runs forecast (evidence: `src/cli.py`)
- Forecast CLI → Crop & Portfolio Advisor: requests advice (evidence: `src/cli.py`)
- Farmer / Planner → Forecast CLI: runs commands (evidence: `README.md`)
