# votuanhuy2910/quanly-ueh architecture

> Architecture diagram of the GitHub repository votuanhuy2910/quanly-ueh, 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/votuanhuy2910/quanly-ueh
- Repository: https://github.com/votuanhuy2910/quanly-ueh

## Overview

##### Main Components
- Modules/Roles: There are three primary modules as indicated by the directories "Student", "Teacher", and "admin". Each module appears to manage its own set of pages, requests (req), includes (inc), and data files.
- Common Components: The root directory contains general files such as DB_connection.php, index.php, login.php, logout.php, and shared resources (CSS, JS, images). There are also SQL dump files (sms_db.sql and ueh_qlhs.sql) indicating the backend database.
- Frontend Resources: The css, js, and img directories indicate static assets responsible for the UI, while the .vscode folder is noted for development settings.
- Database: The presence of multiple SQL files and PHP files such as DB_connection.php and setting.php files in various subdirectories imply a central database (likely MySQL) serving all modules.

##### Component Relationships
- The “Student”, “Teacher”, and “admin” modules all interact with the central database via DB_connection.php and other data management files.
- Each module has its own “inc” (for common UI elements like headers and navigation bars), “req” (handling request-related logic), and “data” (acting as controllers or data processors that agglomerate business logic).
- There is shared functionality for login and logout, suggesting a common user authentication system that might funnel different user types (students, teachers, administrators) into their respective dashboards.
- The UI is structured and separated by role-specific directories but visually unified by shared CSS, JavaScript, and included header/footer PHP scripts.

##### Architectural Patterns and Design Principles
- Modularity: The system is divided into clear modules by user role, each with further subdivisions (data, inc, req), promoting separation of concerns.
- MVC-Like Structure: Although not strictly adhering to MVC, the separation between UI components (under inc), business logic (data and req), and database interactions suggests an imitation of MVC concepts.
- Centralized Database Access: DB_connection.php indicates a centralized database connection used across different modules, and the presence of SQL data dumps shows a clear data backend.
- Role-Based Access: Different directories for each role hint at role-based page rendering and access control.

##### Relevant Technologies, Frameworks, or Libraries
- PHP: The primary language used, based on file extensions and directory structure.
- SQL/MySQL: Likely used for database operations, as inferred from the SQL dump files.
- Frontend Assets: Standard CSS and JavaScript files support the client-side presentation.
- Potential use of modular design conventions (even if not using a full framework, files and directories are organized logically by feature/role).

