# subhasis-sahoo/final_project architecture

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

- Interactive diagram: https://gitdiagram.com/subhasis-sahoo/final_project
- Repository: https://github.com/subhasis-sahoo/final_project

## Overview

##### Project type and purpose
- This is a monolithic, role-based, full-stack PHP web application for digital exam registration and admit-card generation.
- It serves five main user roles (students, exam cell, accounts dept, faculty, dean) each with its own PHP module and UI pages.

##### File structure
- Top-level PHP modules:
- accounts_dept/ (dashboard.php, sidebar.php)
- dean/
- exam_cell/ (functions.php, multiple scheduling & registration pages + JS/CSS subfolders)
- faculty/
- students/ (functions.php, scripts/, styles/, registration & history pages)
- Shared resources:
- generate_random_string.php, header.php
- utilities/ (common JS/CSS for header, sidebar, loader, dashboard)
- public/assets & public/sql (static assets and database dump scripts)
- No separate frontend framework; Bootstrap-based HTML/CSS/JS.

##### README
- Tech stack: PHP on Apache (via XAMPP), MySQL (database model linked).
- Core use cases: student self-service registration; exam-cell scheduling; administrative dashboards; admit-card PDF/web view.

##### Main components
a. Client Tier (Web Browser)
- Students, Exam-cell staff, Accounts staff, Faculty, Dean each access via HTTP/HTTPS.
- UI pages built with PHP-generated HTML, Bootstrap CSS, JavaScript.
b. Web Server Tier
- Apache + PHP interpreter
- Monolithic codebase, organized into role-based modules (accounts_dept/, dean/, exam_cell/, faculty/, students/)
- Shared libraries (generate_random_string.php, header.php) and utilities for common UI elements.
c. Data Tier
- MySQL database (tables defined in public/sql/project_x*.sql)
- Core entities: Users, Students, Exams, Registrations, AdmitCards, Fees, Departments, Schedules
d. Static Asset Service
- Served from public/assets (images, CSS/JS libraries not tied to a module)

