# saranya-aluru/cropwise architecture

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

- Interactive diagram: https://gitdiagram.com/saranya-aluru/cropwise
- Repository: https://github.com/saranya-aluru/cropwise

## Overview

CropWise is a Streamlit crop-recommendation dashboard. Users enter seven soil and environmental readings, which the app uses to produce a crop recommendation and show probabilities and an input summary. The app also provides model-explanation and performance pages. The source excerpt describes training a logistic-regression model from the CSV and using a demo fallback if it is missing; this differs from the README’s description of the current implementation as rule-based. The app is a single-file implementation, so its distinct responsibilities share one source path. Edges reflect the shown excerpt or documented workflow; unsampled page internals are not inferred.

Main entry points: [`cropwise/app.py`](https://github.com/saranya-aluru/cropwise/blob/main/cropwise/app.py) (Streamlit App), [`cropwise/Crop_recommendation.csv`](https://github.com/saranya-aluru/cropwise/blob/main/cropwise/Crop_recommendation.csv) (Crop Dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_app["Streamlit App<br/>[app.py]"]
  node_input["Field Inputs<br/>[app.py]"]
end

subgraph group_modeling["Data and Prediction"]
  node_dataset["Crop Dataset"]
  node_training["Model Training<br/>[app.py]"]
  node_prediction["Crop Prediction<br/>[app.py]"]
end

subgraph group_insight["Results and Evaluation"]
  node_recommendation["Recommendation View<br/>[app.py]"]
  node_explanation["Model Explanation<br/>[app.py]"]
  node_performance["Performance Dashboard<br/>[app.py]"]
end

node_farmer(("User"))

node_farmer -->|"uses"| node_app
node_app -->|"presents"| node_input
node_input -->|"provides readings"| node_prediction
node_app -->|"trains on startup"| node_training
node_training -->|"reads"| node_dataset
node_prediction -->|"displays result"| node_recommendation
node_recommendation -->|"shows recommendation"| node_farmer
node_app -->|"provides page"| node_explanation
node_app -->|"provides page"| node_performance
node_training -.->|"supplies model"| node_prediction

click node_app "https://github.com/saranya-aluru/cropwise/blob/main/cropwise/app.py"
click node_input "https://github.com/saranya-aluru/cropwise/blob/main/cropwise/app.py"
click node_dataset "https://github.com/saranya-aluru/cropwise/blob/main/cropwise/Crop_recommendation.csv"
click node_training "https://github.com/saranya-aluru/cropwise/blob/main/cropwise/app.py"
click node_prediction "https://github.com/saranya-aluru/cropwise/blob/main/cropwise/app.py"
click node_recommendation "https://github.com/saranya-aluru/cropwise/blob/main/cropwise/app.py"
click node_explanation "https://github.com/saranya-aluru/cropwise/blob/main/cropwise/app.py"
click node_performance "https://github.com/saranya-aluru/cropwise/blob/main/cropwise/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_app,node_input,node_farmer toneBlue
class node_dataset,node_training,node_prediction toneAmber
class node_recommendation,node_explanation,node_performance toneMint
```

## Components

### Dashboard

- [Streamlit App](https://github.com/saranya-aluru/cropwise/blob/main/cropwise/app.py): `cropwise/app.py`
- [Field Inputs](https://github.com/saranya-aluru/cropwise/blob/main/cropwise/app.py): `cropwise/app.py`

### Data and Prediction

- [Crop Dataset](https://github.com/saranya-aluru/cropwise/blob/main/cropwise/Crop_recommendation.csv): `cropwise/Crop_recommendation.csv`
- [Model Training](https://github.com/saranya-aluru/cropwise/blob/main/cropwise/app.py): `cropwise/app.py`
- [Crop Prediction](https://github.com/saranya-aluru/cropwise/blob/main/cropwise/app.py): `cropwise/app.py`

### Results and Evaluation

- [Recommendation View](https://github.com/saranya-aluru/cropwise/blob/main/cropwise/app.py): `cropwise/app.py`
- [Model Explanation](https://github.com/saranya-aluru/cropwise/blob/main/cropwise/app.py): `cropwise/app.py`
- [Performance Dashboard](https://github.com/saranya-aluru/cropwise/blob/main/cropwise/app.py): `cropwise/app.py`

### Other components

- **User**

## Connections

- User → Streamlit App: uses (evidence: `README.md`)
- Streamlit App → Field Inputs: presents (evidence: `README.md`)
- Field Inputs → Crop Prediction: provides readings (evidence: `README.md`)
- Streamlit App → Model Training: trains on startup (evidence: `cropwise/app.py`)
- Model Training → Crop Dataset: reads (evidence: `cropwise/app.py`)
- Crop Prediction → Recommendation View: displays result (evidence: `README.md`)
- Recommendation View → User: shows recommendation (evidence: `README.md`)
- Streamlit App → Model Explanation: provides page (evidence: `README.md`)
- Streamlit App → Performance Dashboard: provides page (evidence: `README.md`)
- Model Training → Crop Prediction: supplies model (evidence: `cropwise/app.py`)
