# regcyb1/student-result-managment-system architecture

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

- Interactive diagram: https://gitdiagram.com/regcyb1/student-result-managment-system
- Repository: https://github.com/regcyb1/student-result-managment-system

## Overview

##### Project type and purpose
- This is a monolithic, full‐stack PHP web application called “Student Result Management System.”
- Purpose: allow an administrator to log in, manage classes, students, subjects, notices, and results; send OTPs via email for privacy; and display reports and charts.

##### File structure
- Top-level PHP files (index.php, admin-login.php, dashboard.php, add-*.php, edit-*.php, manage-*.php, etc.) implement UI controllers and views in the same folder.
- includes/ holds shared PHP modules (config.php for DB credentials; topbar.php/leftbar.php for layout; PHPMailer library for SMTP).
- css/, js/, fonts/, images/ contain static assets (Bootstrap, jQuery, DataTables, amCharts, CKEditor, etc.).
- sql file/srms.sql contains the MySQL schema/data.
- package.json and gulpfile.babel.js suggest a front‐end build tool, but the app primarily serves prebuilt assets.

##### README for additional insights
- Deployment: drop into XAMPP’s htdocs, start Apache & MySQL, import the srms database, visit http://localhost/srms/.
- Authentication: Admin credentials are hard-coded; OTP via Mailtrap using PHPMailer.

a. Main components
- Browser/client GUI
- Apache HTTP Server + PHP interpreter (monolith)
- MySQL database (srms)
- Static asset storage (CSS/JS/images served by Apache)
- SMTP mail service (Mailtrap) via PHPMailer

b. Relationships & data flows
1. Client ↔ HTTP (port 80) ↔ Apache/PHP
2. PHP scripts ↔ TCP (port 3306) ↔ MySQL
3. PHP (PHPMailer) ↔ SMTP ↔ Mailtrap (external)
4. Client requests static assets (CSS/JS/images) from Apache

c. Architectural patterns & principles
- Monolithic MVC-ish pattern: PHP scripts act as controllers and views; includes/ contains reusable modules.
- Shared configuration in includes/config.php.
- Separation of concerns: static assets segregated in css/, js/, images/.

d. Key technologies
- Server-side: PHP 7.x+, Apache 2.x, MySQL 5.x
- Front-end: Bootstrap 3, jQuery, DataTables, amCharts, CKEditor, various plugins
- Email: PHPMailer + Mailtrap

