# abhinavdogra21/lab-managment-system architecture

> Architecture diagram of the GitHub repository abhinavdogra21/lab-managment-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhinavdogra21/lab-managment-system
- Repository: https://github.com/abhinavdogra21/lab-managment-system

## Overview

This repository is a Next.js 15 application that combines a role-based UI, a large REST-style backend under `app/api`, and a MySQL-backed workflow engine for lab bookings and equipment management.

#### 1) High-level architecture

The system is organized around three main boundaries:

- **Presentation layer**: role-specific dashboard pages under `app/`
- **Application/API layer**: route handlers under `app/api/`
- **Infrastructure/data layer**: shared server utilities in `lib/` plus MySQL and SMTP services

The app is not a generic CRUD dashboard. It is a workflow system where users move through different approval paths depending on role:
- **student**
- **faculty**
- **lab-staff**
- **hod**
- **lab-coordinator**
- **admin**
- **others** such as T&P or similar non-student categories

A generic dashboard at `app/dashboard/page.tsx` acts as a role redirector, while each role also has its own dashboard subtree.

#### 2) Frontend/UI subsystem

The UI is built with:
- **Next.js App Router**
- **React 18**
- **TypeScript**
- **Tailwind CSS**
- **Shadcn UI primitives** in `components/ui`

##### Page structure
Each role has its own dashboard area:
- `app/admin/dashboard`
- `app/faculty/dashboard`
- `app/hod/dashboard`
- `app/lab-staff/dashboard`
- `app/lab-coordinator/dashboard`
- `app/student/dashboard`
- `app/others/dashboard`

These pages are mostly thin route-level screens. They rely on shared dashboard wrappers in:
- `components/dashboard/dashboard-layout.tsx`
- `components/dashboard/dashboard-header.tsx`
- `components/dashboard/dashboard-sidebar.tsx`

There is also shared auth UI:
- `components/auth/login-form.tsx`

And reporting UI:
- `components/reports/report-generator.tsx`
- `app/admin/dashboard/reports/components/report-generator.tsx`

##### UI boundary
Frontend pages do not directly talk to the database. They call the API routes in `app/api/*`, which centralizes business logic and permissions on the server side.

#### 3) Backend/API subsystem

All backend behavior is implemented as Next.js route handlers in `app/api/`. These are grouped by domain and role.

##### Major API domains
- **Authentication**
  - `app/api/auth/*`
  - login, logout, forgot/reset password, session identity
- **User profile**
  - `app/api/user/*`
  - change password, update profile
- **Admin**
  - `app/api/admin/*`
  - manage users, departments, labs, reports, cleanup/migration operations
- **Student**
  - `app/api/student/*`
  - lab booking requests, component requests, bookings, loans, request history
- **Faculty**
  - `app/api/faculty/*`
  - booking approvals, faculty bookings, component requests, logs
- **Lab staff**
  - `app/api/lab-staff/*`
  - booking approvals, component issuance, inventory, loans, logs, timetable
- **HOD**
  - `app/api/hod/*`
  - department-level approvals, analytics, bookings, logs
- **Lab coordinator**
  - `app/api/lab-coordinator/*`
  - final approval flows and analytics
- **Others**
  - `app/api/others/*`
  - alternate booking/request flow for non-student users
- **Public**
  - `app/api/labs/*`
  - shared lab listing and booked slot data
- **Cron/internal**
  - `app/api/cron/*`
  - booking and loan reminder jobs
- **Debug/maintenance**
  - `app/api/debug/*`
  - troubleshooting routes
  - plus admin utilities like cleanup, migration, and status repair endpoints

##### Architectural pattern in the API layer
Most business logic is centralized in route handlers rather than separate service classes. The route files perform:
- role checks
- request validation
- database reads/writes
- email notifications
- activity logging
- approval state transitions

That means the API layer is both the controller and the application service layer.

#### 4) Shared server-side libraries

The `lib/` directory contains the main reusable backend capabilities:

- **`lib/database.ts`**
  - MySQL connection pool and query helpers
  - core database access boundary
- **`lib/auth.ts`**
  - session handling
  - password hashing
- **`lib/roles.ts`**
  - role/permission helpers
- **`lib/activity-logger.ts`**
  - writes audit events into logging tables
- **`lib/notifications.ts`**
  - email templates and notification orchestration
