# ab007shetty/crop-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/ab007shetty/crop-management-system
- Repository: https://github.com/ab007shetty/crop-management-system

## Overview

Crop Management System is a farmer-facing PHP/HTML application whose main workflow is entering farm, soil, or regional details and receiving one of five machine-learning recommendations or predictions. Feature pages provide the input/result interface; Python scripts or models implement the prediction logic, with sampled PHP pages invoking Python directly. The README documents all five capabilities, but several page-to-model connections and model internals were not sampled, so those links are omitted. The graph includes only source-supported runtime relationships and documented user workflows.

Main entry points: [`fertilizer_recommendation.php`](https://github.com/ab007shetty/crop-management-system/blob/main/fertilizer_recommendation.php) (Fertilizer Recommendation), [`yield_prediction.php`](https://github.com/ab007shetty/crop-management-system/blob/main/yield_prediction.php) (Yield Prediction), [`ML/crop_prediction/ZDecision_Tree_Model.py`](https://github.com/ab007shetty/crop-management-system/blob/main/ML/crop_prediction/ZDecision_Tree_Model.py) (Decision Tree), [`ML/rainfall_prediction/rainfall_prediction.py`](https://github.com/ab007shetty/crop-management-system/blob/main/ML/rainfall_prediction/rainfall_prediction.py) (Rainfall Predictor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Interface"]
  node_home["Home Page<br/>[index.php]"]
  node_shared_header["Page Header<br/>[header.php]"]
  node_shared_nav["Navigation<br/>[nav.php]"]
  node_shared_footer["Page Footer<br/>[footer.php]"]
end

subgraph group_crop["Crop Decisions"]
  node_crop_prediction_page["Crop Prediction"]
  node_crop_tree["Decision Tree"]
  node_crop_model_call["Prediction Runner"]
  node_crop_recommend_page["Crop Recommendation"]
  node_crop_recommender["Crop Recommender<br/>[recommend.py]"]
end

subgraph group_inputs["Soil &amp; Weather"]
  node_fert_page["Fertilizer Recommendation"]
  node_fert_model["Fertilizer Model"]
  node_rain_page["Rainfall Prediction"]
  node_rain_model["Rainfall Predictor"]
  node_rain_data[("Rainfall Dataset")]
end

subgraph group_production["Production Forecasts"]
  node_yield_page["Yield Prediction"]
  node_yield_model["Yield Predictor"]
end

node_farmer(("Farmer"))

node_farmer -->|"enters location"| node_crop_prediction_page
node_farmer -->|"enters soil data"| node_crop_recommend_page
node_farmer -->|"enters soil data"| node_fert_page
node_farmer -->|"enters region"| node_rain_page
node_farmer -->|"enters farm data"| node_yield_page
node_fert_page -->|"runs Python"| node_fert_model
node_yield_page -->|"runs Python"| node_yield_model
node_rain_model -->|"reads dataset"| node_rain_data
node_crop_tree -.->|"model handoff"| node_crop_model_call

click node_home "https://github.com/ab007shetty/crop-management-system/blob/main/index.php"
click node_crop_prediction_page "https://github.com/ab007shetty/crop-management-system/blob/main/crop_prediction.php"
click node_crop_tree "https://github.com/ab007shetty/crop-management-system/blob/main/ML/crop_prediction/ZDecision_Tree_Model.py"
click node_crop_model_call "https://github.com/ab007shetty/crop-management-system/blob/main/ML/crop_prediction/ZDecision_Tree_Model_Call.py"
click node_crop_recommend_page "https://github.com/ab007shetty/crop-management-system/blob/main/crop_recommendation.php"
click node_crop_recommender "https://github.com/ab007shetty/crop-management-system/blob/main/ML/crop_recommendation/recommend.py"
click node_fert_page "https://github.com/ab007shetty/crop-management-system/blob/main/fertilizer_recommendation.php"
click node_fert_model "https://github.com/ab007shetty/crop-management-system/blob/main/ML/fertilizer_recommendation/fertilizer_recommendation.py"
click node_rain_page "https://github.com/ab007shetty/crop-management-system/blob/main/rainfall_prediction.php"
click node_rain_model "https://github.com/ab007shetty/crop-management-system/blob/main/ML/rainfall_prediction/rainfall_prediction.py"
click node_rain_data "https://github.com/ab007shetty/crop-management-system/blob/main/ML/rainfall_prediction/rainfall_in_india_1901-2015.csv"
click node_yield_page "https://github.com/ab007shetty/crop-management-system/blob/main/yield_prediction.php"
click node_yield_model "https://github.com/ab007shetty/crop-management-system/blob/main/ML/yield_prediction/yield_prediction.py"
click node_shared_header "https://github.com/ab007shetty/crop-management-system/blob/main/header.php"
click node_shared_nav "https://github.com/ab007shetty/crop-management-system/blob/main/nav.php"
click node_shared_footer "https://github.com/ab007shetty/crop-management-system/blob/main/footer.php"

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_home,node_shared_header,node_shared_nav,node_shared_footer toneBlue
class node_crop_prediction_page,node_crop_tree,node_crop_model_call,node_crop_recommend_page,node_crop_recommender toneAmber
class node_fert_page,node_fert_model,node_rain_page,node_rain_model,node_rain_data toneMint
class node_yield_page,node_yield_model toneRose
class node_farmer toneIndigo
```

## Components

### Web Interface

- [Home Page](https://github.com/ab007shetty/crop-management-system/blob/main/index.php): `index.php`
- [Page Header](https://github.com/ab007shetty/crop-management-system/blob/main/header.php): `header.php`
- [Navigation](https://github.com/ab007shetty/crop-management-system/blob/main/nav.php): `nav.php`
- [Page Footer](https://github.com/ab007shetty/crop-management-system/blob/main/footer.php): `footer.php`

### Crop Decisions

- [Crop Prediction](https://github.com/ab007shetty/crop-management-system/blob/main/crop_prediction.php): `crop_prediction.php`
- [Decision Tree](https://github.com/ab007shetty/crop-management-system/blob/main/ML/crop_prediction/ZDecision_Tree_Model.py): `ML/crop_prediction/ZDecision_Tree_Model.py`
- [Prediction Runner](https://github.com/ab007shetty/crop-management-system/blob/main/ML/crop_prediction/ZDecision_Tree_Model_Call.py): `ML/crop_prediction/ZDecision_Tree_Model_Call.py`
- [Crop Recommendation](https://github.com/ab007shetty/crop-management-system/blob/main/crop_recommendation.php): `crop_recommendation.php`
- [Crop Recommender](https://github.com/ab007shetty/crop-management-system/blob/main/ML/crop_recommendation/recommend.py): `ML/crop_recommendation/recommend.py`

### Soil & Weather

- [Fertilizer Recommendation](https://github.com/ab007shetty/crop-management-system/blob/main/fertilizer_recommendation.php): `fertilizer_recommendation.php`
- [Fertilizer Model](https://github.com/ab007shetty/crop-management-system/blob/main/ML/fertilizer_recommendation/fertilizer_recommendation.py): `ML/fertilizer_recommendation/fertilizer_recommendation.py`
- [Rainfall Prediction](https://github.com/ab007shetty/crop-management-system/blob/main/rainfall_prediction.php): `rainfall_prediction.php`
- [Rainfall Predictor](https://github.com/ab007shetty/crop-management-system/blob/main/ML/rainfall_prediction/rainfall_prediction.py): `ML/rainfall_prediction/rainfall_prediction.py`
- [Rainfall Dataset](https://github.com/ab007shetty/crop-management-system/blob/main/ML/rainfall_prediction/rainfall_in_india_1901-2015.csv): `ML/rainfall_prediction/rainfall_in_india_1901-2015.csv`

### Production Forecasts

- [Yield Prediction](https://github.com/ab007shetty/crop-management-system/blob/main/yield_prediction.php): `yield_prediction.php`
- [Yield Predictor](https://github.com/ab007shetty/crop-management-system/blob/main/ML/yield_prediction/yield_prediction.py): `ML/yield_prediction/yield_prediction.py`

### Other components

- **Farmer**

## Connections

- Farmer → Crop Prediction: enters location (evidence: `README.md`)
- Farmer → Crop Recommendation: enters soil data (evidence: `README.md`)
- Farmer → Fertilizer Recommendation: enters soil data (evidence: `README.md`)
- Farmer → Rainfall Prediction: enters region (evidence: `README.md`)
- Farmer → Yield Prediction: enters farm data (evidence: `README.md`)
- Fertilizer Recommendation → Fertilizer Model: runs Python (evidence: `fertilizer_recommendation.php`)
- Yield Prediction → Yield Predictor: runs Python (evidence: `yield_prediction.php`)
- Rainfall Predictor → Rainfall Dataset: reads dataset (evidence: `ML/rainfall_prediction/rainfall_prediction.py`)
- Decision Tree → Prediction Runner: model handoff
