# dev-mhrony/student-attendance-system01 architecture

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

- Interactive diagram: https://gitdiagram.com/dev-mhrony/student-attendance-system01
- Repository: https://github.com/dev-mhrony/student-attendance-system01

## Overview

##### Project type and purpose
- This is a PHP-based full-stack web application called “Student Attendance Management System.”
- It exposes three user-facing panels:
- Admin Panel for managing users, students, teachers, sessions, terms, and viewing all records.
- Teacher Panel (“ClassTeacher” folder) for taking and viewing attendance per class/subject.
- Student Panel (root pages like index.php, viewStudentAttendance.php) for viewing own attendance reports.

##### File structure
- Top-level directories:
- Admin/ – All PHP, SCSS, assets for the Administrator’s UI.
- ClassTeacher/ – All PHP, SCSS, assets for the Teacher’s UI.
- Includes/ – Shared PHP libraries (db connection, session management).
- DATABASE FILE/ – SQL dump for MySQL schema and initial data.
- vendor/ – (Possibly Composer dependencies or third-party code).
- Shared assets in root: css/, js/, img/, scss/, scripts/ – used by the Student panel and common pages (login, forgot password).
- Pattern: Each panel folder follows the same structure—Includes (header/footer/sidebar/topbar), css, js, scss, font, img—indicating a consistent UI theme (Ruang-Admin).

##### Readme insights
- Confirms three distinct user roles with separate modules.
- No external third-party services (e.g., no OAuth, no email gateway detailed).
- Uses MySQL (via dbcon.php) for persistence.

##### Elements
- Labels: “Admin Module,” “Teacher Module,” “Student Module,” “Includes/dbcon.php,” “MySQL DB.”
- A clear separation line between Client Tier, Application Tier, and Data Tier.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Tier
    AdminBrowser["Admin Browser"]:::browser
    TeacherBrowser["Teacher Browser"]:::browser
    StudentBrowser["Student Browser"]:::browser

    %% Application Tier
    subgraph "Web Server & PHP"
        direction TB
        WS["Apache/Nginx + PHP"]:::server

        subgraph "Admin Module"
            direction TB
            AdminModuleContainer[" "] 
            AdminIndex["index.php"]:::module
            CreateUsers["createUsers.php"]:::module
            AjaxArms["ajaxClassArms.php"]:::module
        end

        subgraph "Teacher Module"
            direction TB
            TeacherModuleContainer[" "]
            TeacherIndex["index.php"]:::module
            TakeAttendance["takeAttendance.php"]:::module
            AjaxCall["ajaxCallTypes.php"]:::module
        end

        subgraph "Student Module"
            direction TB
            StudentIndex["index.php"]:::module
            ForgotPwd["forgotPassword.php"]:::module
            ViewStud["viewStudentAttendance.php"]:::module
            SaveMember["saveMember.php"]:::module
        end

        subgraph "Shared Libraries"
            direction TB
            IncludeDB["dbcon.php"]:::shared
            IncludeSession["session.php"]:::shared
        end

        subgraph "Static Assets Handler"
            direction TB
            CSSHandler["css/, scss/"]:::shared
            JSHandler["js/, demo/chart-*.js"]:::shared
            ImgHandler["img/, font/"]:::shared
        end

        %% Internal Flows
        WS --> AdminModuleContainer
        WS --> TeacherModuleContainer
        WS --> StudentIndex
        AdminModuleContainer --> AdminIndex
        AdminModuleContainer --> CreateUsers
        AdminModuleContainer --> AjaxArms
        TeacherModuleContainer --> TeacherIndex
        TeacherModuleContainer --> TakeAttendance
        TeacherModuleContainer --> AjaxCall
        StudentIndex --> ForgotPwd
        StudentIndex --> ViewStud
        StudentIndex --> SaveMember

        %% Shared includes usage
        AdminModuleContainer --> IncludeDB
        AdminModuleContainer --> IncludeSession
        TeacherModuleContainer --> IncludeDB
        TeacherModuleContainer --> IncludeSession
        StudentIndex --> IncludeDB
        StudentIndex --> IncludeSession

        %% Static assets usage
        AdminModuleContainer --> CSSHandler
        AdminModuleContainer --> JSHandler
        AdminModuleContainer --> ImgHandler
        TeacherModuleContainer --> CSSHandler
        TeacherModuleContainer --> JSHandler
        TeacherModuleContainer --> ImgHandler
        StudentIndex --> CSSHandler
        StudentIndex --> JSHandler
        StudentIndex --> ImgHandler
    end

    %% Data Tier
    DB["MySQL Database"]:::db
    SharedDB["SQL Dump"]:::db

    %% Connections
    AdminBrowser -->|HTTP Request| WS
    TeacherBrowser -->|HTTP Request| WS
    StudentBrowser -->|HTTP Request| WS

    AdminModuleContainer -->|SQL Query| DB
    TeacherModuleContainer -->|SQL Query| DB
    StudentIndex -->|SQL Query| DB

    SharedDB -.->|Schema/Seed| DB

    %% Click Events
    click AdminModuleContainer "https://github.com/dev-mhrony/student-attendance-system01/tree/main/Admin/"
    click AdminIndex "https://github.com/dev-mhrony/student-attendance-system01/blob/main/Admin/index.php"
    click CreateUsers "https://github.com/dev-mhrony/student-attendance-system01/blob/main/Admin/createUsers.php"
    click AjaxArms "https://github.com/dev-mhrony/student-attendance-system01/blob/main/Admin/ajaxClassArms.php"
    click TeacherModuleContainer "https://github.com/dev-mhrony/student-attendance-system01/tree/main/ClassTeacher/"
    click TeacherIndex "https://github.com/dev-mhrony/student-attendance-system01/blob/main/ClassTeacher/index.php"
    click TakeAttendance "https://github.com/dev-mhrony/student-attendance-system01/blob/main/ClassTeacher/takeAttendance.php"
    click AjaxCall "https://github.com/dev-mhrony/student-attendance-system01/blob/main/ClassTeacher/ajaxCallTypes.php"
    click StudentIndex "https://github.com/dev-mhrony/student-attendance-system01/blob/main/index.php"
    click ForgotPwd "https://github.com/dev-mhrony/student-attendance-system01/blob/main/forgotPassword.php"
    click ViewStud "https://github.com/dev-mhrony/student-attendance-system01/blob/main/viewStudentAttendance.php"
    click SaveMember "https://github.com/dev-mhrony/student-attendance-system01/blob/main/scripts/saveMember.php"
    click IncludeDB "https://github.com/dev-mhrony/student-attendance-system01/blob/main/Includes/dbcon.php"
    click IncludeSession "https://github.com/dev-mhrony/student-attendance-system01/blob/main/Includes/session.php"
    click SharedDB "https://github.com/dev-mhrony/student-attendance-system01/blob/main/DATABASE FILE/attendancemsystem.sql"

    %% Styles
    classDef browser fill:#a8d0e6,stroke:#333,stroke-width:1px
    classDef server fill:#74c69d,stroke:#333,stroke-width:1px
    classDef module fill:#d9ed92,stroke:#333,stroke-width:1px
    classDef shared fill:#ffadad,stroke:#333,stroke-width:1px
    classDef db fill:#adb5bd,stroke:#333,stroke-width:1px
```