##### Relationships and interactions
- Client → Web Server: HTTP requests for pages and AJAX calls (scripts/*.js)
- Web Server → Database: PHP MySQL queries (via functions.php in each module)
- Data flow:
- Student requests registration form → server validates → writes to Registration table → returns confirmation.
- Exam-cell schedules exams → writes to Schedule table → notifications back to students.
- Admit-card generation → server composes data from multiple tables (Registrations, Students) → renders printable view.
- Accounts/faculty/dean dashboards query aggregated data.

##### Important architectural patterns and design principles
- Modular separation by user role (folder-based “sub-applications”)
- Shared utilities for cross-cutting concerns (UI layout, random string generation)
- Layered approach: Presentation (PHP + HTML/JS/CSS) → Business logic (PHP functions) → Persistence (MySQL)

##### Detail without overcomplicating
- Both synchronous page loads and asynchronous JS calls
- How shared utilities and header.php tie into each module’s control flow
- Public/sql scripts as part of your Data Tier deployment/development process

## Diagram (Mermaid)

```mermaid
graph TB
    %% Client Tier
    subgraph "Client Tier" 
        classDef client fill:#cccccc,stroke:#333,stroke-width:1px;
        StudentsBrowser["Students Browser"]:::client
        ExamCellBrowser["Exam-Cell Staff Browser"]:::client
        AccountsBrowser["Accounts Staff Browser"]:::client
        FacultyBrowser["Faculty Browser"]:::client
        DeanBrowser["Dean Browser"]:::client
    end

    %% Web Server Tier
    subgraph "Web Server Tier"
        classDef module fill:#bbdefb,stroke:#1976d2,stroke-width:1px;
        classDef util fill:#fff9c4,stroke:#fbc02d,stroke-width:1px;
        classDef static fill:#ffe0b2,stroke:#e65100,stroke-width:1px;

        subgraph "Students Module"
            StudentsDashboard["students/dashboard.php"]:::module
            StudentsReg["students/exam_registration.php"]:::module
            StudentsHist["students/application_history.php"]:::module
            StudentsCard["students/registration_card.php"]:::module
            StudentsFunc["students/functions.php"]:::module
            StudentsScripts["students/scripts/"]:::module
            StudentsStyles["students/styles/"]:::module
            StudentsSidebar["students/sidebar.php"]:::module
        end

        subgraph "Exam Cell Module"
            ExamDashboard["exam_cell/dashboard.php"]:::module
            ScheduleReg["exam_cell/schedule_registration.php"]:::module
            ManageAdmit["exam_cell/manage_admit.php"]:::module
            ExamCard["exam_cell/registration_card.php"]:::module
            ExamFunc["exam_cell/functions.php"]:::module
            ExamScripts["exam_cell/scripts/"]:::module
            ExamStyles["exam_cell/styles/"]:::module
            ExamSidebar["exam_cell/sidebar.php"]:::module
        end

        subgraph "Accounts Dept Module"
            AccountsDash["accounts_dept/dashboard.php"]:::module
            AccountsSidebar["accounts_dept/sidebar.php"]:::module
        end

        subgraph "Faculty Module"
            FacultyDash["faculty/dashboard.php"]:::module
            FacultySidebar["faculty/sidebar.php"]:::module
        end

        subgraph "Dean Module"
            DeanDash["dean/dashboard.php"]:::module
            DeanSidebar["dean/sidebar.php"]:::module
        end

        subgraph "Shared Libraries & Utilities"
            Header["header.php"]:::util
            RandGen["generate_random_string.php"]:::util
            UtilScripts["utilities/scripts/"]:::util
            UtilStyles["utilities/styles/"]:::util
        end

        subgraph "Static Asset Service"
            PublicAssets["public/assets/"]:::static
        end
    end

    %% Data Tier
    subgraph "Data Tier"
        classDef db fill:#c8e6c9,stroke:#2e7d32,stroke-width:1px;
        Database["MySQL Database"]:::db
        SQLScripts["public/sql/"]:::db
    end

    %% Connections Client -> Server
    StudentsBrowser -->|"GET students/dashboard.php"| StudentsDashboard
    StudentsBrowser -->|"AJAX POST students/scripts/*.js"| StudentsScripts
    ExamCellBrowser -->|"GET exam_cell/dashboard.php"| ExamDashboard
    AccountsBrowser -->|"GET accounts_dept/dashboard.php"| AccountsDash
    FacultyBrowser -->|"GET faculty/dashboard.php"| FacultyDash
    DeanBrowser -->|"GET dean/dashboard.php"| DeanDash

    %% Server modules use Shared Libs & Static
    StudentsDashboard -->|"include header.php"| Header
    ExamDashboard -->|"include header.php"| Header
    StudentsDashboard -->|"use generate_random_string.php"| RandGen
    StudentsDashboard -->|"load CSS/JS"| UtilStyles
    ExamDashboard -->|"load CSS/JS"| UtilStyles
    StudentsDashboard -->|"load assets"| PublicAssets
    ExamDashboard -->|"load assets"| PublicAssets

    %% Modules -> Database
    StudentsFunc -->|"MySQL SELECT/INSERT"| Database
    ExamFunc -->|"MySQL SELECT/INSERT"| Database
    AccountsDash -->|"MySQL SELECT"| Database
    FacultyDash -->|"MySQL SELECT"| Database
    DeanDash -->|"MySQL SELECT"| Database

    SQLScripts --> Database

    %% Click Events
    click StudentsDashboard "https://github.com/subhasis-sahoo/final_project/blob/main/students/dashboard.php"
    click StudentsReg "https://github.com/subhasis-sahoo/final_project/blob/main/students/exam_registration.php"
    click StudentsHist "https://github.com/subhasis-sahoo/final_project/blob/main/students/application_history.php"
    click StudentsCard "https://github.com/subhasis-sahoo/final_project/blob/main/students/registration_card.php"
    click StudentsFunc "https://github.com/subhasis-sahoo/final_project/blob/main/students/functions.php"
    click StudentsScripts "https://github.com/subhasis-sahoo/final_project/tree/main/students/scripts/"
    click StudentsStyles "https://github.com/subhasis-sahoo/final_project/tree/main/students/styles/"
    click StudentsSidebar "https://github.com/subhasis-sahoo/final_project/blob/main/students/sidebar.php"
    click ExamDashboard "https://github.com/subhasis-sahoo/final_project/blob/main/exam_cell/dashboard.php"
    click ScheduleReg "https://github.com/subhasis-sahoo/final_project/blob/main/exam_cell/schedule_registration.php"
    click ManageAdmit "https://github.com/subhasis-sahoo/final_project/blob/main/exam_cell/manage_admit.php"
    click ExamCard "https://github.com/subhasis-sahoo/final_project/blob/main/exam_cell/registration_card.php"
    click ExamFunc "https://github.com/subhasis-sahoo/final_project/blob/main/exam_cell/functions.php"
    click ExamScripts "https://github.com/subhasis-sahoo/final_project/tree/main/exam_cell/scripts/"
    click ExamStyles "https://github.com/subhasis-sahoo/final_project/tree/main/exam_cell/styles/"
    click ExamSidebar "https://github.com/subhasis-sahoo/final_project/blob/main/exam_cell/sidebar.php"
    click AccountsDash "https://github.com/subhasis-sahoo/final_project/blob/main/accounts_dept/dashboard.php"
    click AccountsSidebar "https://github.com/subhasis-sahoo/final_project/blob/main/accounts_dept/sidebar.php"
    click FacultyDash "https://github.com/subhasis-sahoo/final_project/blob/main/faculty/dashboard.php"
    click FacultySidebar "https://github.com/subhasis-sahoo/final_project/blob/main/faculty/sidebar.php"
    click DeanDash "https://github.com/subhasis-sahoo/final_project/blob/main/dean/dashboard.php"
    click DeanSidebar "https://github.com/subhasis-sahoo/final_project/blob/main/dean/sidebar.php"
    click Header "https://github.com/subhasis-sahoo/final_project/blob/main/header.php"
    click RandGen "https://github.com/subhasis-sahoo/final_project/blob/main/generate_random_string.php"
    click UtilScripts "https://github.com/subhasis-sahoo/final_project/tree/main/utilities/scripts/"
    click UtilStyles "https://github.com/subhasis-sahoo/final_project/tree/main/utilities/styles/"
    click PublicAssets "https://github.com/subhasis-sahoo/final_project/tree/main/public/assets/"
    click SQLScripts "https://github.com/subhasis-sahoo/final_project/tree/main/public/sql/"

    %% Styles
    class StudentsDashboard,StudentsReg,StudentsHist,StudentsCard,StudentsFunc,StudentsScripts,StudentsStyles,StudentsSidebar module
    class ExamDashboard,ScheduleReg,ManageAdmit,ExamCard,ExamFunc,ExamScripts,ExamStyles,ExamSidebar module
    class AccountsDash,AccountsSidebar,FacultyDash,FacultySidebar,DeanDash,DeanSidebar module
    class Header,RandGen,UtilScripts,UtilStyles util
    class PublicAssets static
    class Database,SQLScripts db
```
