# gopiashokan/educational-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/gopiashokan/educational-management-system
- Repository: https://github.com/gopiashokan/educational-management-system

## Overview

##### Main Components
- User Interface (Frontend):
- Built using Streamlit (see app.py and files in the .streamlit folder).
- Handles user interactions such as logging in, test submissions, and exam processing.
- Backend / Application Logic:
- Contains the main application code (app.py) that orchestrates business logic for user management, test/exam processing, and role-based functionalities.
- Implements functionalities like adding/updating users, role management, and test creation.
- Deep Learning Engine:
- Incorporates a trained Convolutional Neural Network (CNN) model (Model/trained_model.h5) using TensorFlow and Keras.
- Supports handwriting verification, which is a critical feature for validating exam answer sheets.
- Database and Data Storage:
- Utilizes PostgreSQL (as mentioned in the README via psycopg2) for managing persistent data like user information, test grades, and other administrative records.
- Contains Dataset directories that store images (for user and test data) and CSV/XLSX files (for login credentials and test questions/answers).

##### File Structure and Relationships
- The root directory holds key configuration files (.env, requirements.txt) that define the execution environment.
- The Dataset directory is organized with subfolders for test images, login credentials, and test questions. It supports both training (images for handwriting recognition) and operational data.
- The Model directory is specifically for the stored and trained CNN model.
- The primary script (app.py) serves as the entry point for the Streamlit application, integrating frontend components, backend logic, and model inference.

##### Recognize Architectural Patterns and Technologies
- MVC (or similar separation of concerns) where the UI (Streamlit frontend) is separated from the core logic (Python backend) and the Machine Learning model.
- The deep learning integration leverages a CNN architecture for handwriting verification tasks.
- Several libraries (TensorFlow, Keras, OpenCV, Pandas, Scikit-learn) indicate that image processing and data analysis are central to the system’s functionalities.
- Environmental configurations via .env and setup scripts (requirements.txt) ensure the system is properly configured for deployment.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        UI1["app.py (Streamlit Frontend)"]:::frontend
        UI2[".streamlit (Config)"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        BE["Backend Logic (app.py)"]:::backend
    end

    %% Deep Learning Module
    subgraph "Deep Learning Module"
        DL["Handwriting Verification (CNN)"]:::deeplearning
    end

    %% Database and Data Storage
    subgraph "Database/Data Storage"
        DB["PostgreSQL DB"]:::database
        DS["File-based Data (Dataset)"]:::database
        subgraph "Dataset Files"
            DS1["login_credentials.csv"]:::file
            DS2["login_credentials.xlsx"]:::file
            DS3["test_qa.csv"]:::file
            DS4["test_qa.xlsx"]:::file
            DS5["images (folder)"]:::folder
            DS6["Test_unknown (folder)"]:::folder
        end
    end

    %% Connections
    UI1 -->|"user_input"| BE
    UI2 -->|"config"| BE
    BE -->|"process_request"| DL
    DL -->|"verification_result"| BE
    BE -->|"store_data"| DB
    BE -->|"read_write"| DS
    DS --- DS1
    DS --- DS2
    DS --- DS3
    DS --- DS4
    DS --- DS5
    DS --- DS6

    %% Click Events
    click UI1 "https://github.com/gopiashokan/educational-management-system/blob/main/app.py"
    click UI2 "https://github.com/gopiashokan/educational-management-system/blob/main/.streamlit/config.toml"
    click BE "https://github.com/gopiashokan/educational-management-system/blob/main/app.py"
    click DL "https://github.com/gopiashokan/educational-management-system/blob/main/Model/trained_model.h5"
    click DS "https://github.com/gopiashokan/educational-management-system/tree/main/Dataset"
    click DS1 "https://github.com/gopiashokan/educational-management-system/blob/main/Dataset/login_credentials.csv"
    click DS2 "https://github.com/gopiashokan/educational-management-system/blob/main/Dataset/login_credentials.xlsx"
    click DS3 "https://github.com/gopiashokan/educational-management-system/blob/main/Dataset/test_qa.csv"
    click DS4 "https://github.com/gopiashokan/educational-management-system/blob/main/Dataset/test_qa.xlsx"
    click DS5 "https://github.com/gopiashokan/educational-management-system/tree/main/Dataset/images"
    click DS6 "https://github.com/gopiashokan/educational-management-system/tree/main/Dataset/Test_unknown"

    %% Styles
    classDef frontend fill:#f9e79f,stroke:#af601a,stroke-width:2px
    classDef backend fill:#aed6f1,stroke:#2471a3,stroke-width:2px
    classDef deeplearning fill:#a9dfbf,stroke:#1e8449,stroke-width:2px
    classDef database fill:#f9e79f,stroke:#d4ac0d,stroke-width:2px
    classDef file fill:#d5f5e3,stroke:#27ae60,stroke-width:1px
    classDef folder fill:#d4e6f1,stroke:#2980b9,stroke-width:1px
```
