# roblaran/student-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/roblaran/student-management-system
- Repository: https://github.com/roblaran/student-management-system

## Overview

##### Main Components

A. Client Layer
- Web Browser Interface
- CSS Styling Components (from /css directory)
- View Templates (from /views directory)

B. Application Layer
- Router (router.php)
- Controllers Layer (/controllers directory)
- Authentication System (user_auth.php)
- Core Functions (functions.php)

C. Data Layer
- Database Interface (db/database.php)
- Query Modules (db/queries/*)
- Data Models (implied from the database schema)

##### Component Relationships

**[Client Browser] ←→ [Router] ←→ [Controllers] ←→ [Database]**

##### Detailed Component Breakdown

- User Management (Blue)
- Student Management (Green)
- Course Management (Orange)
- Enrollment Management (Purple)
- Report Generation (Yellow)

- Users Table
- Students Table
- Courses Table
- Enrollments Table
- Reports Table

##### Specific Implementation Details

**[Views] → [Controllers] → [Query Modules] → [Database]**
**↑                                             ↓**
**[Response] ← [Controllers] ← [Query Results] ←-'**

##### Key Elements to Highlight

A. Authentication Flow:
- Login/Register process
- Session management
- Password hashing

B. CRUD Operations:
- Student management flows
- Course management flows
- Enrollment processes

C. Data Relationships:
- Relationships between tables
- Foreign key connections

##### Architectural Patterns to Emphasize

- MVC Pattern:
- Models: db/queries/*_queries.php files
- Views: views/*.view.php files
- Controllers: controllers/* files

##### Technical Specifications

- PHP Backend
- MySQL Database
- CSS Frontend
- Authentication Layer
- Router System

##### Database relationships

Tools Recommendation:
- Maintain consistent styling
- Use standard UML notations where applicable
- Version information
- Notes for complex flows

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
        CSS["CSS Styling"]:::css
        Views["View Templates"]:::views
    end

    subgraph "Application Layer"
        Router["Router System"]:::router
        Auth["Authentication System"]:::auth
        CoreFn["Core Functions"]:::core

        subgraph "Controllers"
            UserCtrl["User Management"]:::controller
            StudentCtrl["Student Management"]:::controller
            CourseCtrl["Course Management"]:::controller
            EnrollCtrl["Enrollment Management"]:::controller
            ReportCtrl["Report Generation"]:::controller
        end
    end

    subgraph "Data Layer"
        DB["Database Interface"]:::db
        
        subgraph "Query Modules"
            UserQ["User Queries"]:::query
            StudentQ["Student Queries"]:::query
            CourseQ["Course Queries"]:::query
            EnrollQ["Enrollment Queries"]:::query
        end

        subgraph "Database Tables"
            Users[(Users)]:::table
            Students[(Students)]:::table
            Courses[(Courses)]:::table
            Enrollments[(Enrollments)]:::table
            Reports[(Reports)]:::table
        end
    end

    %% Relationships
    Browser --> Router
    Router --> Auth
    Auth --> CoreFn
    Router --> Controllers
    
    UserCtrl --> UserQ
    StudentCtrl --> StudentQ
    CourseCtrl --> CourseQ
    EnrollCtrl --> EnrollQ
    
    UserQ --> DB
    StudentQ --> DB
    CourseQ --> DB
    EnrollQ --> DB
    
    DB --> Users
    DB --> Students
    DB --> Courses
    DB --> Enrollments
    DB --> Reports

    Controllers --> Views
    Views --> Browser
    CSS --> Browser

    %% Click Events
    click Router "https://github.com/RobLaran/Student-Management-System/blob/main/router.php"
    click Auth "https://github.com/RobLaran/Student-Management-System/blob/main/user_auth.php"
    click CoreFn "https://github.com/RobLaran/Student-Management-System/blob/main/functions.php"
    click DB "https://github.com/RobLaran/Student-Management-System/blob/main/db/database.php"
    click UserQ "https://github.com/RobLaran/Student-Management-System/blob/main/db/queries/user_queries.php"
    click StudentQ "https://github.com/RobLaran/Student-Management-System/blob/main/db/queries/student_queries.php"
    click CourseQ "https://github.com/RobLaran/Student-Management-System/blob/main/db/queries/course_queries.php"
    click EnrollQ "https://github.com/RobLaran/Student-Management-System/blob/main/db/queries/enroll_queries.php"
    click Views "https://github.com/RobLaran/Student-Management-System/tree/main/views"
    click CSS "https://github.com/RobLaran/Student-Management-System/tree/main/css"
    click UserCtrl "https://github.com/RobLaran/Student-Management-System/blob/main/controllers/login.php"
    click StudentCtrl "https://github.com/RobLaran/Student-Management-System/tree/main/controllers/students"
    click CourseCtrl "https://github.com/RobLaran/Student-Management-System/tree/main/controllers/course"
    click EnrollCtrl "https://github.com/RobLaran/Student-Management-System/blob/main/controllers/enroll.php"
    click ReportCtrl "https://github.com/RobLaran/Student-Management-System/blob/main/controllers/reports.php"

    %% Styling
    classDef controller fill:#f9f,stroke:#333
    classDef query fill:#fcf,stroke:#333
    classDef db fill:#9cf,stroke:#333
    classDef table fill:#cff,stroke:#333
    classDef router fill:#ff9,stroke:#333
    classDef auth fill:#f99,stroke:#333
    classDef core fill:#9f9,stroke:#333
    classDef css fill:#ffc,stroke:#333
    classDef views fill:#cfc,stroke:#333

    %% Legend
    subgraph Legend
        L1["Controller"]:::controller
        L2["Query Module"]:::query
        L3["Database Component"]:::db
        L4["Database Table"]:::table
        L5["Router"]:::router
        L6["Authentication"]:::auth
        L7["Core Functions"]:::core
        L8["CSS"]:::css
        L9["Views"]:::views
    end
```
