# jagadeeshwar634-coder/student-performance-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/jagadeeshwar634-coder/student-performance-prediction
- Repository: https://github.com/jagadeeshwar634-coder/student-performance-prediction

## Overview

This is a student-performance prediction web application. Students register or log in, submit five academic and lifestyle inputs, receive a predicted score with dashboard analysis and suggestions, and can revisit stored predictions through their profile. The main backend in `app.py` owns authentication, prediction, profile, and history routes; `database.py` supplies PostgreSQL sessions and `models.py` defines persisted records. The tree also contains `main.py`, a separate, simpler prediction API. Some frontend-to-template wiring and unsampled analytics behavior are documented but not verified in source excerpts.

Main entry points: [`app.py`](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/app.py) (Web routes), [`database.py`](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/database.py) (Database sessions), [`main.py`](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/main.py) (API inference), [`static/login.js`](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/static/login.js) (Login interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Student experience"]
  node_login_ui["Login interface<br/>[login.js]"]
  node_registration_ui["Registration interface<br/>[register.js]"]
  node_dashboard_ui["Prediction dashboard<br/>[work.js]"]
  node_profile_ui["Profile interface<br/>[profile.js]"]
  node_page_templates["Web pages"]
end

subgraph group_service["Application service"]
  node_web_backend["Web routes<br/>[app.py]"]
  node_profile_history["Profile and history<br/>[app.py]"]
  node_standalone_api["Standalone API<br/>[main.py]"]
end

subgraph group_prediction["Prediction"]
  node_model_inference["Model inference<br/>[app.py]"]
  node_alternate_inference["API inference<br/>[main.py]"]
  node_model_artifact["Trained model"]
  node_scaler_artifact["Feature scaler"]
end

subgraph group_persistence["Persistence"]
  node_db_sessions["Database sessions<br/>[database.py]"]
  node_data_models["User and predictions<br/>[models.py]"]
end

node_student(("Student"))
node_postgres[("PostgreSQL")]

node_student -->|"uses"| node_login_ui
node_student -->|"registers"| node_registration_ui
node_student -->|"enters inputs"| node_dashboard_ui
node_student -->|"views history"| node_profile_ui
node_web_backend -->|"renders pages"| node_page_templates
node_login_ui -->|"posts login"| node_web_backend
node_registration_ui -->|"posts registration"| node_web_backend
node_dashboard_ui -->|"requests prediction"| node_web_backend
node_web_backend -->|"predicts score"| node_model_inference
node_model_inference -.->|"uses model"| node_model_artifact
node_model_inference -.->|"scales features"| node_scaler_artifact
node_web_backend -->|"routes profile/history"| node_profile_history
node_profile_history -->|"queries and updates"| node_db_sessions
node_web_backend -->|"opens sessions"| node_db_sessions
node_db_sessions -->|"provides base"| node_data_models
node_data_models -.->|"defines persisted records"| node_postgres
node_db_sessions -->|"connects"| node_postgres
node_standalone_api -->|"handles prediction"| node_alternate_inference
node_alternate_inference -->|"loads model"| node_model_artifact
node_alternate_inference -->|"loads scaler"| node_scaler_artifact

click node_login_ui "https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/static/login.js"
click node_registration_ui "https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/static/register.js"
click node_dashboard_ui "https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/static/work.js"
click node_profile_ui "https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/static/profile.js"
click node_page_templates "https://github.com/jagadeeshwar634-coder/student-performance-prediction/tree/main/templates"
click node_web_backend "https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/app.py"
click node_profile_history "https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/app.py"
click node_standalone_api "https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/main.py"
click node_model_inference "https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/app.py"
click node_alternate_inference "https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/main.py"
click node_model_artifact "https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/student_performance_model.pkl"
click node_scaler_artifact "https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/student_performance_scaler.pkl"
click node_db_sessions "https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/database.py"
click node_data_models "https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/models.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_login_ui,node_registration_ui,node_dashboard_ui,node_profile_ui,node_page_templates toneBlue
class node_web_backend,node_profile_history,node_standalone_api,node_postgres toneAmber
class node_model_inference,node_alternate_inference,node_model_artifact,node_scaler_artifact toneMint
class node_db_sessions,node_data_models toneRose
class node_student toneIndigo
```

## Components

### Student experience

- [Login interface](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/static/login.js): `static/login.js`
- [Registration interface](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/static/register.js): `static/register.js`
- [Prediction dashboard](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/static/work.js): `static/work.js`
- [Profile interface](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/static/profile.js): `static/profile.js`
- [Web pages](https://github.com/jagadeeshwar634-coder/student-performance-prediction/tree/main/templates): `templates`

### Application service

- [Web routes](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/app.py): `app.py`
- [Profile and history](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/app.py): `app.py`
- [Standalone API](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/main.py): `main.py`

### Prediction

- [Model inference](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/app.py): `app.py`
- [API inference](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/main.py): `main.py`
- [Trained model](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/student_performance_model.pkl): `student_performance_model.pkl`
- [Feature scaler](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/student_performance_scaler.pkl): `student_performance_scaler.pkl`

### Persistence

- [Database sessions](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/database.py): `database.py`
- [User and predictions](https://github.com/jagadeeshwar634-coder/student-performance-prediction/blob/main/models.py): `models.py`

### Other components

- **Student**
- **PostgreSQL**

## Connections

- Student → Login interface: uses (evidence: `README.md`)
- Student → Registration interface: registers (evidence: `README.md`)
- Student → Prediction dashboard: enters inputs (evidence: `README.md`)
- Student → Profile interface: views history (evidence: `README.md`)
- Web routes → Web pages: renders pages (evidence: `app.py`)
- Login interface → Web routes: posts login (evidence: `static/login.js`)
- Registration interface → Web routes: posts registration (evidence: `static/register.js`)
- Prediction dashboard → Web routes: requests prediction (evidence: `static/work.js`)
- Web routes → Model inference: predicts score (evidence: `README.md`)
- Model inference → Trained model: uses model
- Model inference → Feature scaler: scales features
- Web routes → Profile and history: routes profile/history (evidence: `app.py`)
- Profile and history → Database sessions: queries and updates (evidence: `app.py`)
- Web routes → Database sessions: opens sessions (evidence: `app.py`)
- Database sessions → User and predictions: provides base (evidence: `models.py`)
- User and predictions → PostgreSQL: defines persisted records
- Database sessions → PostgreSQL: connects (evidence: `database.py`)
- Standalone API → API inference: handles prediction (evidence: `main.py`)
- API inference → Trained model: loads model (evidence: `main.py`)
- API inference → Feature scaler: loads scaler (evidence: `main.py`)