##### Detailed elements
- Component labels: “Browser,” “Apache + PHP,” “MySQL (srms),” “PHPMailer,” “Mailtrap SMTP.”
- Static asset folder as a sub‐component of Apache (css/, js/, images/).
- Includes/ modules (config.php, topbar.php, leftbar.php) as supporting libraries under the PHP block.
- Browser → Apache: HTTP GET/POST
- Apache → MySQL: DB queries
- Apache → Mailtrap: SMTP
- Browser → Apache: asset fetches (CSS, JS)
- Database schema at a high level (tables: admin, students, classes, subjects, combinations, results, notices).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        Browser["Browser / Client GUI"]:::frontend
        index["index.php"]:::frontend
        adminlogin["admin-login.php"]:::frontend
        dashboard["dashboard.php"]:::frontend
        addnotice["add-notice.php"]:::frontend
        addresult["add-result.php"]:::frontend
        addstudents["add-students.php"]:::frontend
        addsubcomb["add-subjectcombination.php"]:::frontend
        createclass["create-class.php"]:::frontend
        createsub["create-subject.php"]:::frontend
        editclass["edit-class.php"]:::frontend
        editresult["edit-result.php"]:::frontend
        editstudent["edit-student.php"]:::frontend
        editsub["edit-subject.php"]:::frontend
        findresult["find-result.php"]:::frontend
        manageclasses["manage-classes.php"]:::frontend
        managenotices["manage-notices.php"]:::frontend
        manageresults["manage-results.php"]:::frontend
        managestudents["manage-students.php"]:::frontend
        managesubcomb["manage-subjectcombination.php"]:::frontend
        managesubs["manage-subjects.php"]:::frontend
        noticedetails["notice-details.php"]:::frontend
        resultpage["result.php"]:::frontend
        otp["otp.php"]:::frontend
        logout["logout.php"]:::frontend
        getstudent["get_student.php"]:::frontend
    end

    %% Static Asset Storage
    subgraph "Static Asset Storage"
        direction TB
        css["css/"]:::static
        js["js/"]:::static
        fonts["fonts/"]:::static
        images["images/"]:::static
    end

    %% Application Layer
    subgraph "Application Layer"
        direction TB
        apache["Apache + PHP"]:::backend
        config["includes/config.php"]:::backend
        topbar["includes/topbar.php"]:::backend
        leftbar["includes/leftbar.php"]:::backend
        phpmailerlib["includes/PHPMailer/"]:::service
        phpmailerphp["includes/PHPMailer/src/PHPMailer.php"]:::service
        smtpclass["includes/PHPMailer/src/SMTP.php"]:::service
        exception["includes/PHPMailer/src/Exception.php"]:::service
        getoauth["includes/PHPMailer/get_oauth_token.php"]:::service
    end

    %% Data Layer
    mysql["MySQL (srms)"]:::db

    %% External Service
    mailtrap["Mailtrap SMTP"]:::service

    %% Relationships
    Browser -->|"HTTP GET/POST"| apache
    Browser -->|"Fetch static assets"| css
    Browser -->|"Fetch static assets"| js
    Browser -->|"Fetch static assets"| fonts
    Browser -->|"Fetch static assets"| images

    apache --> config
    apache --> topbar
    apache --> leftbar

    apache --> phpmailerlib
    phpmailerlib --> phpmailerphp
    phpmailerlib --> smtpclass
    phpmailerlib --> exception
    phpmailerlib --> getoauth
    apache -->|"SMTP: AUTH & SEND"| phpmailerphp
    phpmailerphp -->|"SMTP"| mailtrap

    apache -->|"TCP 3306 queries"| mysql

    %% Click Events Presentation
    click index "https://github.com/regcyb1/student-result-managment-system/blob/master/index.php"
    click adminlogin "https://github.com/regcyb1/student-result-managment-system/blob/master/admin-login.php"
    click dashboard "https://github.com/regcyb1/student-result-managment-system/blob/master/dashboard.php"
    click addnotice "https://github.com/regcyb1/student-result-managment-system/blob/master/add-notice.php"
    click addresult "https://github.com/regcyb1/student-result-managment-system/blob/master/add-result.php"
    click addstudents "https://github.com/regcyb1/student-result-managment-system/blob/master/add-students.php"
    click addsubcomb "https://github.com/regcyb1/student-result-managment-system/blob/master/add-subjectcombination.php"
    click createclass "https://github.com/regcyb1/student-result-managment-system/blob/master/create-class.php"
    click createsub "https://github.com/regcyb1/student-result-managment-system/blob/master/create-subject.php"
    click editclass "https://github.com/regcyb1/student-result-managment-system/blob/master/edit-class.php"
    click editresult "https://github.com/regcyb1/student-result-managment-system/blob/master/edit-result.php"
    click editstudent "https://github.com/regcyb1/student-result-managment-system/blob/master/edit-student.php"
    click editsub "https://github.com/regcyb1/student-result-managment-system/blob/master/edit-subject.php"
    click findresult "https://github.com/regcyb1/student-result-managment-system/blob/master/find-result.php"
    click manageclasses "https://github.com/regcyb1/student-result-managment-system/blob/master/manage-classes.php"
    click managenotices "https://github.com/regcyb1/student-result-managment-system/blob/master/manage-notices.php"
    click manageresults "https://github.com/regcyb1/student-result-managment-system/blob/master/manage-results.php"
    click managestudents "https://github.com/regcyb1/student-result-managment-system/blob/master/manage-students.php"
    click managesubcomb "https://github.com/regcyb1/student-result-managment-system/blob/master/manage-subjectcombination.php"
    click managesubs "https://github.com/regcyb1/student-result-managment-system/blob/master/manage-subjects.php"
    click noticedetails "https://github.com/regcyb1/student-result-managment-system/blob/master/notice-details.php"
    click resultpage "https://github.com/regcyb1/student-result-managment-system/blob/master/result.php"
    click otp "https://github.com/regcyb1/student-result-managment-system/blob/master/otp.php"
    click logout "https://github.com/regcyb1/student-result-managment-system/blob/master/logout.php"
    click getstudent "https://github.com/regcyb1/student-result-managment-system/blob/master/get_student.php"

    %% Click Events Static Assets
    click css "https://github.com/regcyb1/student-result-managment-system/tree/master/css/"
    click js "https://github.com/regcyb1/student-result-managment-system/tree/master/js/"
    click fonts "https://github.com/regcyb1/student-result-managment-system/tree/master/fonts/"
    click images "https://github.com/regcyb1/student-result-managment-system/tree/master/images/"

    %% Click Events Includes
    click config "https://github.com/regcyb1/student-result-managment-system/blob/master/includes/config.php"
    click topbar "https://github.com/regcyb1/student-result-managment-system/blob/master/includes/topbar.php"
    click leftbar "https://github.com/regcyb1/student-result-managment-system/blob/master/includes/leftbar.php"

    %% Click Events PHPMailer
    click phpmailerlib "https://github.com/regcyb1/student-result-managment-system/tree/master/includes/PHPMailer/"
    click phpmailerphp "https://github.com/regcyb1/student-result-managment-system/blob/master/includes/PHPMailer/src/PHPMailer.php"
    click smtpclass "https://github.com/regcyb1/student-result-managment-system/blob/master/includes/PHPMailer/src/SMTP.php"
    click exception "https://github.com/regcyb1/student-result-managment-system/blob/master/includes/PHPMailer/src/Exception.php"
    click getoauth "https://github.com/regcyb1/student-result-managment-system/blob/master/includes/PHPMailer/get_oauth_token.php"

    %% Click Event SQL
    click mysql "https://github.com/regcyb1/student-result-managment-system/blob/master/sql file/srms.sql"

    %% Styles
    classDef frontend fill:#D0E6F6,stroke:#4A90E2,stroke-width:1px
    classDef backend fill:#D5F5E3,stroke:#28B463,stroke-width:1px
    classDef static fill:#FEF5E7,stroke:#F5B041,stroke-width:1px
    classDef db fill:#FADBD8,stroke:#C0392B,stroke-width:1px
    classDef service fill:#E5E8E8,stroke:#7F8C8D,stroke-width:1px
```
