# idoufkirkamal/exammanager architecture

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

- Interactive diagram: https://gitdiagram.com/idoufkirkamal/exammanager
- Repository: https://github.com/idoufkirkamal/exammanager

## Overview

##### Project type and purpose
- ExamManager is a full-stack web application built on CodeIgniter 4 (PHP 8.1+) with a MySQL backend.
- Purpose: provide professors and students with dashboards to manage/view grades, handle course enrollments, and submit/review grade reclamations.

##### File structure
Top-level directories:
- app/ – the MVC application code
- Config/ – framework & application configuration files (routing, services, security, caching, database, etc.)
- Controllers/ – HTTP controllers (CourseController, ProfessorController, StudentController, UserController, StudentCourseController)
- Models/ – data-access layers (CourseModel, UserModel, StudentModel, etc.)
- Views/ – HTML/PHP view templates (professor/, student/, login, register, errors)
- Database/ – migrations & seeders for schema & test data
- Filters/ – route filters (AuthFilter, RoleFilter, GuestFilter)
- Enums/, Helpers/, Libraries/ – domain enums, helper functions, custom libraries
- public/ – web-root static assets (CSS, JS, images) and entry point (index.php)
- writable/ – runtime files (cache, logs, sessions, uploads)
- tests/ – PHPUnit & CodeIgniter tests (unit, integration, database)
- composer.json / package.json – PHP & Node dependencies
- tailwind.config.js – Tailwind CSS setup

##### Key insights from the README
- Uses MVC architecture, session-based authentication, role-based access control, CSRF protection, input validation.
- Frontend: Tailwind CSS + vanilla JS + third-party UI libs (ApexCharts, FullCalendar, Pickr, etc.).
- Backend: CodeIgniter routing & services, PHPSpreadsheet for Excel import/export, MySQL database.
- Build tools: Composer for PHP, npm for CSS/JS.

