# shekhar-commit/soil_type_prediction architecture

> Architecture diagram of the GitHub repository shekhar-commit/soil_type_prediction, 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/shekhar-commit/soil_type_prediction
- Repository: https://github.com/shekhar-commit/soil_type_prediction

## Overview

This Flask application accepts soil and weather measurements, encodes soil texture, predicts a soil category, decodes that prediction, and displays the result. The user-facing form and result pages are separate templates; prediction logic and model loading are in app.py. The CSV dataset is present in the tree but is not referenced by the sampled application code, so it is not shown as part of the runtime workflow.

Main entry points: [`app.py`](https://github.com/shekhar-commit/soil_type_prediction/blob/master/app.py) (Flask app), [`templates/index.html`](https://github.com/shekhar-commit/soil_type_prediction/blob/master/templates/index.html) (Soil input form), [`templates/result.html`](https://github.com/shekhar-commit/soil_type_prediction/blob/master/templates/result.html) (Prediction result page), [`texture_encoder.pkl`](https://github.com/shekhar-commit/soil_type_prediction/blob/master/texture_encoder.pkl) (Texture encoder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_input["Soil input form<br/>[index.html]"]
  node_result["Prediction result page<br/>[result.html]"]
end

subgraph group_prediction["Prediction runtime"]
  node_app["Flask app<br/>[app.py]"]
  node_texture_encoder["Texture encoder"]
  node_model["Soil prediction model"]
  node_soil_encoder["Soil label encoder<br/>[soil_encoder.pkl]"]
end

node_user(("User"))

node_user -->|"submits measurements"| node_app
node_app -->|"renders form"| node_input
node_app -->|"encodes texture"| node_texture_encoder
node_app -->|"predicts soil"| node_model
node_app -->|"decodes label"| node_soil_encoder
node_app -->|"renders result"| node_result

click node_app "https://github.com/shekhar-commit/soil_type_prediction/blob/master/app.py"
click node_input "https://github.com/shekhar-commit/soil_type_prediction/blob/master/templates/index.html"
click node_texture_encoder "https://github.com/shekhar-commit/soil_type_prediction/blob/master/texture_encoder.pkl"
click node_model "https://github.com/shekhar-commit/soil_type_prediction/blob/master/soil_prediction_model.pkl"
click node_soil_encoder "https://github.com/shekhar-commit/soil_type_prediction/blob/master/soil_encoder.pkl"
click node_result "https://github.com/shekhar-commit/soil_type_prediction/blob/master/templates/result.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_input,node_result,node_user toneBlue
class node_app,node_texture_encoder,node_model,node_soil_encoder toneAmber
```

## Components

### Web interface

- [Soil input form](https://github.com/shekhar-commit/soil_type_prediction/blob/master/templates/index.html): `templates/index.html`
- [Prediction result page](https://github.com/shekhar-commit/soil_type_prediction/blob/master/templates/result.html): `templates/result.html`

### Prediction runtime

- [Flask app](https://github.com/shekhar-commit/soil_type_prediction/blob/master/app.py): `app.py`
- [Texture encoder](https://github.com/shekhar-commit/soil_type_prediction/blob/master/texture_encoder.pkl): `texture_encoder.pkl`
- [Soil prediction model](https://github.com/shekhar-commit/soil_type_prediction/blob/master/soil_prediction_model.pkl): `soil_prediction_model.pkl`
- [Soil label encoder](https://github.com/shekhar-commit/soil_type_prediction/blob/master/soil_encoder.pkl): `soil_encoder.pkl`

### Other components

- **User**

## Connections

- User → Flask app: submits measurements (evidence: `app.py`)
- Flask app → Soil input form: renders form (evidence: `app.py`)
- Flask app → Texture encoder: encodes texture (evidence: `app.py`)
- Flask app → Soil prediction model: predicts soil (evidence: `app.py`)
- Flask app → Soil label encoder: decodes label (evidence: `app.py`)
- Flask app → Prediction result page: renders result (evidence: `app.py`)