- **`lib/mailer.ts`** and **`lib/email.ts`**
  - Nodemailer SMTP transport and send wrapper
- **`lib/report-generator.ts`**
  - PDF/Excel export generation
- **`lib/utils.ts`**
  - general helpers

##### Key architectural dependencies
The server layer depends on two external infrastructure services:
- **MySQL 8** for all persistent state
- **SMTP/Gmail** for notifications and reminders

#### 5) Data model and storage boundary

The repository is designed around a rich relational schema. The README describes 10 core tables, but the codebase also includes many extended/operational tables for workflows, logs, timetable management, reminders, attendance, and archives.

##### Core entities
- **users**: all identities and roles
- **departments**: departmental configuration and approval authority
- **labs**: lab metadata and ownership
- **booking_requests**: main lab booking workflow records
- **multi_lab_approvals**: per-lab approval tracking for multi-lab requests
- **multi_lab_responsible_persons**: assigns staff responsibility for each lab in a multi-lab request
- **component_requests**: equipment/component request workflow
- **component_loans**: active loan lifecycle
- **components**: inventory records
- **system_logs**: audit trail

##### Important relational pattern
The system is not built around a single flat booking table. Instead, it uses:
- one main request record
- separate approval/status fields per role
- additional tables for multi-lab approvals and staff assignment
- separate audit/log tables for traceability

This supports multi-step workflows and makes the approval chain visible in the database.

#### 6) Core business workflows

##### A. Lab booking workflow
This is one of the primary flows and spans several roles.

1. A user submits a booking request from a role-specific UI.
2. The request is stored in `booking_requests`.
3. Faculty approval happens first for student-originated requests.
4. Lab staff review follows.
5. Final approval comes from HOD or lab coordinator, depending on department configuration.
6. Approved bookings are visible in role-specific booking views.
7. Cron jobs send reminders before the booking starts.

The API sequence is role-driven and split across:
- `app/api/student/booking-requests`
- `app/api/faculty/requests/[id]/action`
- `app/api/lab-staff/requests/[id]/action`
- `app/api/hod/requests/[id]/action`
- `app/api/lab-coordinator/requests/[id]/action`

##### B. Component request / loan workflow
This is the equipment borrowing path.

1. A student or faculty member requests a component.
2. The request is stored in `component_requests`.
3. Faculty review occurs first for student requests.
4. Lab staff recommend/approve.
5. HOD can provide final approval.
6. Lab staff issue the equipment, creating a loan record in `component_loans`.
7. Return, extension, and reminder actions update the loan lifecycle.
8. Automated reminders are sent for due or overdue items.

Key endpoints are in:
- `app/api/student/component-requests`
- `app/api/faculty/component-requests`
- `app/api/lab-staff/component-requests`
- `app/api/hod/component-requests`
- `app/api/lab-staff/component-loans`

##### C. Multi-lab booking
A booking can span multiple labs. This is a distinct architectural feature, not just a field on the booking form.

- `booking_requests.lab_ids` stores the lab set
- `multi_lab_approvals` tracks each lab’s decision separately
- `multi_lab_responsible_persons` assigns the right staff member per lab

This means final approval depends on all participating labs agreeing, which is a separate aggregation step in the backend.

#### 7) Authentication, authorization, and route protection

The application uses:
- session-based auth in `lib/auth.ts`
- route protection through `middleware.ts`
- role-based access checks in API handlers and UI navigation

This creates a clear security boundary:
- public routes: landing, login, password recovery, public lab listing
- authenticated routes: dashboards and most API endpoints
- role-restricted routes: admin, faculty, student, etc.

The repo also supports password reset flows and profile maintenance through dedicated auth/user endpoints.

#### 8) Notification and email subsystem

Email is a central part of the architecture rather than an afterthought.

##### Where email is used
- booking request submission
- approval/rejection notifications
- component issuance and returns
- password reset
- reminder cron jobs
- admin digests

##### Email implementation
- **Nodemailer** with SMTP configuration
- **Testing mode** redirects messages to `ADMIN_EMAIL`
- template generation lives in `lib/notifications.ts`

This creates a clean separation:
- route handlers decide *when* to notify
- `lib/notifications.ts` decides *what* the message says
- `lib/email.ts` / `lib/mailer.ts` handle delivery

#### 9) Logging, auditing, and observability

