# pavanserigara/bca-project architecture

> Architecture diagram of the GitHub repository pavanserigara/bca-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pavanserigara/bca-project
- Repository: https://github.com/pavanserigara/bca-project

## Overview

1. This repository is a PHP monolith for a campus/school management system (`cms`). The application is organized primarily by user role rather than by technical layers, with separate page sets for admin, teacher, student, and parent experiences.

2. The main entry/authentication flow is centralized at the root: `index.php`, `login.php`, `forgot-password.php`, `logout.php`, and `reset_admin.php`. These pages are the public boundary into the system and likely route users into the correct role area after authentication.

3. Role-specific subsystems are split into top-level directories:
   - `admin/` for institution operations and master data
   - `teacher/` for academic operations
   - `student/` for learner self-service
   - `parent/` for guardian visibility
   Each role has its own `dashboard.php` and feature pages, which implies a server-rendered UI with role-scoped navigation and permissions.

4. The admin area is the broadest control plane. It includes management screens for students, faculty, departments, subjects, courses, exams, fees, notices, events, placements, logistics, library, complaints, leave approvals, ID cards, document verification, and settings. This suggests admin owns institutional configuration, records, approvals, and reporting.

5. The teacher area is the academic operations layer. Its pages focus on attendance taking and reporting, marks entry, subject/material management, assignments/submissions review, notices, messaging, timetable, leave requests, and profile maintenance. Teachers appear to be the primary producers of academic data consumed elsewhere in the system.

6. The student area is the self-service consumption and submission layer. It exposes dashboards for attendance, results, fees, timetable, notices, events, assignments, documents, messaging, placements, library, logistics, complaints, materials, ID card, and profile. Students likely upload files and view academic and administrative status rather than manage core records.

7. The parent area is a read-heavy visibility layer. It includes dashboard, attendance, fees, results, notices, messaging, and profile pages, indicating that parents can monitor student progress and institutional communication but do not directly create operational records.

8. Shared application logic lives under `includes/` and role-local `includes/` folders. `includes/db.php` is the shared database connection boundary, while `includes/functions.php` provides cross-cutting helpers. Shared headers/footers in each role folder indicate a common page shell with role-specific navigation and layout.

9. File/document handling is a distinct subsystem. Upload handlers exist in `includes/handlers/`, `student/includes/handlers/`, and `admin/includes/handlers/`, including `document_upload.php`, `profile_upload.php`, and `get_student_docs.php`. The presence of `uploads/profiles/` shows that user documents and avatars are stored on disk, with the database likely tracking metadata and verification status.

10. The data backbone is MySQL-based, with schema stored in `database/cms.sql` and at least one migration in `database/migrations/phase_1_identity.php`. Utility scripts like `test_db.php`, `update_db.php`, and `test_paths.php` suggest local setup, schema validation, and path/debug support around the database and file system.

11. Static assets are centralized under `assets/` for CSS, JavaScript, and images. This supports a traditional server-rendered UI rather than a separate front-end application.

12. Operationally, the architecture is a single deployable PHP application with shared state in the database and uploaded files on disk. The main interaction flow is: user logs in at the root, lands in a role-specific dashboard, performs module actions through PHP pages, which read/write the shared database and, when needed, persist documents or profile images to the uploads area.

13. The planning artifacts under `.planning/` indicate the project has been organized into phased implementation and verification, but they are not part of the runtime architecture. They are useful for understanding intended scope, not request flow.