##### Detail
- Don’t hesitate to break out subcomponents (e.g., separate the Router, Services container, Filter chain).
- Runtime folders (writable/) to show where sessions, logs, uploads reside.
- Deployment details: migrations in CI Spark, npm build pipelines.
- That the flow of authentication, database migrations, and Excel processing is explicit.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    subgraph "Client Layer" 
        direction TB
        Browser["Web Browser (Prof/Student UI)"]:::client
    end
    click Browser "https://github.com/idoufkirkamal/exammanager/blob/master/public/index.html"

    %% Static Assets Layer
    subgraph "CDN / Static Assets"
        direction TB
        StaticAssets["Static Assets<br/>(public/assets, CSS, JS, images)"]:::client
    end
    click StaticAssets "https://github.com/idoufkirkamal/exammanager/tree/master/public/assets/"

    %% Web Server & Front Controller
    subgraph "Web Server & Front Controller"
        direction TB
        WebServer["Apache/Nginx"]:::server
        HTAccess[".htaccess"]:::server
        Index["public/index.php"]:::server
        Spark["CLI Spark"]:::server
    end
    click HTAccess "https://github.com/idoufkirkamal/exammanager/blob/master/public/.htaccess"
    click Index "https://github.com/idoufkirkamal/exammanager/blob/master/public/index.php"
    click Spark "https://github.com/idoufkirkamal/exammanager/tree/master/spark"

    %% CodeIgniter Application Layer
    subgraph "CodeIgniter App"
        direction TB
        Config["Configuration Files"]:::app
        Routes["Routing (Routes.php)"]:::app
        FiltersConfig["Filters Config"]:::app
        AuthFilter["AuthFilter"]:::app
        RoleFilter["RoleFilter"]:::app
        GuestFilter["GuestFilter"]:::app
        ControllersGroup["Controllers"]:::app
        CourseCtrl["CourseController"]:::app
        ProfCtrl["ProfessorController"]:::app
        StudentCtrl["StudentController"]:::app
        StuCourseCtrl["StudentCourseController"]:::app
        UserCtrl["UserController"]:::app
        BaseCtrl["BaseController"]:::app
        Services["Services & Libraries"]:::app
        Libraries["Custom Libraries"]:::app
        ModelsGroup["Models"]:::app
        CourseModel["CourseModel"]:::app
        UserModel["UserModel"]:::app
        StudentModel["StudentModel"]:::app
        StuCourseModel["StudentCourseModel"]:::app
        RoleModel["RoleModel"]:::app
        Views["Views Templates"]:::app
        CSRFValidation["CSRF & Validation"]:::app
    end
    click Config "https://github.com/idoufkirkamal/exammanager/tree/master/app/Config/"
    click Routes "https://github.com/idoufkirkamal/exammanager/blob/master/app/Config/Routes.php"
    click FiltersConfig "https://github.com/idoufkirkamal/exammanager/blob/master/app/Config/Filters.php"
    click AuthFilter "https://github.com/idoufkirkamal/exammanager/blob/master/app/Filters/AuthFilter.php"
    click RoleFilter "https://github.com/idoufkirkamal/exammanager/blob/master/app/Filters/RoleFilter.php"
    click GuestFilter "https://github.com/idoufkirkamal/exammanager/blob/master/app/Filters/GuestFilter.php"
    click CourseCtrl "https://github.com/idoufkirkamal/exammanager/blob/master/app/Controllers/CourseController.php"
    click ProfCtrl "https://github.com/idoufkirkamal/exammanager/blob/master/app/Controllers/ProfessorController.php"
    click StudentCtrl "https://github.com/idoufkirkamal/exammanager/blob/master/app/Controllers/StudentController.php"
    click StuCourseCtrl "https://github.com/idoufkirkamal/exammanager/blob/master/app/Controllers/StudentCourseController.php"
    click UserCtrl "https://github.com/idoufkirkamal/exammanager/blob/master/app/Controllers/UserController.php"
    click BaseCtrl "https://github.com/idoufkirkamal/exammanager/blob/master/app/Controllers/BaseController.php"
    click Libraries "https://github.com/idoufkirkamal/exammanager/tree/master/app/Libraries/"
    click Services "https://github.com/idoufkirkamal/exammanager/blob/master/app/Config/Services.php"
    click CourseModel "https://github.com/idoufkirkamal/exammanager/blob/master/app/Models/CourseModel.php"
    click UserModel "https://github.com/idoufkirkamal/exammanager/blob/master/app/Models/UserModel.php"
    click StudentModel "https://github.com/idoufkirkamal/exammanager/blob/master/app/Models/StudentModel.php"
    click StuCourseModel "https://github.com/idoufkirkamal/exammanager/blob/master/app/Models/StudentCourseModel.php"
    click RoleModel "https://github.com/idoufkirkamal/exammanager/blob/master/app/Models/RoleModel.php"
    click Views "https://github.com/idoufkirkamal/exammanager/tree/master/app/Views/"
    click CSRFValidation "https://github.com/idoufkirkamal/exammanager/blob/master/app/Config/Validation.php"

    %% Data Layer
    subgraph "Data Layer & Storage"
        direction TB
        MySQLDB["MySQL Database"]:::data
        Migrations["Migrations"]:::data
        Seeders["Seeders"]:::data
        FileStorage["File Storage<br/>(uploads, logs, cache, sessions)"]:::data
    end
    click Migrations "https://github.com/idoufkirkamal/exammanager/tree/master/app/Database/Migrations/"
    click Seeders "https://github.com/idoufkirkamal/exammanager/tree/master/app/Database/Seeds/"
    click FileStorage "https://github.com/idoufkirkamal/exammanager/tree/master/writable/"

    %% External Services
    subgraph "External Services"
        direction TB
        PHPSpreadsheet["PHPSpreadsheet"]:::external
        EmailService["SMTP Email Service"]:::external
    end
    click EmailService "https://github.com/idoufkirkamal/exammanager/blob/master/app/Config/Email.php"

    %% Connections
    Browser -->|"HTTP Request"| WebServer
    Browser -->|"Load Static Assets"| StaticAssets
    WebServer --> Index
    WebServer --> HTAccess
    Index --> Spark
    Index --> Routes
    Routes --> AuthFilter
    Routes --> RoleFilter
    Routes --> GuestFilter
    AuthFilter --> ControllersGroup
    RoleFilter --> ControllersGroup
    GuestFilter --> ControllersGroup
    ControllersGroup --> CourseCtrl
    ControllersGroup --> ProfCtrl
    ControllersGroup --> StudentCtrl
    ControllersGroup --> StuCourseCtrl
    ControllersGroup --> UserCtrl
    ControllersGroup --> BaseCtrl
    CourseCtrl --> CourseModel
    ProfCtrl --> UserModel
    StudentCtrl --> StudentModel
    StuCourseCtrl --> StuCourseModel
    UserCtrl --> RoleModel
    CourseCtrl --> Views
    ProfCtrl --> Views
    StudentCtrl --> Views
    UserCtrl --> Views
    ControllersGroup --> CSRFValidation
    ControllersGroup --> Services
    Services --> Libraries
    Services --> PHPSpreadsheet
    ControllersGroup --> EmailService
    CourseCtrl --> MySQLDB
    CourseModel --> MySQLDB
    Migrations --> MySQLDB
    Seeders --> MySQLDB
    FileStorage --> ControllersGroup

    %% Styles
    classDef client fill:#D0E8FF,stroke:#0366D6,color:#000
    classDef server fill:#D5F5E3,stroke:#27AE60,color:#000
    classDef app fill:#FCF3CF,stroke:#F1C40F,color:#000
    classDef data fill:#E8DAEF,stroke:#8E44AD,color:#000
    classDef external fill:#ECECEC,stroke:#7F8C8D,color:#000
```
