# aarathi1535/edu-evaluator architecture

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

- Interactive diagram: https://gitdiagram.com/aarathi1535/edu-evaluator
- Repository: https://github.com/aarathi1535/edu-evaluator

## Overview

##### Main Components
- Web Client: Represents the user interface that students or administrators interact with via web browsers.
- Flask Application (Backend Server): Contains the core business logic and request routing (the app.py file). This part handles user sessions (using the flask_sessions directory), renders templates (from the templates folder), and serves static assets (from the static directory).
- Data Storage:
- Database: The instance directory holds the SQLite database (users.db) for user management and possibly other data.
- CSV File: The student_scores.csv file appears to be used for storing student evaluation results.
- Static & Template Assets: Includes HTML files (in the templates directory), CSS and JS files (in the static folder), and uploaded files (in static/uploads) such as sample PDFs.
- ML/AI Processing Module: Although not directly visible as a separate directory, the README indicates the integration of OCR, ML, and LLM components. This functionality is likely embedded within the Flask app or called as back‑end services. It’s essential to highlight this module as a separate processing unit that receives data (scanned handwritten answers) and outputs evaluation results.
- External Services (if applicable): If the OCR or language models require external API calls or cloud-based processing, include an “External AI/LLM Services” component.

##### Relationships & Interactions
- The Web Client sends HTTP requests to the Flask Server.
- The Flask Server responds by rendering HTML pages (login, register, index) via templates.
- Static assets (CSS, JS, images, PDF uploads) are served by the Flask static route.
- User session data and authentication details are managed via the flask_sessions directory and the SQLite database.
- When processing student answer sheets:
- The server receives uploaded files (from static/uploads).
- It invokes the integrated ML/AI module to process the OCR and run the ML/LLM algorithms.
- Evaluation results are saved (e.g., to student_scores.csv or the database) and then rendered for the user.
- Any configuration parameters (like credentials or API keys) are managed via the .env file.

##### Architectural Patterns & Technologies
- The separation between the frontend interface (templates and static assets) and the backend processing (app.py, session management, database interactions) reflects the classic full-stack architecture.
- The use of Flask suggests a Model-View-Controller (MVC)-like pattern where routes (controllers) handle requests, templates (views) render the UI, and data sources (models) like the SQLite database and CSV files store the data.
- Integration of AI components (OCR, ML, LLM) as a distinct processing module within the backend, possibly interacting with external services if needed.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        WC["Web Client (Browser)"]:::frontend
        T["Templates (HTML)"]:::frontend
        S["Static Files (CSS,JS,Images,Uploads)"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        FB["Flask Application (app.py)"]:::backend
        SM["Session Management (flask_sessions)"]:::backend
        MAI["ML/AI Processing Module (OCR,ML,LLM)"]:::backend
    end

    %% Data and External Configuration Layer
    subgraph "Data & Configuration Layer"
        DB["Database (SQLite: users.db)"]:::data
        CSV["CSV Data File (student_scores.csv)"]:::data
        EC["External Config (.env)"]:::data
        EAI["External AI/LLM Services"]:::external
    end

    %% Interactions
    WC -->|"HTTP Request/Response"| FB
    FB -->|"Manages sessions"| SM
    FB -->|"Renders"| T
    FB -->|"Serves"| S
    FB -->|"Processes answers"| MAI
    MAI -->|"Utilizes"| EAI
    FB -->|"Stores/Evaluates"| DB
    FB -->|"Stores/Evaluates"| CSV
    FB -->|"Loads Config"| EC
    MAI -->|"Returns Results"| FB
    FB -->|"Returns Evaluated Views"| WC

    %% Click Events
    click T "https://github.com/aarathi1535/edu-evaluator/tree/main/templates/"
    click S "https://github.com/aarathi1535/edu-evaluator/tree/main/static/"
    click FB "https://github.com/aarathi1535/edu-evaluator/blob/main/app.py"
    click SM "https://github.com/aarathi1535/edu-evaluator/tree/main/flask_sessions/"
    click DB "https://github.com/aarathi1535/edu-evaluator/blob/main/instance/users.db"
    click CSV "https://github.com/aarathi1535/edu-evaluator/blob/main/student_scores.csv"
    click MAI "https://github.com/aarathi1535/edu-evaluator/blob/main/app.py"
    click EC "https://github.com/aarathi1535/edu-evaluator/blob/main/.env"

    %% Styles
    classDef frontend fill:#C6E2FF,stroke:#000,stroke-width:2px;
    classDef backend fill:#FFDAB9,stroke:#000,stroke-width:2px;
    classDef data fill:#E6E6FA,stroke:#000,stroke-width:2px;
    classDef external fill:#F5DEB3,stroke:#000,stroke-width:2px;
```
