# aamir-codes/student-productivity-score architecture

> Architecture diagram of the GitHub repository aamir-codes/student-productivity-score, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aamir-codes/student-productivity-score
- Repository: https://github.com/aamir-codes/student-productivity-score

## Overview

StudyIQ is a Flask web app that turns student-provided study and wellbeing data into a productivity score, category, and tailored tips. The principal workflow runs from the web form through input preparation and the bundled model to a JSON result; the app also reports derived indicators and feature importances. The README documents the frontend and prediction API, but the template source was not sampled, so frontend request details beyond that documented interface are not independently verified.

Main entry points: [`app.py`](https://github.com/aamir-codes/student-productivity-score/blob/main/app.py) (Flask routes), [`templates/index.html`](https://github.com/aamir-codes/student-productivity-score/blob/main/templates/index.html) (Input form), [`model_bundle.pkl`](https://github.com/aamir-codes/student-productivity-score/blob/main/model_bundle.pkl) (Feature scaler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web interface"]
  node_web_form["Input form<br/>[index.html]"]
end

subgraph group_prediction["Prediction workflow"]
  node_flask_app["Flask routes<br/>[app.py]"]
  node_feature_prep["Feature engineering<br/>[app.py]"]
  node_result_logic["Score and tips<br/>[app.py]"]
end

subgraph group_artifacts["Model artifact"]
  node_scaler["Feature scaler<br/>[model_bundle.pkl]"]
  node_regressor["Random forest<br/>[model_bundle.pkl]"]
  node_model_bundle["Model bundle<br/>[model_bundle.pkl]"]
end

node_student(("Student"))

node_student -->|"enters data"| node_web_form
node_web_form -->|"submits prediction"| node_flask_app
node_flask_app -->|"renders page"| node_web_form
node_flask_app -->|"loads bundle"| node_model_bundle
node_flask_app -->|"engineers features"| node_feature_prep
node_flask_app -->|"scales inputs"| node_scaler
node_flask_app -->|"predicts score"| node_regressor
node_flask_app -->|"classifies and advises"| node_result_logic
node_flask_app -->|"returns JSON result"| node_web_form

click node_web_form "https://github.com/aamir-codes/student-productivity-score/blob/main/templates/index.html"
click node_flask_app "https://github.com/aamir-codes/student-productivity-score/blob/main/app.py"
click node_feature_prep "https://github.com/aamir-codes/student-productivity-score/blob/main/app.py"
click node_scaler "https://github.com/aamir-codes/student-productivity-score/blob/main/model_bundle.pkl"
click node_regressor "https://github.com/aamir-codes/student-productivity-score/blob/main/model_bundle.pkl"
click node_result_logic "https://github.com/aamir-codes/student-productivity-score/blob/main/app.py"
click node_model_bundle "https://github.com/aamir-codes/student-productivity-score/blob/main/model_bundle.pkl"

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_form toneBlue
class node_flask_app,node_feature_prep,node_result_logic toneAmber
class node_scaler,node_regressor,node_model_bundle toneMint
class node_student toneIndigo
```

## Components

### Web interface

- [Input form](https://github.com/aamir-codes/student-productivity-score/blob/main/templates/index.html): `templates/index.html`

### Prediction workflow

- [Flask routes](https://github.com/aamir-codes/student-productivity-score/blob/main/app.py): `app.py`
- [Feature engineering](https://github.com/aamir-codes/student-productivity-score/blob/main/app.py): `app.py`
- [Score and tips](https://github.com/aamir-codes/student-productivity-score/blob/main/app.py): `app.py`

### Model artifact

- [Feature scaler](https://github.com/aamir-codes/student-productivity-score/blob/main/model_bundle.pkl): `model_bundle.pkl`
- [Random forest](https://github.com/aamir-codes/student-productivity-score/blob/main/model_bundle.pkl): `model_bundle.pkl`
- [Model bundle](https://github.com/aamir-codes/student-productivity-score/blob/main/model_bundle.pkl): `model_bundle.pkl`

### Other components

- **Student**

## Connections

- Student → Input form: enters data
- Input form → Flask routes: submits prediction
- Flask routes → Input form: renders page
- Flask routes → Model bundle: loads bundle
- Flask routes → Feature engineering: engineers features
- Flask routes → Feature scaler: scales inputs
- Flask routes → Random forest: predicts score
- Flask routes → Score and tips: classifies and advises
- Flask routes → Input form: returns JSON result
