# kavyapushpala/agrivision architecture

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

- Interactive diagram: https://gitdiagram.com/kavyapushpala/agrivision
- Repository: https://github.com/kavyapushpala/agrivision

## Overview

AgriVision is a Flask web app for plant-leaf disease decision support. A user submits an image; the app stores it, resizes and tensors it, invokes the CNN, then maps the prediction to disease guidance and product suggestions for a result page. The market, informational pages, and documented shared UI capabilities are separate branches. README documents multilingual and theme support, but their implementation was not sampled, so their wiring is not shown.

Main entry points: [`Deploy_app/app.py`](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/app.py) (Flask routes), [`Deploy_app/static/uploads`](https://github.com/kavyapushpala/agrivision/tree/main/Deploy_app/static/uploads) (Uploaded images), [`Deploy_app/disease_info.csv`](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/disease_info.csv) (Disease guidance data), [`Deploy_app/supplement_info.csv`](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/supplement_info.csv) (Supplement data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_flask["Flask routes<br/>[app.py]"]
  node_home["Home page<br/>[home.html]"]
  node_ai_page["AI engine page<br/>[index.html]"]
  node_shared_ui["Shared UI<br/>[base.html]"]
  node_info_pages["About and contact<br/>[about.html]"]
  node_translation["Language support<br/>[base.html]"]
end

subgraph group_inference["Disease inference"]
  node_uploads["Uploaded images"]
  node_preprocess["Image preprocessing<br/>[app.py]"]
  node_cnn["CNN model<br/>[CNN.py]"]
  node_model_weights["Model weights"]
end

subgraph group_guidance["Guidance and products"]
  node_disease_data["Disease guidance data<br/>[disease_info.csv]"]
  node_supplement_data["Supplement data"]
  node_result["Prediction result<br/>[submit.html]"]
  node_market["Supplement market<br/>[market.html]"]
end

node_user(("Visitor"))

node_user -->|"requests pages"| node_flask
node_flask -->|"renders"| node_home
node_flask -->|"renders"| node_ai_page
node_flask -->|"renders"| node_info_pages
node_flask -->|"renders via pages"| node_shared_ui
node_user -->|"submits image"| node_flask
node_flask -->|"saves image"| node_uploads
node_flask -->|"reads image"| node_uploads
node_flask -->|"resizes and tensors"| node_preprocess
node_preprocess -->|"invokes inference"| node_cnn
node_flask -->|"loads weights"| node_model_weights
node_flask -->|"reads guidance"| node_disease_data
node_flask -->|"reads products"| node_supplement_data
node_flask -->|"renders result"| node_result
node_flask -->|"renders market"| node_market
node_flask -->|"reads listings"| node_supplement_data
node_flask -->|"reads disease names"| node_disease_data
node_user -.->|"selects language"| node_translation

click node_flask "https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/app.py"
click node_home "https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/templates/home.html"
click node_ai_page "https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/templates/index.html"
click node_shared_ui "https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/templates/base.html"
click node_info_pages "https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/templates/about.html"
click node_uploads "https://github.com/kavyapushpala/agrivision/tree/main/Deploy_app/static/uploads"
click node_preprocess "https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/app.py"
click node_cnn "https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/CNN.py"
click node_model_weights "https://github.com/kavyapushpala/agrivision/tree/main/Deploy_app/Model"
click node_disease_data "https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/disease_info.csv"
click node_supplement_data "https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/supplement_info.csv"
click node_result "https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/templates/submit.html"
click node_market "https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/templates/market.html"
click node_translation "https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/templates/base.html"

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_home,node_ai_page,node_shared_ui,node_info_pages,node_translation toneBlue
class node_uploads,node_preprocess,node_cnn,node_model_weights toneAmber
class node_disease_data,node_supplement_data,node_result,node_market toneMint
class node_user toneIndigo
```

## Components

### Web experience

- [Flask routes](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/app.py): `Deploy_app/app.py`
- [Home page](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/templates/home.html): `Deploy_app/templates/home.html`
- [AI engine page](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/templates/index.html): `Deploy_app/templates/index.html`
- [Shared UI](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/templates/base.html): `Deploy_app/templates/base.html`
- [About and contact](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/templates/about.html): `Deploy_app/templates/about.html`
- [Language support](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/templates/base.html): `Deploy_app/templates/base.html`

### Disease inference

- [Uploaded images](https://github.com/kavyapushpala/agrivision/tree/main/Deploy_app/static/uploads): `Deploy_app/static/uploads`
- [Image preprocessing](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/app.py): `Deploy_app/app.py`
- [CNN model](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/CNN.py): `Deploy_app/CNN.py`
- [Model weights](https://github.com/kavyapushpala/agrivision/tree/main/Deploy_app/Model): `Deploy_app/Model`

### Guidance and products

- [Disease guidance data](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/disease_info.csv): `Deploy_app/disease_info.csv`
- [Supplement data](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/supplement_info.csv): `Deploy_app/supplement_info.csv`
- [Prediction result](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/templates/submit.html): `Deploy_app/templates/submit.html`
- [Supplement market](https://github.com/kavyapushpala/agrivision/blob/main/Deploy_app/templates/market.html): `Deploy_app/templates/market.html`

### Other components

- **Visitor**

## Connections

- Visitor → Flask routes: requests pages
- Flask routes → Home page: renders
- Flask routes → AI engine page: renders
- Flask routes → About and contact: renders
- Flask routes → Shared UI: renders via pages
- Visitor → Flask routes: submits image
- Flask routes → Uploaded images: saves image
- Flask routes → Uploaded images: reads image
- Flask routes → Image preprocessing: resizes and tensors
- Image preprocessing → CNN model: invokes inference
- Flask routes → Model weights: loads weights
- Flask routes → Disease guidance data: reads guidance
- Flask routes → Supplement data: reads products
- Flask routes → Prediction result: renders result
- Flask routes → Supplement market: renders market
- Flask routes → Supplement data: reads listings
- Flask routes → Disease guidance data: reads disease names
- Visitor → Language support: selects language