Main entry points: [`includes/db.php`](https://github.com/pavanserigara/bca-project/blob/main/includes/db.php) (Shared logic), [`database/cms.sql`](https://github.com/pavanserigara/bca-project/blob/main/database/cms.sql) (Database), [`index.php`](https://github.com/pavanserigara/bca-project/blob/main/index.php) (Entry), [`admin/dashboard.php`](https://github.com/pavanserigara/bca-project/blob/main/admin/dashboard.php) (Admin dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_public["Public access"]
  node_node_index["Entry<br/>[index.php]"]
  node_node_login["Login<br/>auth page<br/>[login.php]"]
  node_node_recovery["Recovery<br/>auth pages"]
end

subgraph group_group_admin["Admin portal"]
  node_node_admin_dashboard["Admin dashboard<br/>admin hub<br/>[dashboard.php]"]
  node_node_admin_master["Master data<br/>admin modules<br/>[students-list.php]"]
  node_node_admin_ops["Operations<br/>admin modules<br/>[fees.php]"]
  node_node_admin_people["People views<br/>admin modules<br/>[faculty-list.php]"]
end

subgraph group_group_teacher["Teacher portal"]
  node_node_teacher_dashboard["Teacher dashboard<br/>teacher hub<br/>[dashboard.php]"]
  node_node_teacher_core["Academic work<br/>teacher modules"]
  node_node_teacher_comm["Teacher comms<br/>teacher modules<br/>[assignments.php]"]
end

subgraph group_group_student["Student portal"]
  node_node_student_dashboard["Student dashboard<br/>student hub<br/>[dashboard.php]"]
  node_node_student_acad["Student academic<br/>student modules<br/>[attendance.php]"]
  node_node_student_services["Student services<br/>student modules<br/>[messaging.php]"]
end

subgraph group_group_parent["Parent portal"]
  node_node_parent_dashboard["Parent dashboard<br/>parent hub<br/>[dashboard.php]"]
  node_node_parent_view["Parent view<br/>parent modules<br/>[attendance.php]"]
end

subgraph group_group_shared["Shared platform"]
  node_node_db[("Database<br/>mysql schema<br/>[cms.sql]")]
  node_node_includes["Shared logic<br/>php includes<br/>[db.php]"]
  node_node_uploads[("Uploads<br/>file storage")]
  node_node_assets["Assets<br/>[style.css]"]
end

node_node_login -->|"authenticates"| node_node_index
node_node_index -->|"routes admin"| node_node_admin_dashboard
node_node_index -->|"routes teacher"| node_node_teacher_dashboard
node_node_index -->|"routes student"| node_node_student_dashboard
node_node_index -->|"routes parent"| node_node_parent_dashboard
node_node_recovery -->|"resets access"| node_node_login
node_node_admin_dashboard -->|"manages"| node_node_admin_master
node_node_admin_dashboard -->|"operates"| node_node_admin_ops
node_node_admin_dashboard -->|"reviews"| node_node_admin_people
node_node_teacher_dashboard -->|"runs"| node_node_teacher_core
node_node_teacher_dashboard -->|"coordinates"| node_node_teacher_comm
node_node_student_dashboard -->|"consumes"| node_node_student_acad
node_node_student_dashboard -->|"accesses"| node_node_student_services
node_node_parent_dashboard -->|"monitors"| node_node_parent_view
node_node_admin_master -->|"reads/writes"| node_node_db
node_node_admin_ops -->|"reads/writes"| node_node_db
node_node_teacher_core -->|"reads/writes"| node_node_db
node_node_student_acad -->|"reads/writes"| node_node_db
node_node_parent_view -->|"reads"| node_node_db
node_node_includes -->|"connects"| node_node_db
node_node_admin_people -->|"uses"| node_node_includes
node_node_teacher_comm -->|"uses"| node_node_includes
node_node_student_services -->|"uses"| node_node_includes
node_node_parent_view -->|"uses"| node_node_includes
node_node_student_acad -->|"stores files"| node_node_uploads
node_node_admin_people -->|"verifies files"| node_node_uploads
node_node_includes -->|"handles uploads"| node_node_uploads
node_node_admin_dashboard -->|"renders with"| node_node_assets
node_node_teacher_dashboard -->|"renders with"| node_node_assets
node_node_student_dashboard -->|"renders with"| node_node_assets
node_node_parent_dashboard -->|"renders with"| node_node_assets

click node_node_index "https://github.com/pavanserigara/bca-project/blob/main/index.php"
click node_node_login "https://github.com/pavanserigara/bca-project/blob/main/login.php"
click node_node_recovery "https://github.com/pavanserigara/bca-project/blob/main/forgot-password.php"
click node_node_admin_dashboard "https://github.com/pavanserigara/bca-project/blob/main/admin/dashboard.php"
click node_node_admin_master "https://github.com/pavanserigara/bca-project/blob/main/admin/students-list.php"
click node_node_admin_ops "https://github.com/pavanserigara/bca-project/blob/main/admin/fees.php"
click node_node_admin_people "https://github.com/pavanserigara/bca-project/blob/main/admin/faculty-list.php"
click node_node_teacher_dashboard "https://github.com/pavanserigara/bca-project/blob/main/teacher/dashboard.php"
click node_node_teacher_core "https://github.com/pavanserigara/bca-project/blob/main/teacher/attendance-take.php"
click node_node_teacher_comm "https://github.com/pavanserigara/bca-project/blob/main/teacher/assignments.php"
click node_node_student_dashboard "https://github.com/pavanserigara/bca-project/blob/main/student/dashboard.php"
click node_node_student_acad "https://github.com/pavanserigara/bca-project/blob/main/student/attendance.php"
click node_node_student_services "https://github.com/pavanserigara/bca-project/blob/main/student/messaging.php"
click node_node_parent_dashboard "https://github.com/pavanserigara/bca-project/blob/main/parent/dashboard.php"
click node_node_parent_view "https://github.com/pavanserigara/bca-project/blob/main/parent/attendance.php"
click node_node_db "https://github.com/pavanserigara/bca-project/blob/main/database/cms.sql"
click node_node_includes "https://github.com/pavanserigara/bca-project/blob/main/includes/db.php"
click node_node_uploads "https://github.com/pavanserigara/bca-project/tree/main/uploads/profiles"
click node_node_assets "https://github.com/pavanserigara/bca-project/blob/main/assets/css/style.css"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_index,node_node_login,node_node_recovery toneBlue
class node_node_admin_dashboard,node_node_admin_master,node_node_admin_ops,node_node_admin_people toneAmber
class node_node_teacher_dashboard,node_node_teacher_core,node_node_teacher_comm toneMint
class node_node_student_dashboard,node_node_student_acad,node_node_student_services toneRose
class node_node_parent_dashboard,node_node_parent_view toneIndigo
class node_node_db,node_node_includes,node_node_uploads,node_node_assets toneTeal
```

## Components

### Public access

Entry and authentication boundary

- [Entry](https://github.com/pavanserigara/bca-project/blob/main/index.php): php entry · Landing page and role routing · `index.php`
- [Login](https://github.com/pavanserigara/bca-project/blob/main/login.php): auth page · Credential submission and sign-in · `login.php`
- [Recovery](https://github.com/pavanserigara/bca-project/blob/main/forgot-password.php): auth pages · Forgot/reset and logout flows · `forgot-password.php`

### Admin portal

Institution control and master data

- [Admin dashboard](https://github.com/pavanserigara/bca-project/blob/main/admin/dashboard.php): admin hub · Top-level administrative control plane · `admin/dashboard.php`
- [Master data](https://github.com/pavanserigara/bca-project/blob/main/admin/students-list.php): admin modules · Students, faculty, departments, subjects, courses, staff · `admin/students-list.php`
- [Operations](https://github.com/pavanserigara/bca-project/blob/main/admin/fees.php): admin modules · Fees, exams, timetable, notices, events, placements, logistics, library, complaints, leave, ID cards, settings · `admin/fees.php`
- [People views](https://github.com/pavanserigara/bca-project/blob/main/admin/faculty-list.php): admin modules · Faculty, students, parents, profile and document verification · `admin/faculty-list.php`

### Teacher portal

Academic operations and submissions

- [Teacher dashboard](https://github.com/pavanserigara/bca-project/blob/main/teacher/dashboard.php): teacher hub · Academic workbench for staff · `teacher/dashboard.php`
- [Academic work](https://github.com/pavanserigara/bca-project/blob/main/teacher/attendance-take.php): teacher modules · Attendance, marks, subjects, materials, timetable, leave, profile · `teacher/attendance-take.php`
- [Teacher comms](https://github.com/pavanserigara/bca-project/blob/main/teacher/assignments.php): teacher modules · Assignments, submissions review, notices, messaging · `teacher/assignments.php`

### Student portal

Learner self-service and uploads

- [Student dashboard](https://github.com/pavanserigara/bca-project/blob/main/student/dashboard.php): student hub · Learner self-service home · `student/dashboard.php`
- [Student academic](https://github.com/pavanserigara/bca-project/blob/main/student/attendance.php): student modules · Attendance, results, fees, timetable, materials, assignments, documents, ID card · `student/attendance.php`
- [Student services](https://github.com/pavanserigara/bca-project/blob/main/student/messaging.php): student modules · Messaging, notices, events, placements, library, logistics, complaints, profile · `student/messaging.php`

### Parent portal

Guardian visibility and monitoring

- [Parent dashboard](https://github.com/pavanserigara/bca-project/blob/main/parent/dashboard.php): parent hub · Guardian visibility home · `parent/dashboard.php`
- [Parent view](https://github.com/pavanserigara/bca-project/blob/main/parent/attendance.php): parent modules · Attendance, fees, results, notices, messaging, profile · `parent/attendance.php`

### Shared platform

Common includes, data, assets, and storage

- [Database](https://github.com/pavanserigara/bca-project/blob/main/database/cms.sql): mysql schema · Shared CMS schema and migrations · `database/cms.sql`
- [Shared logic](https://github.com/pavanserigara/bca-project/blob/main/includes/db.php): php includes · Database connection, helpers, headers/footers, and handlers · `includes/db.php`
- [Uploads](https://github.com/pavanserigara/bca-project/tree/main/uploads/profiles): file storage · Profiles and document files on disk · `uploads/profiles`
- [Assets](https://github.com/pavanserigara/bca-project/blob/main/assets/css/style.css): static assets · CSS, JavaScript, and images for server-rendered UI · `assets/css/style.css`

## Connections

- Login → Entry: authenticates · Login is the main sign-in boundary
- Entry → Admin dashboard: routes admin · Authenticated users enter the admin area when authorized
- Entry → Teacher dashboard: routes teacher · Authenticated users enter the teacher area when authorized
- Entry → Student dashboard: routes student · Authenticated users enter the student area when authorized
- Entry → Parent dashboard: routes parent · Authenticated users enter the parent area when authorized
- Recovery → Login: resets access · Password recovery returns users to sign-in
- Admin dashboard → Master data: manages · Administrative control over core records
- Admin dashboard → Operations: operates · Administrative operational modules
- Admin dashboard → People views: reviews · Admin views for people, profiles, and verification
- Teacher dashboard → Academic work: runs · Academic execution features
- Teacher dashboard → Teacher comms: coordinates · Communication and assignment workflow
- Student dashboard → Student academic: consumes · Student-facing academic status and submissions
- Student dashboard → Student services: accesses · Student-facing service and communication pages
- Parent dashboard → Parent view: monitors · Parent-facing read-heavy pages
- Master data → Database: reads/writes · Core records persist in the shared schema
- Operations → Database: reads/writes · Operational state is stored centrally
- Academic work → Database: reads/writes · Attendance, marks, and subject data update shared state
- Student academic → Database: reads/writes · Student submissions and profile data interact with the database
- Parent view → Database: reads · Parent pages mainly consume shared data
- Shared logic → Database: connects · Shared DB connection and helpers
- People views → Shared logic: uses · Admin pages depend on shared includes and handlers
- Teacher comms → Shared logic: uses · Teacher pages depend on shared shell and helpers
- Student services → Shared logic: uses · Student pages depend on shared shell and helpers
- Parent view → Shared logic: uses · Parent pages depend on shared shell and helpers
- Student academic → Uploads: stores files · Documents and profile images are persisted on disk
- People views → Uploads: verifies files · Admin document verification works against uploaded files
- Shared logic → Uploads: handles uploads · Shared and role-local handlers manage file persistence
- Admin dashboard → Assets: renders with · Admin UI uses shared static assets
- Teacher dashboard → Assets: renders with · Teacher UI uses shared static assets
- Student dashboard → Assets: renders with · Student UI uses shared static assets
- Parent dashboard → Assets: renders with · Parent UI uses shared static assets
