# smphuc/project_manament architecture

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

- Interactive diagram: https://gitdiagram.com/smphuc/project_manament
- Repository: https://github.com/smphuc/project_manament

## Overview

##### Main Components
- Frontend Client: Represented by HTML, CSS, and JavaScript files (for example, files like 1.html, 1.css, 1.js, and many CSS resources in public/ and other css files). This is the interface where users (lecturers, students, administrators) interact.
- Application Layer (Backend – CodeIgniter MVC):
– Controllers: Folder “application/controllers” (e.g., LecturerManagement_Controller, StudentManagement_Controller, Login_controller, etc.). These handle incoming requests and coordinate responses.
– Models: Folder “application/models” (e.g., LecturerModel, StudentModel, etc.). They encapsulate data operations and business logic.
– Views: Folder “application/views” (numerous view files for different pages like login_view, manage_students_view, etc.) which present the UI.
- Core Framework: The “system” directory contains the CodeIgniter core libraries, which handle routing, security, session management, and other fundamental services.
- Configuration & Helpers: In “application/config”, “application/helpers”, “application/hooks”, etc., which provide project-level settings and utility functions.
- Third-Party Libraries: The “application/third_party” directory includes PHPExcel (for spreadsheet operations) and additional libraries that support extended functionality.
- Database: Although not explicitly mentioned in the README, the presence of “project_management.sql” and “application/config/database.php” indicates a relational database (likely MySQL) that stores user, project, and progress data.
- File Uploads & Assets: Folders like “uploads”, “public/files”, “img”, “fonts” handle static asset serving and file management.

##### Their Relationships and Data Flow
- A user (through a browser) interacts with the frontend (HTML/CSS/JS). The request is sent to the web server where CodeIgniter’s index.php bootstraps the framework.
- The Router (in system/core/Router.php) directs requests to appropriate Controllers.
- Controllers use Models to perform business logic and data operations (e.g., fetching lecturer or student data from the database).
- Once the data is processed, Controllers load Views that render the final output (HTML), sending it back to the client.
- Additional utilities (helpers and libraries) are used throughout for common tasks such as form validation, session management, file uploads, and dealing with Excel spreadsheets via PHPExcel.
- External data integration (such as Excel file import/export) happens through the third-party PHPExcel library integrated in the application.
- Logging (in application/logs) helps track errors and system events.
- Configuration files (in application/config) ensure that settings (like auto-loading libraries or setting routing defaults) are maintained centrally.

##### Architectural Patterns and Technologies
- The MVC (Model-View-Controller) pattern is central to this project.
- Separation of concerns is maintained: controllers manage interactions, models abstract data, and views present the UI.
- Dependency injection and CodeIgniter’s internal Loader facilitate the flexible inclusion of libraries, helpers, and third-party integrations.
- PHPExcel: A significant third-party component integrated to handle Excel files.
- Standard CodeIgniter libraries (session, cache, email) as seen in “system/libraries” add robustness and common utility support.
- The database configuration indicates a relational DB, with multiple drivers available (MySQL, mysqli, etc.) showing flexibility in database support.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Tier
    subgraph "Client Tier"
        Browser("User Browser"):::client
    end

    %% Presentation Tier
    subgraph "Presentation Tier"
        FE("Frontend Client (HTML, CSS, JS)"):::frontend
        Assets("File Uploads & Assets (uploads, public/files, fonts)"):::assets
    end

    %% Application Tier
    subgraph "Application Tier"
        Router("Router (system/core/Router.php)"):::router
        Controllers("Controllers (application/controllers)"):::controller
        Models("Models (application/models)"):::model
        Views("Views (application/views)"):::view
        Config("Configuration & Helpers (application/config, helpers, hooks)"):::config
    end

    %% Infrastructure Tier
    subgraph "Infrastructure Tier"
        Core("Core Framework (system)"):::framework
        ThirdParty("Third-Party Libraries (PHPExcel)"):::thirdparty
        Database("Database (MySQL)"):::database
    end

    %% Data Flow
    Browser -->|"sendsRequest"| FE
    FE -->|"bootstrapCI"| Router
    Router -->|"dispatch"| Controllers
    Controllers -->|"businessLogic"| Models
    Controllers -->|"renderView"| Views
    Models -->|"dbQuery"| Database
    Controllers -->|"loadConfig"| Config
    Controllers -->|"usePHPExcel"| ThirdParty
    Views -->|"outputHTML"| FE
    Core -->|"supports"| Router

    %% Click Events
    click FE "https://github.com/smphuc/project_manament/blob/main/1.html"
    click Assets "https://github.com/smphuc/project_manament/tree/main/uploads/"
    click Controllers "https://github.com/smphuc/project_manament/tree/main/application/controllers/"
    click Models "https://github.com/smphuc/project_manament/tree/main/application/models/"
    click Views "https://github.com/smphuc/project_manament/tree/main/application/views/"
    click Config "https://github.com/smphuc/project_manament/tree/main/application/config/"
    click Core "https://github.com/smphuc/project_manament/tree/main/system/"
    click ThirdParty "https://github.com/smphuc/project_manament/tree/main/application/third_party/PHPExcel-1.8/"
    click Database "https://github.com/smphuc/project_manament/blob/main/application/config/database.php"

    %% Styles
    classDef client fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef frontend fill:#FFEE93,stroke:#000,stroke-width:2px;
    classDef assets fill:#FFCCCB,stroke:#000,stroke-width:2px;
    classDef router fill:#C1E1C1,stroke:#000,stroke-width:2px;
    classDef controller fill:#FFA07A,stroke:#000,stroke-width:2px;
    classDef model fill:#F0E68C,stroke:#000,stroke-width:2px;
    classDef view fill:#AFEEEE,stroke:#000,stroke-width:2px;
    classDef config fill:#DDA0DD,stroke:#000,stroke-width:2px;
    classDef framework fill:#B0C4DE,stroke:#000,stroke-width:2px;
    classDef thirdparty fill:#D3D3D3,stroke:#000,stroke-width:2px;
    classDef database fill:#F5DEB3,stroke:#000,stroke-width:2px;
```
