# abdallahahmed0/examination-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/abdallahahmed0/examination-management-system
- Repository: https://github.com/abdallahahmed0/examination-management-system

## Overview

##### Main Components

A. Frontend Layer (Angular Application):
- Core Modules:
- Authentication Module (login/)
- Dashboard Module (dashboard/)
- Admin Management Module (admins/)
- Course Management Module (course/)
- Exam Management Module (exam/)
- Student Management Module (students/)
- Question Management Module (question/)
- Roles Management Module (roles/)

B. Security Layer:
- Guards (AuthLogin.guard, auth.guard, role.guard)
- JWT Interceptor (jwt.interceptor.ts)
- Role-based Access Control

C. Shared Services Layer:
- Course Shared Service
- Authentication Service
- Storage Service

D. External Integrations:
- Froala Editor (for WYSIWYG editing)
- Monaco Editor (for code questions)
- Angular Material Components

**┌─────────────────────────────────────────────────────────────┐**
- Client Browser                           │
- ┘
- ↕
**┌─────────────────────────────────────────────────────────────┐**
- Angular Frontend                         │
- ┬─────────────────┬────────────────────────┤
- Core Modules   │ Shared Services │    Security Layer      │
- Auth         │ - Course        │  - Guards              │
- Dashboard    │ - Storage       │  - JWT Interceptor     │
- Admin        │ - Auth          │  - RBAC               │
- Course       │                 │                        │
- Exam         │                 │                        │
- Student      │                 │                        │
- Question     │                 │                        │
- Roles        │                 │                        │
- ┴─────────────────┴────────────────────────┘
- ↕
**┌─────────────────────────────────────────────────────────────┐**
- External Integrations                        │
- Froala Editor  |  Monaco Editor  |  Material UI    │
- ┘

##### Important Elements to Highlight

A. Module Dependencies:
- How modules interact with shared services
- Guard protection on routes
- Interceptor interaction points

B. Data Flow:
- Authentication flow
- Exam creation and attempt flow
- Question management flow

C. Security Boundaries:
- Role-based access points
- JWT token flow
- Guard checkpoints

##### Implementation Details

- Use standard UML notation where applicable
- Version information and date
- A brief technical stack summary

##### Special Focus Areas

- Exam Module Workflow:
- Question creation
- Exam assembly
- Exam attempt process
- Result calculation

- Authentication Flow:
- Login process
- Token management
- Role verification

Remember to include a separate detailed view of the exam module, as it appears to be the core functionality of the system based on the file structure and README content.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client["Client Browser"]
        Browser["Web Browser"]:::client
    end

    subgraph Frontend["Angular Frontend"]
        subgraph CoreModules["Core Modules"]
            Auth["Authentication Module"]:::module
            Dashboard["Dashboard Module"]:::module
            AdminMgmt["Admin Management"]:::module
            CourseMgmt["Course Management"]:::module
            ExamMgmt["Exam Management"]:::module
            StudentMgmt["Student Management"]:::module
            QuestionMgmt["Question Management"]:::module
            RolesMgmt["Roles Management"]:::module
        end

        subgraph SecurityLayer["Security Layer"]
            Guards["Auth Guards"]:::security
            JWTInt["JWT Interceptor"]:::security
            RoleGuard["Role Guard"]:::security
            ExamGuards["Exam Guards"]:::security
        end

        subgraph SharedServices["Shared Services"]
            AuthService["Auth Service"]:::service
            StorageService["Storage Service"]:::service
            CourseService["Course Shared Service"]:::service
        end

        subgraph DialogComponents["Dialog Components"]
            CustomDialog["Custom Dialog"]:::ui
            ExamDialogs["Exam Dialogs"]:::ui
        end
    end

    subgraph External["External Integrations"]
        Froala["Froala Editor"]:::external
        Monaco["Monaco Editor"]:::external
        Material["Material UI"]:::external
    end

    Browser --> Auth
    Auth --> Guards
    Auth --> JWTInt
    Auth --> AuthService
    AuthService --> StorageService

    Dashboard --> Guards
    AdminMgmt --> Guards
    CourseMgmt --> Guards
    ExamMgmt --> Guards
    StudentMgmt --> Guards
    QuestionMgmt --> Guards
    RolesMgmt --> Guards

    ExamMgmt --> ExamGuards
    ExamMgmt --> ExamDialogs
    ExamMgmt --> Froala
    ExamMgmt --> Monaco

    QuestionMgmt --> Froala
    QuestionMgmt --> Monaco

    CoreModules --> Material
    DialogComponents --> Material

    %% Click events for component mapping
    click Auth "https://github.com/AbdallahAhmed0/Examination-Management-System/tree/main/src/app/login"
    click JWTInt "https://github.com/AbdallahAhmed0/Examination-Management-System/blob/main/src/app/login/Interceptors/jwt.interceptor.ts"
    click AuthService "https://github.com/AbdallahAhmed0/Examination-Management-System/blob/main/src/app/login/Services/auth.service.ts"
    click StorageService "https://github.com/AbdallahAhmed0/Examination-Management-System/blob/main/src/app/login/Services/storage.service.ts"
    click Guards "https://github.com/AbdallahAhmed0/Examination-Management-System/tree/main/src/app/Shared/Guards/"
    click RoleGuard "https://github.com/AbdallahAhmed0/Examination-Management-System/blob/main/src/app/roles/role.guard.ts"
    click ExamGuards "https://github.com/AbdallahAhmed0/Examination-Management-System/tree/main/src/app/exam/guards/"
    click Dashboard "https://github.com/AbdallahAhmed0/Examination-Management-System/tree/main/src/app/dashboard"
    click AdminMgmt "https://github.com/AbdallahAhmed0/Examination-Management-System/tree/main/src/app/admins"
    click CourseMgmt "https://github.com/AbdallahAhmed0/Examination-Management-System/tree/main/src/app/course"
    click ExamMgmt "https://github.com/AbdallahAhmed0/Examination-Management-System/tree/main/src/app/exam"
    click StudentMgmt "https://github.com/AbdallahAhmed0/Examination-Management-System/tree/main/src/app/students"
    click QuestionMgmt "https://github.com/AbdallahAhmed0/Examination-Management-System/tree/main/src/app/question"
    click RolesMgmt "https://github.com/AbdallahAhmed0/Examination-Management-System/tree/main/src/app/roles"
    click CourseService "https://github.com/AbdallahAhmed0/Examination-Management-System/blob/main/src/app/Shared/course-shared-service.service.ts"
    click Material "https://github.com/AbdallahAhmed0/Examination-Management-System/tree/main/src/app/Shared/material/"
    click CustomDialog "https://github.com/AbdallahAhmed0/Examination-Management-System/tree/main/src/app/Shared/material/custom-dialoge"
    click ExamDialogs "https://github.com/AbdallahAhmed0/Examination-Management-System/tree/main/src/app/Shared/material/start-exam-dialoge"

    classDef client fill:#f9f,stroke:#333,stroke-width:2px
    classDef module fill:#bbf,stroke:#333,stroke-width:1px
    classDef security fill:#bfb,stroke:#333,stroke-width:1px
    classDef service fill:#fb8,stroke:#333,stroke-width:1px
    classDef external fill:#e7d,stroke:#333,stroke-width:1px
    classDef ui fill:#ddd,stroke:#333,stroke-width:1px

    %% Legend
    subgraph Legend
        L1["Client"]:::client
        L2["Module"]:::module
        L3["Security"]:::security
        L4["Service"]:::service
        L5["External"]:::external
        L6["UI Component"]:::ui
    end
```