The application records operational history in two ways:
- **`system_logs`** for broad audit logging
- additional domain-specific log tables for booking and component activity

The intent is traceability across:
- who requested what
- who approved or rejected
- who issued or returned equipment
- when state changes happened

This is important for diagramming because it acts as a side-effect path from nearly every workflow, not a standalone feature.

#### 10) Operational and maintenance endpoints

There is a separate operational subsystem under admin and cron routes:
- cleanup dummy data
- database migration triggers
- fix multi-lab status inconsistencies
- purge inactive or archived students
- send digest emails

These routes suggest the system is actively maintained through application-level admin operations, not only through external scripts.

Supporting SQL scripts in `scripts/` provide schema creation and data migrations.

#### 11) Performance and runtime characteristics

The README and code layout indicate the system is optimized around heavy relational queries:
- MySQL connection pooling in `lib/database.ts`
- batch queries to avoid N+1 behavior
- cached public lab data
- parallelized reminder dispatch
- lazy SMTP initialization

These details matter architecturally because they show the backend is designed for high-volume dashboard reads and periodic notification workloads.

#### 12) Supporting assets and tooling

##### Static and styling
- `app/globals.css` and `styles/globals.css`
- `public/` for static files

##### Tooling and project support
- `components.json` for Shadcn UI configuration
- `next.config.mjs` for app/runtime tuning
- `tsconfig.json` for TypeScript
- `package.json` and `pnpm-lock.yaml`
- documentation in `README.md`, `SETUP.md`, `design.md`, `working.md`

##### Dev/debug support
- `app/debug-api`
- `app/api/debug/*`
- test pages such as `app/test-booked-slots`

#### 13) How to think about the architecture diagram

A clear diagram for this repository should show:

