# tejasweesahu/grade-insight-project architecture

> Architecture diagram of the GitHub repository tejasweesahu/grade-insight-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tejasweesahu/grade-insight-project
- Repository: https://github.com/tejasweesahu/grade-insight-project

## Overview

##### Project type and purpose
- This is a small full-stack web application with an ML component.
- Purpose: Let students input study-related factors and get targeted advice/predicted performance using a pre-trained regression model.

##### File structure
- Top-level
- README.md & docs/ – documentation, no runtime impact
- frontend/ – static UI assets and build config (HTML, CSS, Tailwind, package.json)
- model/ – training artifacts and runtime API
- frontend/
- index.html + CSS (tailwind.css) = user interface
- package.json, postcss.config.js, tailwind.config.js = build & dev server
- model/
- ModelTraining.ipynb + StudentPerformanceFactors.csv = offline training pipeline
- linear_regression_model.pkl = serialized model for inference
- model_api/api.py + requirements.txt = lightweight Python service exposing the model via HTTP

##### README for additional insights
- No database is mentioned – predictions come directly from the serialized model
- Use cases link back to docs, but runtime is simply model inference, no persistent storage

a. Main components
1. Client Browser (UI)
2. Static Web Server (serves frontend assets)
3. Model API Service (Flask/FastAPI in api.py)
4. Serialized Model Store (linear_regression_model.pkl)
5. Offline Training Pipeline (Jupyter notebook + CSV) – optional for runtime
b. Relationships & interactions
- User → Browser → (HTTP) → Static Web Server → serves index.html & JS
- Browser UI → (XHR/Fetch) → Model API Service → loads .pkl → returns JSON prediction
c. Architectural patterns / design principles
- Separation of concerns: UI and model inference are decoupled
- Stateless backend: no session or DB, purely functional inference
- Offline training pipeline separated from runtime service
d. Key technologies
- Frontend: HTML, Tailwind CSS, PostCSS, npm
- Backend: Python (Flask or similar), scikit-learn
- Model store: Pickle file

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global entity
    Browser["Client Browser (UI)"]:::frontend

    subgraph "Frontend Layer"
        direction TB
        Static["Static Web Server"]:::frontend
        Index["index.html"]:::frontend
        Assets["assets/"]:::frontend
        Package["package.json"]:::frontend
        PostCSS["postcss.config.js"]:::frontend
        Tailwind["tailwind.config.js"]:::frontend
    end

    subgraph "Backend/API Layer"
        direction TB
        API["Model API Service"]:::backend
        APIfile["api.py"]:::backend
        Req["requirements.txt"]:::backend
    end

    Serialized["linear_regression_model.pkl"]:::ml

    subgraph "Offline Training Pipeline"
        direction TB
        Notebook["ModelTraining.ipynb"]:::pipeline
        CSV["StudentPerformanceFactors.csv"]:::pipeline
    end

    %% Connections
    Browser -->|"GET assets"| Static
    Static --> Index
    Static --> Assets
    Static --> Package
    Static --> PostCSS
    Static --> Tailwind
    Browser -->|"POST input"| API
    API -->|"load .pkl"| Serialized
    API -->|"JSON response"| Browser
    Notebook --> Serialized
    CSV --> Serialized

    %% Click Events
    click Index "https://github.com/tejasweesahu/grade-insight-project/blob/main/frontend/index.html"
    click Assets "https://github.com/tejasweesahu/grade-insight-project/tree/main/frontend/assets/"
    click Package "https://github.com/tejasweesahu/grade-insight-project/blob/main/frontend/package.json"
    click PostCSS "https://github.com/tejasweesahu/grade-insight-project/blob/main/frontend/postcss.config.js"
    click Tailwind "https://github.com/tejasweesahu/grade-insight-project/blob/main/frontend/tailwind.config.js"
    click APIfile "https://github.com/tejasweesahu/grade-insight-project/blob/main/model/model_api/api.py"
    click Req "https://github.com/tejasweesahu/grade-insight-project/blob/main/model/requirements.txt"
    click Serialized "https://github.com/tejasweesahu/grade-insight-project/blob/main/model/linear_regression_model.pkl"
    click Notebook "https://github.com/tejasweesahu/grade-insight-project/blob/main/model/ModelTraining.ipynb"
    click CSV "https://github.com/tejasweesahu/grade-insight-project/blob/main/model/StudentPerformanceFactors.csv"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef backend fill:#98FB98,stroke:#000,stroke-width:1px
    classDef ml fill:#FFA500,stroke:#000,stroke-width:1px
    classDef pipeline fill:#FFD700,stroke:#000,stroke-width:1px

    class Browser,Static,Index,Assets,Package,PostCSS,Tailwind frontend
    class API,APIfile,Req backend
    class Serialized ml
    class Notebook,CSV pipeline
```
