# uzair401/fyp_project_repo architecture

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

- Interactive diagram: https://gitdiagram.com/uzair401/fyp_project_repo
- Repository: https://github.com/uzair401/fyp_project_repo

## Overview

##### Project Type and Purpose
- The EMS is a full-stack web application built with Django (Python) on the backend and HTML/CSS/JavaScript (with AdminLTE 3) on the frontend.
- Its purpose is to manage various examination-related activities for educational institutions (colleges/universities), including student records, academic data, exam scheduling, results processing, and user/role management.

##### Analyzing the File Structure
- Core Project Configuration:
- The ERMS_System directory holds the main Django configuration files (settings.py, urls.py, wsgi.py, asgi.py). This is the backbone for managing system-wide settings, middleware, and URL routing.
- Modular Application Architecture:
- There are several Django apps: “students”, “academics”, “records”, and “core”. Each encapsulates a specific domain:
▪ The “students” app deals with student records.
▪ The “academics” app manages subjects, courses, and related academic entities.
▪ The “records” app is focused on exam records, results, and transcript generation.
▪ The “core” app contains shared functionalities, middleware, custom authentication backends, and management commands (e.g., to setup groups and permissions).
- Templates Directory:
- Global templates and subdirectories for each module (students, academics, records, etc.) indicate a view layer that leverages AdminLTE components to ensure a consistent styling across the application.
- Configuration and Scripts:
- Files like manage.py, build.sh, and requirements.txt support development, deployment, and dependency management.

a. Main Components:
- Frontend/UI Layer:
- HTML/CSS/JavaScript with AdminLTE theme for rendering views.
- Separate template groups for each module (students, academics, records) with shared components from the “templates/adminlte” folder.
- Backend Application Layer:
- Django Project (ERMS_System) coordinating settings, URL routing, and server configurations.
- Modular apps: “students”, “academics”, “records”, and “core”, each with their models, views, forms, migrations, and signals.
- Database Layer:
- Additional Components:
- Middleware (found in the “core/middleware” folder) for managing session timeouts and other web requests processing.
- Custom management commands (in “core/management/commands”) for setting up roles/permissions.

b. Relationships and Interactions:
- The browser (frontend) communicates with the Django server, which routes requests to the relevant app (students, academics, records) based on the URL patterns defined in ERMS_System/urls.py.
- Views in each app process the requests, interact with the models, perform business logic, and then render responses using the appropriate templates.
- The “core” app’s components, such as custom decorators, backends, and middleware, are used across these apps to provide common functionalities (authentication, session management, context processing).
- Data flows bi-directionally between views and the PostgreSQL database via Django’s ORM.

c. Architectural Patterns and Principles:
- Modular and Reusable Code Organization: Each Django app focuses on a distinct domain, promoting decoupling.
- Role-Based Access Control: Clearly mark that the system uses authentication, permissions, and custom middleware to enforce user roles.

d. Relevant Technologies and Frameworks:
- Backend: Django framework (with its settings, URL routing, ORM, and middleware).
- Frontend: HTML/CSS/JavaScript along with AdminLTE 3 for the UI.
- Database: PostgreSQL.
- Others: Python scripts (build.sh, management commands) and Django’s migration system.

##### Final Remarks
- Details such as the inclusion of authentication (user management via roles) and the interactivity between modules through shared templates and middleware.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Client Layer
    subgraph "Client Layer"
        Browser["Browser"]:::infrastructure
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        FRONTEND["Frontend/UI (AdminLTE Templates)"]:::frontend
        GLOBAL["Global Templates (Shared Views)"]:::frontend
    end

    %% Server Layer
    subgraph "Server Layer"
        WSGI["WSGI/ASGI (Server Gateway)"]:::infrastructure
        ERMS["ERMS_System (Django Config & URL Routing)"]:::config
        subgraph "Domain Apps"
            STUDENTS["Students App (Student Records Management)"]:::domain
            ACADEMICS["Academics App (Academic Entities Management)"]:::domain
            RECORDS["Records App (Exam Records & Results)"]:::domain
        end
        CORE["Core (Shared Functionality, Middleware & Management Commands)"]:::shared
    end

    %% Data Layer
    subgraph "Data Layer"
        DB["Database (PostgreSQL)"]:::database
    end

    %% Connections
    Browser -->|"HTTPRequest"| WSGI
    WSGI -->|"RoutesRequest"| ERMS
    ERMS -->|"DispatchesStudent"| STUDENTS
    ERMS -->|"DispatchesAcademic"| ACADEMICS
    ERMS -->|"DispatchesRecord"| RECORDS
    STUDENTS -->|"UsesCore"| CORE
    ACADEMICS -->|"UsesCore"| CORE
    RECORDS -->|"UsesCore"| CORE
    STUDENTS -->|"DBOps"| DB
    ACADEMICS -->|"DBOps"| DB
    RECORDS -->|"DBOps"| DB
    ERMS -->|"RendersWith"| FRONTEND
    FRONTEND -->|"Includes"| GLOBAL
    Browser -->|"LoadsUI"| FRONTEND

    %% Click Events
    click ERMS "https://github.com/uzair401/fyp_project_repo/blob/master/ERMS_System/settings.py"
    click STUDENTS "https://github.com/uzair401/fyp_project_repo/tree/master/students/"
    click ACADEMICS "https://github.com/uzair401/fyp_project_repo/tree/master/academics/"
    click RECORDS "https://github.com/uzair401/fyp_project_repo/tree/master/records/"
    click CORE "https://github.com/uzair401/fyp_project_repo/blob/master/core/middleware/session_timeout_middleware.py"
    click FRONTEND "https://github.com/uzair401/fyp_project_repo/tree/master/templates/adminlte/"
    click GLOBAL "https://github.com/uzair401/fyp_project_repo/tree/master/templates/"

    %% Styles
    classDef infrastructure fill:#ffcc00,stroke:#333,stroke-width:1px;
    classDef config fill:#66ccff,stroke:#333,stroke-width:1px;
    classDef domain fill:#ff9999,stroke:#333,stroke-width:1px;
    classDef shared fill:#ccffcc,stroke:#333,stroke-width:1px;
    classDef frontend fill:#ffddaa,stroke:#333,stroke-width:1px;
    classDef database fill:#ccccff,stroke:#333,stroke-width:1px;
```
