# vaishnavi791/agritech architecture

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

- Interactive diagram: https://gitdiagram.com/vaishnavi791/agritech
- Repository: https://github.com/vaishnavi791/agritech

## Overview

AgriTech is an agriculture decision-support platform: users access crop recommendations, disease detection, cost estimates, price forecasts, and chatbot assistance through a web interface, with authentication also represented in the tree. The repository separates frontend pages and API clients from backend routes and services, and has corresponding ML or calculation modules. The excerpts are empty and the README only describes the platform broadly, so feature-level connections are shown as unverified rather than asserted as observed calls.

Main entry points: [`backend/app/services`](https://github.com/vaishnavi791/agritech/tree/main/backend/app/services) (Feature services), [`frontend/src/services`](https://github.com/vaishnavi791/agritech/tree/main/frontend/src/services) (API clients), [`frontend/src/routes/AppRoutes.jsx`](https://github.com/vaishnavi791/agritech/blob/main/frontend/src/routes/AppRoutes.jsx) (App navigation), [`frontend/src/pages`](https://github.com/vaishnavi791/agritech/tree/main/frontend/src/pages) (Decision pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_web_routes["App navigation<br/>[AppRoutes.jsx]"]
  node_farm_pages["Decision pages"]
  node_chat_ui["Chat interface<br/>[Chatbot.jsx]"]
  node_web_api["API clients"]
end

subgraph group_api["Backend API"]
  node_api_routes["Feature routes"]
  node_auth_route["Auth route<br/>[auth.py]"]
end

subgraph group_domain["Backend domain"]
  node_domain_services["Feature services"]
  node_auth_service["Authentication<br/>[auth_service.py]"]
  node_database[("Application database<br/>[database.py]")]
end

subgraph group_ml["Models and calculations"]
  node_crop_model["Crop recommendation<br/>[predict.py]"]
  node_disease_model["Disease detection<br/>[predict.py]"]
  node_cost_calc["Cost estimation<br/>[calculator.py]"]
  node_price_model["Price forecasting<br/>[predict.py]"]
end

node_farmer(("Farmer"))

node_farmer -.->|"uses"| node_web_routes
node_web_routes -.->|"routes to"| node_farm_pages
node_farmer -.->|"asks"| node_chat_ui
node_farm_pages -.->|"requests"| node_web_api
node_chat_ui -.->|"requests"| node_web_api
node_web_api -.->|"calls"| node_api_routes
node_web_api -.->|"authenticates"| node_auth_route
node_api_routes -.->|"dispatches"| node_domain_services
node_auth_route -.->|"delegates"| node_auth_service
node_domain_services -.->|"persists"| node_database
node_domain_services -.->|"uses"| node_crop_model
node_domain_services -.->|"uses"| node_disease_model
node_domain_services -.->|"uses"| node_cost_calc
node_domain_services -.->|"uses"| node_price_model

click node_web_routes "https://github.com/vaishnavi791/agritech/blob/main/frontend/src/routes/AppRoutes.jsx"
click node_farm_pages "https://github.com/vaishnavi791/agritech/tree/main/frontend/src/pages"
click node_chat_ui "https://github.com/vaishnavi791/agritech/blob/main/frontend/src/components/Chatbot/Chatbot.jsx"
click node_web_api "https://github.com/vaishnavi791/agritech/tree/main/frontend/src/services"
click node_api_routes "https://github.com/vaishnavi791/agritech/tree/main/backend/app/routes"
click node_auth_route "https://github.com/vaishnavi791/agritech/blob/main/backend/app/routes/auth.py"
click node_domain_services "https://github.com/vaishnavi791/agritech/tree/main/backend/app/services"
click node_auth_service "https://github.com/vaishnavi791/agritech/blob/main/backend/app/services/auth_service.py"
click node_database "https://github.com/vaishnavi791/agritech/blob/main/backend/app/core/database.py"
click node_crop_model "https://github.com/vaishnavi791/agritech/blob/main/ml/crop/predict.py"
click node_disease_model "https://github.com/vaishnavi791/agritech/blob/main/ml/disease/predict.py"
click node_cost_calc "https://github.com/vaishnavi791/agritech/blob/main/ml/cost/calculator.py"
click node_price_model "https://github.com/vaishnavi791/agritech/blob/main/ml/price/predict.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_web_routes,node_farm_pages,node_chat_ui,node_web_api toneBlue
class node_api_routes,node_auth_route toneAmber
class node_domain_services,node_auth_service,node_database toneMint
class node_crop_model,node_disease_model,node_cost_calc,node_price_model toneRose
class node_farmer toneIndigo
```

## Components

### Web application

- [App navigation](https://github.com/vaishnavi791/agritech/blob/main/frontend/src/routes/AppRoutes.jsx): `frontend/src/routes/AppRoutes.jsx`
- [Decision pages](https://github.com/vaishnavi791/agritech/tree/main/frontend/src/pages): `frontend/src/pages`
- [Chat interface](https://github.com/vaishnavi791/agritech/blob/main/frontend/src/components/Chatbot/Chatbot.jsx): `frontend/src/components/Chatbot/Chatbot.jsx`
- [API clients](https://github.com/vaishnavi791/agritech/tree/main/frontend/src/services): `frontend/src/services`

### Backend API

- [Feature routes](https://github.com/vaishnavi791/agritech/tree/main/backend/app/routes): `backend/app/routes`
- [Auth route](https://github.com/vaishnavi791/agritech/blob/main/backend/app/routes/auth.py): `backend/app/routes/auth.py`

### Backend domain

- [Feature services](https://github.com/vaishnavi791/agritech/tree/main/backend/app/services): `backend/app/services`
- [Authentication](https://github.com/vaishnavi791/agritech/blob/main/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`
- [Application database](https://github.com/vaishnavi791/agritech/blob/main/backend/app/core/database.py): `backend/app/core/database.py`

### Models and calculations

- [Crop recommendation](https://github.com/vaishnavi791/agritech/blob/main/ml/crop/predict.py): `ml/crop/predict.py`
- [Disease detection](https://github.com/vaishnavi791/agritech/blob/main/ml/disease/predict.py): `ml/disease/predict.py`
- [Cost estimation](https://github.com/vaishnavi791/agritech/blob/main/ml/cost/calculator.py): `ml/cost/calculator.py`
- [Price forecasting](https://github.com/vaishnavi791/agritech/blob/main/ml/price/predict.py): `ml/price/predict.py`

### Other components

- **Farmer**

## Connections

- Farmer → App navigation: uses
- App navigation → Decision pages: routes to
- Farmer → Chat interface: asks
- Decision pages → API clients: requests
- Chat interface → API clients: requests
- API clients → Feature routes: calls
- API clients → Auth route: authenticates
- Feature routes → Feature services: dispatches
- Auth route → Authentication: delegates
- Feature services → Application database: persists
- Feature services → Crop recommendation: uses
- Feature services → Disease detection: uses
- Feature services → Cost estimation: uses
- Feature services → Price forecasting: uses