- **Users by role** entering separate dashboard UIs
- **UI pages** calling role-specific **API route handlers**
- **API handlers** using shared **lib/** services
- **lib/** services writing to **MySQL**
- **notification flows** going out through **SMTP/Gmail**
- **cron jobs** triggering reminder workflows
- **audit/log tables** receiving side effects from most state changes

The most important architectural boundary is between:
- the **role-based frontend dashboards**
- the **server-side route handlers**
- the **shared persistence/notification layer**

The second key concept is the **workflow engine**: bookings and component requests are not simple CRUD objects, but multi-stage approval pipelines with role-specific transitions and multi-table state tracking.

Main entry points: [`app/dashboard/page.tsx`](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/app/dashboard/page.tsx) (Role router), [`lib/database.ts`](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/lib/database.ts) (Database), [`lib/notifications.ts`](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/lib/notifications.ts) (Notifications), [`lib/activity-logger.ts`](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/lib/activity-logger.ts) (Activity logs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph "Presentation"
  home["Landing<br/>public page<br/>[page.tsx]"]
  role_redirect["Role router<br/>dashboard route<br/>[page.tsx]"]
  student_dash["Student UI<br/>dashboard shell<br/>[page.tsx]"]
  faculty_dash["Faculty UI<br/>dashboard shell<br/>[page.tsx]"]
  labstaff_dash["Lab staff UI<br/>dashboard shell<br/>[page.tsx]"]
  hod_dash["HOD UI<br/>dashboard shell<br/>[page.tsx]"]
  coord_dash["Coordinator UI<br/>dashboard shell<br/>[page.tsx]"]
  admin_dash["Admin UI<br/>dashboard shell<br/>[page.tsx]"]
  others_dash["Others UI<br/>dashboard shell<br/>[page.tsx]"]
end

subgraph "API"
  auth_api["Auth API<br/>route handlers"]
  student_api["Student API<br/>workflow routes"]
  faculty_api["Faculty API<br/>workflow routes"]
  labstaff_api["Lab staff API<br/>workflow routes"]
  hod_api["HOD API<br/>workflow routes"]
  coord_api["Coordinator API<br/>workflow routes"]
  admin_api["Admin API<br/>admin routes"]
  cron_api["Cron API<br/>scheduled jobs"]
end

subgraph "Shared server"
  shared_ui["Shared UI<br/>layout components"]
  auth_lib["Auth + roles<br/>server utils<br/>[auth.ts]"]
  db_lib[("Database<br/>mysql access<br/>[database.ts]")]
  notify_lib["Notifications<br/>email orchestration<br/>[notifications.ts]"]
  log_lib["Activity logs<br/>audit logging<br/>[activity-logger.ts]"]
  report_lib["Report export<br/>document generation"]
end

subgraph "Infrastructure"
  mail_service(("SMTP mail<br/>external service"))
  mysql_db[("MySQL<br/>external datastore")]
end

home -->|"login/reset"| auth_api
role_redirect -->|"route"| student_dash
role_redirect -->|"route"| faculty_dash
role_redirect -->|"route"| labstaff_dash
role_redirect -->|"route"| hod_dash
role_redirect -->|"route"| coord_dash
role_redirect -->|"route"| admin_dash
role_redirect -->|"route"| others_dash
student_dash -->|"requests"| student_api
faculty_dash -->|"requests"| faculty_api
labstaff_dash -->|"requests"| labstaff_api
hod_dash -->|"requests"| hod_api
coord_dash -->|"requests"| coord_api
admin_dash -->|"requests"| admin_api
others_dash -->|"session"| auth_api
student_api -->|"authz"| auth_lib
faculty_api -->|"authz"| auth_lib
labstaff_api -->|"authz"| auth_lib
hod_api -->|"authz"| auth_lib
coord_api -->|"authz"| auth_lib
admin_api -->|"authz"| auth_lib
student_api -->|"reads/writes"| db_lib
faculty_api -->|"reads/writes"| db_lib
labstaff_api -->|"reads/writes"| db_lib
hod_api -->|"reads/writes"| db_lib
coord_api -->|"reads/writes"| db_lib
admin_api -->|"reads/writes"| db_lib
cron_api -->|"scheduled reads/writes"| db_lib
student_api -->|"emails"| notify_lib
faculty_api -->|"emails"| notify_lib
labstaff_api -->|"emails"| notify_lib
hod_api -->|"emails"| notify_lib
coord_api -->|"emails"| notify_lib
admin_api -->|"emails"| notify_lib
notify_lib -->|"deliver"| mail_service
log_lib -->|"audit writes"| db_lib
student_api -->|"audit"| log_lib
faculty_api -->|"audit"| log_lib
labstaff_api -->|"audit"| log_lib
hod_api -->|"audit"| log_lib
coord_api -->|"audit"| log_lib
admin_api -->|"audit"| log_lib
admin_api -->|"exports"| report_lib
shared_ui -->|"uses"| auth_lib
shared_ui -->|"uses"| report_lib

click home "https://github.com/abhinavdogra21/lab-managment-system/blob/main/app/page.tsx"
click role_redirect "https://github.com/abhinavdogra21/lab-managment-system/blob/main/app/dashboard/page.tsx"
click student_dash "https://github.com/abhinavdogra21/lab-managment-system/blob/main/app/student/dashboard/page.tsx"
click faculty_dash "https://github.com/abhinavdogra21/lab-managment-system/blob/main/app/faculty/dashboard/page.tsx"
click labstaff_dash "https://github.com/abhinavdogra21/lab-managment-system/blob/main/app/lab-staff/dashboard/page.tsx"
click hod_dash "https://github.com/abhinavdogra21/lab-managment-system/blob/main/app/hod/dashboard/page.tsx"
click coord_dash "https://github.com/abhinavdogra21/lab-managment-system/blob/main/app/lab-coordinator/dashboard/page.tsx"
click admin_dash "https://github.com/abhinavdogra21/lab-managment-system/blob/main/app/admin/dashboard/page.tsx"
click others_dash "https://github.com/abhinavdogra21/lab-managment-system/blob/main/app/others/dashboard/page.tsx"
click auth_api "https://github.com/abhinavdogra21/lab-managment-system/tree/main/app/api/auth"
click student_api "https://github.com/abhinavdogra21/lab-managment-system/tree/main/app/api/student"
click faculty_api "https://github.com/abhinavdogra21/lab-managment-system/tree/main/app/api/faculty"
click labstaff_api "https://github.com/abhinavdogra21/lab-managment-system/tree/main/app/api/lab-staff"
click hod_api "https://github.com/abhinavdogra21/lab-managment-system/tree/main/app/api/hod"
click coord_api "https://github.com/abhinavdogra21/lab-managment-system/tree/main/app/api/lab-coordinator"
click admin_api "https://github.com/abhinavdogra21/lab-managment-system/tree/main/app/api/admin"
click cron_api "https://github.com/abhinavdogra21/lab-managment-system/tree/main/app/api/cron"
click shared_ui "https://github.com/abhinavdogra21/lab-managment-system/blob/main/components/dashboard/dashboard-layout.tsx"
click auth_lib "https://github.com/abhinavdogra21/lab-managment-system/blob/main/lib/auth.ts"
click db_lib "https://github.com/abhinavdogra21/lab-managment-system/blob/main/lib/database.ts"
click notify_lib "https://github.com/abhinavdogra21/lab-managment-system/blob/main/lib/notifications.ts"
click log_lib "https://github.com/abhinavdogra21/lab-managment-system/blob/main/lib/activity-logger.ts"
click report_lib "https://github.com/abhinavdogra21/lab-managment-system/blob/main/lib/report-generator.ts"

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 home,role_redirect,student_dash,faculty_dash,labstaff_dash,hod_dash,coord_dash,admin_dash,others_dash toneBlue
class auth_api,student_api,faculty_api,labstaff_api,hod_api,coord_api,admin_api,cron_api toneAmber
class shared_ui,auth_lib,db_lib,notify_lib,log_lib,report_lib toneMint
class mail_service,mysql_db toneRose
```

## Components

### Presentation

Role-based dashboards and public pages

- [Landing](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/app/page.tsx): public page · Entry and auth-facing routes · `app/page.tsx`
- [Role router](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/app/dashboard/page.tsx): dashboard route · Redirects users to the right dashboard · `app/dashboard/page.tsx`
- [Student UI](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/app/student/dashboard/page.tsx): dashboard shell · Student booking and request workspace · `app/student/dashboard/page.tsx`
- [Faculty UI](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/app/faculty/dashboard/page.tsx): dashboard shell · Faculty approvals and requests workspace · `app/faculty/dashboard/page.tsx`
- [Lab staff UI](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/app/lab-staff/dashboard/page.tsx): dashboard shell · Operations, approvals, inventory, and loans · `app/lab-staff/dashboard/page.tsx`
- [HOD UI](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/app/hod/dashboard/page.tsx): dashboard shell · Department-level approvals and analytics · `app/hod/dashboard/page.tsx`
- [Coordinator UI](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/app/lab-coordinator/dashboard/page.tsx): dashboard shell · Final approval and analytics workspace · `app/lab-coordinator/dashboard/page.tsx`
- [Admin UI](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/app/admin/dashboard/page.tsx): dashboard shell · Administration, maintenance, and reporting · `app/admin/dashboard/page.tsx`
- [Others UI](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/app/others/dashboard/page.tsx): dashboard shell · Non-student booking and request workspace · `app/others/dashboard/page.tsx`

### API

Next.js route handlers for workflow operations

- [Auth API](https://github.com/abhinavdogra21/lab-managment-system/tree/HEAD/app/api/auth): route handlers · Login, logout, session, and password reset · `app/api/auth`
- [Student API](https://github.com/abhinavdogra21/lab-managment-system/tree/HEAD/app/api/student): workflow routes · Student bookings, component requests, and loans · `app/api/student`
- [Faculty API](https://github.com/abhinavdogra21/lab-managment-system/tree/HEAD/app/api/faculty): workflow routes · Faculty approvals, logs, and component reviews · `app/api/faculty`
- [Lab staff API](https://github.com/abhinavdogra21/lab-managment-system/tree/HEAD/app/api/lab-staff): workflow routes · Staff approvals, issue-return, inventory, and timetables · `app/api/lab-staff`
- [HOD API](https://github.com/abhinavdogra21/lab-managment-system/tree/HEAD/app/api/hod): workflow routes · Department approvals and analytics · `app/api/hod`
- [Coordinator API](https://github.com/abhinavdogra21/lab-managment-system/tree/HEAD/app/api/lab-coordinator): workflow routes · Final approval and lab analytics · `app/api/lab-coordinator`
- [Admin API](https://github.com/abhinavdogra21/lab-managment-system/tree/HEAD/app/api/admin): admin routes · User, lab, department, report, and maintenance endpoints · `app/api/admin`
- [Cron API](https://github.com/abhinavdogra21/lab-managment-system/tree/HEAD/app/api/cron): scheduled jobs · Reminder and repair jobs · `app/api/cron`

### Shared server

Reusable backend utilities and app-wide UI

- [Shared UI](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/components/dashboard/dashboard-layout.tsx): layout components · Dashboard shell and auth/report components · `components/dashboard/dashboard-layout.tsx`
- [Auth + roles](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/lib/auth.ts): server utils · Sessions, password hashing, and role checks · `lib/auth.ts`
- [Database](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/lib/database.ts): mysql access · Connection pool and query helpers · `lib/database.ts`
- [Notifications](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/lib/notifications.ts): email orchestration · Templates and outbound notification flow · `lib/notifications.ts`
- [Activity logs](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/lib/activity-logger.ts): audit logging · Writes workflow and system audit events · `lib/activity-logger.ts`
- [Report export](https://github.com/abhinavdogra21/lab-managment-system/blob/HEAD/lib/report-generator.ts): document generation · PDF and spreadsheet generation · `lib/report-generator.ts`

### Infrastructure

External services and persistent storage

- **SMTP mail**: external service · Outgoing email delivery
- **MySQL**: external datastore · Persistent relational workflow store

## Connections

- Landing → Auth API: login/reset · Public auth flows reach server handlers
- Role router → Student UI: route · Users are sent to role dashboards
- Role router → Faculty UI: route · Users are sent to role dashboards
- Role router → Lab staff UI: route · Users are sent to role dashboards
- Role router → HOD UI: route · Users are sent to role dashboards
- Role router → Coordinator UI: route · Users are sent to role dashboards
- Role router → Admin UI: route · Users are sent to role dashboards
- Role router → Others UI: route · Users are sent to role dashboards
- Student UI → Student API: requests · Student UI drives booking and component workflows
- Faculty UI → Faculty API: requests · Faculty UI drives approval and review flows
- Lab staff UI → Lab staff API: requests · Staff UI drives operational workflows
- HOD UI → HOD API: requests · HOD UI drives department approvals
- Coordinator UI → Coordinator API: requests · Coordinator UI drives final approval flows
- Admin UI → Admin API: requests · Admin UI drives management and maintenance
- Others UI → Auth API: session · Authenticated access is mediated by auth routes
- Student API → Auth + roles: authz · Role and session checks are centralized
- Faculty API → Auth + roles: authz · Role and session checks are centralized
- Lab staff API → Auth + roles: authz · Role and session checks are centralized
- HOD API → Auth + roles: authz · Role and session checks are centralized
- Coordinator API → Auth + roles: authz · Role and session checks are centralized
- Admin API → Auth + roles: authz · Role and session checks are centralized
- Student API → Database: reads/writes · Workflow state is persisted in MySQL
- Faculty API → Database: reads/writes · Workflow state is persisted in MySQL
- Lab staff API → Database: reads/writes · Workflow state is persisted in MySQL
- HOD API → Database: reads/writes · Workflow state is persisted in MySQL
- Coordinator API → Database: reads/writes · Workflow state is persisted in MySQL
- Admin API → Database: reads/writes · Workflow state is persisted in MySQL
- Cron API → Database: scheduled reads/writes · Reminder and repair jobs touch persistent state
- Student API → Notifications: emails · Requests and reminders trigger notifications
- Faculty API → Notifications: emails · Approvals and updates trigger notifications
- Lab staff API → Notifications: emails · Issue-return and reminders trigger notifications
- HOD API → Notifications: emails · Approval events trigger notifications
- Coordinator API → Notifications: emails · Final decisions trigger notifications
- Admin API → Notifications: emails · Admin digests and password flows trigger notifications
- Notifications → SMTP mail: deliver · SMTP handles outbound email delivery
- Activity logs → Database: audit writes · Audit events are stored in MySQL tables
- Student API → Activity logs: audit · Workflow actions are logged
- Faculty API → Activity logs: audit · Workflow actions are logged
- Lab staff API → Activity logs: audit · Workflow actions are logged
- HOD API → Activity logs: audit · Workflow actions are logged
- Coordinator API → Activity logs: audit · Workflow actions are logged
- Admin API → Activity logs: audit · Maintenance and management actions are logged
- Admin API → Report export: exports · Reports are generated for admin use
- Shared UI → Auth + roles: uses · Shared UI relies on auth/session state
- Shared UI → Report export: uses · Report components use export generation
