# prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform architecture

> Architecture diagram of the GitHub repository prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform
- Repository: https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform

## Overview

AgroPro is a Flask agricultural decision-support platform for farmers. The main workflow is a farmer submitting crop, soil, image, or farm-planning inputs through the web interface; Flask routes dispatch to prediction or advisory logic and return results in templates. The README documents crop, disease, fertilizer, yield, price, and irrigation tools, plus weather, schemes, and authentication. Source excerpts are partial, so several route implementations and integrations are represented only at the app boundary; undocumented persistence and uncertain call wiring are omitted.

Main entry points: [`app.py`](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py) (Flask routes), [`utils/model.py`](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/utils/model.py) (Image classifier), [`utils/smart_assistant.py`](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/utils/smart_assistant.py) (Smart assistant), [`utils/nlp_assistant.py`](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/utils/nlp_assistant.py) (Rule-based Q&A)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_flask["Flask routes<br/>[app.py]"]
  node_pages["Page templates"]
end

subgraph group_decision["Farm decisions"]
  node_crop["Crop recommendation<br/>[app.py]"]
  node_crop_models["Crop model artifacts"]
  node_fert["Fertilizer advisor<br/>[app.py]"]
  node_fert_advice["Nutrient guidance<br/>[fertilizer.py]"]
  node_yield["Yield prediction<br/>[app.py]"]
  node_price["Price prediction<br/>[app.py]"]
  node_irrigation["Irrigation advice<br/>[app.py]"]
end

subgraph group_insight["Field insights"]
  node_disease["Disease detection<br/>[app.py]"]
  node_disease_net["Image classifier<br/>[model.py]"]
  node_disease_models["Disease model files"]
  node_disease_advice["Disease guidance<br/>[disease.py]"]
  node_satellite["Satellite analysis<br/>[app.py]"]
  node_weather["Weather forecast<br/>[app.py]"]
end

subgraph group_support["Farmer support"]
  node_assistant["Smart assistant<br/>[smart_assistant.py]"]
  node_nlp["Rule-based Q&amp;A<br/>[nlp_assistant.py]"]
  node_farm_services["Farm services<br/>[app.py]"]
end

node_farmer(("Farmer"))
node_weather_api{{"OpenWeatherMap"}}

node_farmer -->|"submits request"| node_flask
node_flask -->|"renders pages"| node_pages
node_flask -->|"dispatches input"| node_crop
node_crop -->|"loads artifacts"| node_crop_models
node_flask -->|"dispatches input"| node_fert
node_fert -->|"uses guidance"| node_fert_advice
node_flask -->|"dispatches input"| node_yield
node_flask -->|"dispatches input"| node_price
node_flask -->|"dispatches input"| node_irrigation
node_flask -->|"dispatches image"| node_disease
node_disease -->|"classifies image"| node_disease_net
node_disease_net -->|"loads weights"| node_disease_models
node_disease -->|"looks up diagnosis"| node_disease_advice
node_flask -->|"dispatches query"| node_satellite
node_flask -->|"dispatches query"| node_weather
node_weather -.->|"requests forecast"| node_weather_api
node_flask -->|"dispatches question"| node_assistant
node_flask -->|"serves farm pages"| node_farm_services
node_assistant -->|"returns answer"| node_flask
node_nlp -.->|"returns answer"| node_flask

click node_flask "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py"
click node_pages "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/tree/main/templates"
click node_crop "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py"
click node_crop_models "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/tree/main/models"
click node_fert "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py"
click node_fert_advice "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/utils/fertilizer.py"
click node_yield "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py"
click node_price "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py"
click node_irrigation "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py"
click node_disease "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py"
click node_disease_net "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/utils/model.py"
click node_disease_models "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/tree/main/models"
click node_disease_advice "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/utils/disease.py"
click node_satellite "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py"
click node_weather "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py"
click node_assistant "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/utils/smart_assistant.py"
click node_nlp "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/utils/nlp_assistant.py"
click node_farm_services "https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.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_flask,node_pages toneBlue
class node_crop,node_crop_models,node_fert,node_fert_advice,node_yield,node_price,node_irrigation toneAmber
class node_disease,node_disease_net,node_disease_models,node_disease_advice,node_satellite,node_weather toneMint
class node_assistant,node_nlp,node_farm_services toneRose
class node_farmer,node_weather_api toneIndigo
```

## Components

### Web interface

- [Flask routes](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py): `app.py`
- [Page templates](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/tree/main/templates): `templates`

### Farm decisions

- [Crop recommendation](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py): `app.py`
- [Crop model artifacts](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/tree/main/models): `models`
- [Fertilizer advisor](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py): `app.py`
- [Nutrient guidance](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/utils/fertilizer.py): `utils/fertilizer.py`
- [Yield prediction](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py): `app.py`
- [Price prediction](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py): `app.py`
- [Irrigation advice](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py): `app.py`

### Field insights

- [Disease detection](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py): `app.py`
- [Image classifier](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/utils/model.py): `utils/model.py`
- [Disease model files](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/tree/main/models): `models`
- [Disease guidance](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/utils/disease.py): `utils/disease.py`
- [Satellite analysis](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py): `app.py`
- [Weather forecast](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py): `app.py`

### Farmer support

- [Smart assistant](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/utils/smart_assistant.py): `utils/smart_assistant.py`
- [Rule-based Q&A](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/utils/nlp_assistant.py): `utils/nlp_assistant.py`
- [Farm services](https://github.com/prajwal-praju01/agropro---ai-powered-smart-agricultural-advisory-platform/blob/main/app.py): `app.py`

### Other components

- **Farmer**
- **OpenWeatherMap**

## Connections

- Farmer → Flask routes: submits request
- Flask routes → Page templates: renders pages
- Flask routes → Crop recommendation: dispatches input
- Crop recommendation → Crop model artifacts: loads artifacts
- Flask routes → Fertilizer advisor: dispatches input
- Fertilizer advisor → Nutrient guidance: uses guidance
- Flask routes → Yield prediction: dispatches input
- Flask routes → Price prediction: dispatches input
- Flask routes → Irrigation advice: dispatches input
- Flask routes → Disease detection: dispatches image
- Disease detection → Image classifier: classifies image
- Image classifier → Disease model files: loads weights
- Disease detection → Disease guidance: looks up diagnosis
- Flask routes → Satellite analysis: dispatches query
- Flask routes → Weather forecast: dispatches query
- Weather forecast → OpenWeatherMap: requests forecast
- Flask routes → Smart assistant: dispatches question
- Flask routes → Farm services: serves farm pages
- Smart assistant → Flask routes: returns answer
- Rule-based Q&A → Flask routes: returns answer