##### Elements
- Clear labels: Name each major component (e.g., Student Module, Teacher Module, Admin Module, Shared UI Components, Database).
- User Authentication Flow: Login page → Authentication handler → Routing to appropriate module.
- Request Flow: UI (via forms/requests) → PHP request handlers in the “req” folders → Data processing → Database interactions.
- Another for backend processing components (PHP scripts in data and req).
- A third style for integral components such as the database.
- Annotations: Optionally include notes on role-based access, shared components, and potential middleware (if authentication/authorization is abstracted) that manage data routing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Top Level: User Browser
    User["User Browser"]:::static

    %% Authentication & Global Components
    subgraph "Authentication & Global Components"
        index["index.php"]:::auth
        login["login.php"]:::auth
        logout["logout.php"]:::auth
        dbconn["DB_connection.php"]:::auth
        sharedNavbar["Shared Navbar (inc)"]:::auth
        css["CSS Assets"]:::static
        js["JS Assets"]:::static
        img["Image Assets"]:::static
        vscode[".vscode Settings"]:::static
    end

    %% Student Module
    subgraph "Student Module"
        studentInc["UI Elements (inc)"]:::module
        studentReq["Request Handling (req)"]:::module
        studentData["Business Logic/Data (data)"]:::module
    end

    %% Teacher Module
    subgraph "Teacher Module"
        teacherInc["UI Elements (inc)"]:::module
        teacherReq["Request Handling (req)"]:::module
        teacherData["Business Logic/Data (data)"]:::module
    end

    %% Admin Module
    subgraph "Admin Module"
        adminInc["UI Elements (inc)"]:::module
        adminReq["Request Handling (req)"]:::module
        adminData["Business Logic/Data (data)"]:::module
    end

    %% Database and SQL Dumps
    database["Database (MySQL)"]:::db
    sql1["sms_db.sql Dump"]:::db
    sql2["ueh_qlhs.sql Dump"]:::db

    %% Connections from Browser to Global Components
    User --> login
    User --> index

    %% From Global Components to Module UI Elements
    login --> studentInc
    login --> teacherInc
    login --> adminInc
    sharedNavbar --> studentInc
    sharedNavbar --> teacherInc
    sharedNavbar --> adminInc

    %% Module internal flow: UI -> Request -> Business Logic
    studentInc --> studentReq
    studentReq --> studentData
    teacherInc --> teacherReq
    teacherReq --> teacherData
    adminInc --> adminReq
    adminReq --> adminData

    %% Global DB connection influences business logic layers
    dbconn --- studentData
    dbconn --- teacherData
    dbconn --- adminData

    %% Business logic interacts with central Database
    studentData --> database
    teacherData --> database
    adminData --> database

    %% SQL dumps connect to Database
    sql1 --- database
    sql2 --- database

    %% Styles
    classDef auth fill:#cce5ff,stroke:#0056b3,stroke-width:2px;
    classDef module fill:#d4edda,stroke:#28a745,stroke-width:2px;
    classDef db fill:#fff3cd,stroke:#ffc107,stroke-width:2px;
    classDef static fill:#f8d7da,stroke:#dc3545,stroke-width:2px;

    %% Click Events for Shared Components
    click index "https://github.com/votuanhuy2910/quanly-ueh/blob/main/student-information-system-new/index.php"
    click login "https://github.com/votuanhuy2910/quanly-ueh/blob/main/student-information-system-new/login.php"
    click logout "https://github.com/votuanhuy2910/quanly-ueh/blob/main/student-information-system-new/logout.php"
    click dbconn "https://github.com/votuanhuy2910/quanly-ueh/blob/main/student-information-system-new/DB_connection.php"
    click sharedNavbar "https://github.com/votuanhuy2910/quanly-ueh/blob/main/student-information-system-new/inc/navbar.php"
    click css "https://github.com/votuanhuy2910/quanly-ueh/tree/main/student-information-system-new/css"
    click js "https://github.com/votuanhuy2910/quanly-ueh/tree/main/student-information-system-new/js"
    click img "https://github.com/votuanhuy2910/quanly-ueh/tree/main/student-information-system-new/img"
    click vscode "https://github.com/votuanhuy2910/quanly-ueh/blob/main/student-information-system-new/.vscode"

    %% Click Events for Student Module
    click studentData "https://github.com/votuanhuy2910/quanly-ueh/tree/main/student-information-system-new/Student/data"
    click studentReq "https://github.com/votuanhuy2910/quanly-ueh/tree/main/student-information-system-new/Student/req"
    click studentInc "https://github.com/votuanhuy2910/quanly-ueh/tree/main/student-information-system-new/Student/inc"

    %% Click Events for Teacher Module
    click teacherData "https://github.com/votuanhuy2910/quanly-ueh/tree/main/student-information-system-new/Teacher/data"
    click teacherReq "https://github.com/votuanhuy2910/quanly-ueh/tree/main/student-information-system-new/Teacher/req"
    click teacherInc "https://github.com/votuanhuy2910/quanly-ueh/tree/main/student-information-system-new/Teacher/inc"

    %% Click Events for Admin Module
    click adminData "https://github.com/votuanhuy2910/quanly-ueh/tree/main/student-information-system-new/admin/data"
    click adminReq "https://github.com/votuanhuy2910/quanly-ueh/tree/main/student-information-system-new/admin/req"
    click adminInc "https://github.com/votuanhuy2910/quanly-ueh/tree/main/student-information-system-new/admin/inc"

    %% Click Events for Database Dumps
    click sql1 "https://github.com/votuanhuy2910/quanly-ueh/blob/main/student-information-system-new/sms_db.sql"
    click sql2 "https://github.com/votuanhuy2910/quanly-ueh/blob/main/student-information-system-new/ueh_qlhs.sql"
```
