# danish1092/student_performance_analyzer architecture

> Architecture diagram of the GitHub repository danish1092/student_performance_analyzer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/danish1092/student_performance_analyzer
- Repository: https://github.com/danish1092/student_performance_analyzer

## Overview

##### Project type and purpose
- This is a full-stack, monolithic web application (Student Performance Analyzer) built with Python/Flask.

##### File structure
- Top-level entry point:
- app.py – boots the Flask server and registers routes/controllers
- Business logic:
- analysis.py – handles batch performance analysis
- student_analysis.py – encapsulates per-student analytics
- attendance.py – attendance tracking and reporting
- utils.py – auxiliary functions (e.g., CSV parsing, data cleaning)
- Routing layer:
- routes/auth_routes.py – authentication (signup, signin) and role-based access control
- Presentation:
- templates/ – Jinja2 HTML templates for landing, dashboards, forms, reports
- static/ – CSS (teacher/style/student styles), images, JS assets
- Data handling:
- (Implicit) uploads/ – folder for teachers to upload CSVs
- Pandas in backend modules for data manipulation

##### Key insights from README
- Two user roles: Teacher and Student, each with their own dashboard and sets of pages.
- Features split into “Performance Analysis” and “Attendance Management.”
- Stack: Flask (HTTP server + templating), Pandas (computation), front-end uses HTML/CSS/JS.

##### Main components
a. Client tier
- Browser (Teacher UI, Student UI)
- Static assets (CSS/JS/images served via Flask’s static folder)
b. Web server tier (Flask monolith)
- app.py / Flask application instance
- Routing layer – endpoints in auth_routes and any routes defined in app.py
- Controllers – functions that call into business logic
- Business logic modules (analysis.py, student_analysis.py, attendance.py)
- Utility layer (utils.py for shared helpers)
c. Data tier
- File system “uploads/” for incoming CSV data
- In-memory/Pandas dataframes for processing
- (Optionally a future DB if extended)

##### Relationships and interactions
- Browser → HTTP GET/POST → Flask routes/auth endpoints
- Auth routes → (via utils.py) validate credentials → session management
- Teacher dashboard actions:
- Upload CSV → stored in uploads/ → attendance.py or analysis.py loads CSV via utils → Pandas processes → controllers render HTML or generate plots
- Student dashboard actions:
- Authenticated GET → controllers call student_analysis.py → return JSON or rendered HTML fragment
- Static asset requests → Flask static middleware → client

##### Architectural patterns and principles
- MVC-style separation:
- Model = Pandas/data structures in analysis modules
- View = Jinja templates + CSS/JS
- Controller = Flask route handlers
- Single process monolith; cohesion around education domain
- Role-based access control enforced at the controller layer
- Separation of concerns: routing, business logic, utilities, presentation

##### Technologies & frameworks to annotate
- Frontend: HTML5, CSS3 (teacher_style.css, student_style.css), optional JS
- Backend: Python 3.x, Flask (app.py, routes), Pandas (data analysis)
- Templating: Jinja2 (in /templates)
- File I/O: CSV uploads via Flask’s file upload API, stored in /uploads

##### Final recommendations
- Every Python module as a distinct element.
- Uploads folder as your data store.
- Rectangles for compute modules,
- Frameworks (Flask, Pandas) next to their respective modules.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Client Tier
    subgraph "Client Tier"
        direction TB
        Browser["Browser (Teacher UI / Student UI)"]:::client
        Browser -->|"HTTP GET/POST"| FlaskApp
        Browser -->|"Fetch Static Assets"| StaticAssets
    end

    %% Web Server Tier
    subgraph "Web Server Tier: Flask Application"
        direction TB
        FlaskApp["Flask App (app.py)"]:::server
        FlaskApp -->|"routes"| AuthRoutes
        FlaskApp -->|"routes"| AnalysisModule
        FlaskApp -->|"routes"| StudentAnalysisModule
        FlaskApp -->|"routes"| AttendanceModule
        FlaskApp -->|"uses"| UtilsModule
        FlaskApp -->|"renders"| Templates
        FlaskApp -->|"serves"| StaticAssets

        AuthRoutes["auth_routes.py"]:::server
        AnalysisModule["analysis.py"]:::server
        StudentAnalysisModule["student_analysis.py"]:::server
        AttendanceModule["attendance.py"]:::server
        UtilsModule["utils.py"]:::server
        Templates["templates/"]:::assets
        StaticAssets["static/"]:::assets
    end

    %% Data Tier
    subgraph "Data Tier"
        direction TB
        Uploads["uploads/"]:::data
        AnalysisModule -->|"read/write CSV"| Uploads
        AttendanceModule -->|"read/write CSV"| Uploads
        StudentAnalysisModule -->|"loads data"| Uploads
    end

    %% Styling
    classDef client fill:#AEDFF7,stroke:#0366d6,color:#03396c;
    classDef server fill:#C8E6C9,stroke:#2E7D32,color:#1B5E20;
    classDef assets fill:#FFF9C4,stroke:#FBC02D,color:#F57F17;
    classDef data fill:#E0E0E0,stroke:#757575,color:#424242;

    %% Click Events
    click FlaskApp "https://github.com/danish1092/student_performance_analyzer/blob/main/app.py"
    click AuthRoutes "https://github.com/danish1092/student_performance_analyzer/blob/main/routes/auth_routes.py"
    click AnalysisModule "https://github.com/danish1092/student_performance_analyzer/blob/main/analysis.py"
    click StudentAnalysisModule "https://github.com/danish1092/student_performance_analyzer/blob/main/student_analysis.py"
    click AttendanceModule "https://github.com/danish1092/student_performance_analyzer/blob/main/attendance.py"
    click UtilsModule "https://github.com/danish1092/student_performance_analyzer/blob/main/utils.py"
    click Templates "https://github.com/danish1092/student_performance_analyzer/tree/main/templates/"
    click StaticAssets "https://github.com/danish1092/student_performance_analyzer/tree/main/static/"
```
