# sonuchoudhary717/spp architecture

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

## Overview

This is a Flask student-performance prediction and reporting application. Its primary workflow accepts student metrics, predicts and categorizes a score, stores the result, and renders it; separate routes provide searchable history, individual reports, dashboard summaries, and CSV export. Model training cleans the supplied dataset, compares regressors, evaluates the selected model, and saves it for inference. The excerpts show prediction, database queries, model training, and chart rendering; some route/template wiring and model loading details are unsampled.

Main entry points: [`app.py`](https://github.com/sonuchoudhary717/spp/blob/main/app.py) (Flask routes), [`templates`](https://github.com/sonuchoudhary717/spp/tree/main/templates) (Web templates), [`model.py`](https://github.com/sonuchoudhary717/spp/blob/main/model.py) (Model training), [`static/dashboard.js`](https://github.com/sonuchoudhary717/spp/blob/main/static/dashboard.js) (Dashboard chart)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_flask["Flask routes<br/>[app.py]"]
  node_prediction["Score prediction<br/>[app.py]"]
  node_history["History search<br/>[app.py]"]
  node_report["Student report<br/>[app.py]"]
  node_dashboard["Dashboard metrics<br/>[app.py]"]
  node_export["CSV export<br/>[app.py]"]
end

subgraph group_ml["Prediction model"]
  node_trainer["Model training<br/>[model.py]"]
end

subgraph group_ui["Browser interface"]
  node_pages["Web templates"]
  node_chart["Dashboard chart<br/>[dashboard.js]"]
  node_styles["Page styles<br/>[style.css]"]
end

node_user(("Staff user"))
node_mysql[("Predictions database")]
node_training_data["Training dataset<br/>[student_data.csv]"]
node_model_file["Trained model<br/>[model.pkl]"]
node_chartjs["Chart.js"]

node_user -->|"submits requests"| node_flask
node_flask -->|"routes prediction"| node_prediction
node_prediction -.->|"loads model"| node_model_file
node_prediction -->|"saves prediction"| node_mysql
node_prediction -->|"renders result"| node_pages
node_flask -->|"routes history"| node_history
node_history -->|"queries records"| node_mysql
node_history -.->|"renders history"| node_pages
node_flask -.->|"routes report"| node_report
node_report -->|"queries report data"| node_mysql
node_report -.->|"renders report"| node_pages
node_flask -.->|"routes dashboard"| node_dashboard
node_dashboard -->|"queries summaries"| node_mysql
node_dashboard -.->|"renders dashboard"| node_pages
node_flask -.->|"routes export"| node_export
node_export -->|"reads predictions"| node_mysql
node_trainer -->|"reads dataset"| node_training_data
node_trainer -->|"writes model"| node_model_file
node_pages -.->|"provides chart data"| node_chart
node_chart -->|"creates chart"| node_chartjs
node_user -.->|"views pages"| node_pages

click node_flask "https://github.com/sonuchoudhary717/spp/blob/main/app.py"
click node_prediction "https://github.com/sonuchoudhary717/spp/blob/main/app.py"
click node_history "https://github.com/sonuchoudhary717/spp/blob/main/app.py"
click node_report "https://github.com/sonuchoudhary717/spp/blob/main/app.py"
click node_dashboard "https://github.com/sonuchoudhary717/spp/blob/main/app.py"
click node_export "https://github.com/sonuchoudhary717/spp/blob/main/app.py"
click node_trainer "https://github.com/sonuchoudhary717/spp/blob/main/model.py"
click node_training_data "https://github.com/sonuchoudhary717/spp/blob/main/student_data.csv"
click node_model_file "https://github.com/sonuchoudhary717/spp/blob/main/model.pkl"
click node_pages "https://github.com/sonuchoudhary717/spp/tree/main/templates"
click node_chart "https://github.com/sonuchoudhary717/spp/blob/main/static/dashboard.js"
click node_styles "https://github.com/sonuchoudhary717/spp/blob/main/static/style.css"

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_prediction,node_history,node_report,node_dashboard,node_export,node_user toneBlue
class node_trainer,node_mysql toneAmber
class node_pages,node_chart,node_styles toneMint
class node_training_data toneTeal
class node_model_file,node_chartjs toneIndigo
```

## Components

### Web application

- [Flask routes](https://github.com/sonuchoudhary717/spp/blob/main/app.py): `app.py`
- [Score prediction](https://github.com/sonuchoudhary717/spp/blob/main/app.py): `app.py`
- [History search](https://github.com/sonuchoudhary717/spp/blob/main/app.py): `app.py`
- [Student report](https://github.com/sonuchoudhary717/spp/blob/main/app.py): `app.py`
- [Dashboard metrics](https://github.com/sonuchoudhary717/spp/blob/main/app.py): `app.py`
- [CSV export](https://github.com/sonuchoudhary717/spp/blob/main/app.py): `app.py`

### Prediction model

- [Model training](https://github.com/sonuchoudhary717/spp/blob/main/model.py): `model.py`

### Browser interface

- [Web templates](https://github.com/sonuchoudhary717/spp/tree/main/templates): `templates`
- [Dashboard chart](https://github.com/sonuchoudhary717/spp/blob/main/static/dashboard.js): `static/dashboard.js`
- [Page styles](https://github.com/sonuchoudhary717/spp/blob/main/static/style.css): `static/style.css`

### Other components

- **Staff user**
- **Predictions database**
- [Training dataset](https://github.com/sonuchoudhary717/spp/blob/main/student_data.csv): `student_data.csv`
- [Trained model](https://github.com/sonuchoudhary717/spp/blob/main/model.pkl): `model.pkl`
- **Chart.js**

## Connections

- Staff user → Flask routes: submits requests
- Flask routes → Score prediction: routes prediction (evidence: `app.py`)
- Score prediction → Trained model: loads model
- Score prediction → Predictions database: saves prediction (evidence: `app.py`)
- Score prediction → Web templates: renders result (evidence: `app.py`)
- Flask routes → History search: routes history (evidence: `app.py`)
- History search → Predictions database: queries records (evidence: `app.py`)
- History search → Web templates: renders history
- Flask routes → Student report: routes report (evidence: `app.py`)
- Student report → Predictions database: queries report data (evidence: `app.py`)
- Student report → Web templates: renders report
- Flask routes → Dashboard metrics: routes dashboard (evidence: `app.py`)
- Dashboard metrics → Predictions database: queries summaries (evidence: `app.py`)
- Dashboard metrics → Web templates: renders dashboard
- Flask routes → CSV export: routes export (evidence: `app.py`)
- CSV export → Predictions database: reads predictions (evidence: `app.py`)
- Model training → Training dataset: reads dataset (evidence: `model.py`)
- Model training → Trained model: writes model (evidence: `model.py`)
- Web templates → Dashboard chart: provides chart data
- Dashboard chart → Chart.js: creates chart (evidence: `static/dashboard.js`)
- Staff user → Web templates: views pages
