# eyzen08/sti-vio-log architecture

> Architecture diagram of the GitHub repository eyzen08/sti-vio-log, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eyzen08/sti-vio-log
- Repository: https://github.com/eyzen08/sti-vio-log

## Overview

STI Vio-Log is a role-scoped student discipline and incident-management portal. Users sign in and work through student and violation records; required community service is assigned to departments, recorded through QR time-in/time-out, reviewed for credit, and reflected in clearance and certificates. The graph also preserves the documented student, communication, reporting, and administrative capabilities. README workflow documentation supports the domain-stage links; sampled excerpts confirm selected routing, database, and service calls, so uncertain controller wiring is omitted.

Main entry points: [`backend/src/server.js`](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/server.js) (HTTP API server), [`frontend/src/App.jsx`](https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/App.jsx) (Role-based portal), [`backend/src/config/database.js`](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/config/database.js) (PostgreSQL database), [`backend/src/services/communityServiceSessionService.js`](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/services/communityServiceSessionService.js) (Session processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["User portal"]
  node_app["Role-based portal<br/>[App.jsx]"]
  node_route_map["Role route map<br/>[routes.js]"]
  node_api_client["API client<br/>[api.js]"]
  node_login_ui["Login and onboarding<br/>[LoginPage.jsx]"]
  node_student_ui["Student views"]
  node_admin_ui["Administration views<br/>[AdminDashboard.jsx]"]
  node_department_ui["Department views"]
end

subgraph group_identity["Identity and administration"]
  node_backend["HTTP API server<br/>[server.js]"]
  node_auth["Authentication and access<br/>[authMiddleware.js]"]
  node_auth_routes["Authentication routes<br/>[authRoutes.js]"]
  node_student_records["Student records"]
end

subgraph group_discipline["Discipline workflow"]
  node_violation["Violation workflow"]
  node_service_assignment["Service assignment"]
end

subgraph group_service["Service and attendance"]
  node_qr_attendance["QR attendance<br/>[qrController.js]"]
  node_session_service["Session processing"]
  node_result_review["Service result review"]
end

subgraph group_outcomes["Clearance and oversight"]
  node_clearance["Clearance processing"]
  node_certificates["Clearance certificates"]
  node_oversight["Reports, messages, audit"]
end

node_users(("Students and staff"))
node_db[("PostgreSQL database<br/>[database.js]")]
node_email["Email delivery"]

node_users -->|"use portal"| node_app
node_app -->|"resolve role routes"| node_route_map
node_app -->|"request data"| node_api_client
node_app -->|"show sign-in"| node_login_ui
node_app -->|"show student views"| node_student_ui
node_app -->|"show admin views"| node_admin_ui
node_app -->|"show department views"| node_department_ui
node_api_client -->|"HTTP requests"| node_backend
node_backend -->|"authenticate and authorize"| node_auth
node_backend -->|"dispatch auth routes"| node_auth_routes
node_auth_routes -->|"read and write"| node_db
node_backend -->|"dispatch student routes"| node_student_records
node_student_records -->|"read and write"| node_db
node_backend -->|"dispatch violation operations"| node_violation
node_violation -->|"read and write"| node_db
node_backend -->|"dispatch service routes"| node_service_assignment
node_service_assignment -->|"read and write"| node_db
node_backend -->|"dispatch QR routes"| node_qr_attendance
node_qr_attendance -->|"process attendance"| node_session_service
node_session_service -->|"record sessions and progress"| node_db
node_session_service -->|"transition violation"| node_violation
node_session_service -->|"notify attendance staff"| node_oversight
node_result_review -->|"submit review request"| node_backend
node_backend -->|"dispatch clearance routes"| node_clearance
node_clearance -->|"check eligibility and update"| node_db
node_clearance -->|"evaluate certificate eligibility"| node_certificates
node_backend -->|"dispatch certificate routes"| node_certificates
node_certificates -->|"read and write"| node_db
node_certificates -.->|"send certificate"| node_email
node_backend -->|"dispatch reporting routes"| node_oversight
node_oversight -->|"read and write"| node_db
node_violation -->|"require service"| node_service_assignment
node_service_assignment -->|"assigned service attendance"| node_qr_attendance
node_session_service -->|"pending result for review"| node_result_review
node_result_review -->|"approved credit informs standing"| node_clearance
node_clearance -->|"eligible for certificate"| node_certificates

click node_app "https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/App.jsx"
click node_route_map "https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/lib/routes.js"
click node_api_client "https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/lib/api.js"
click node_login_ui "https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/components/LoginPage.jsx"
click node_student_ui "https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/components/StudentDashboard.jsx"
click node_admin_ui "https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/components/AdminDashboard.jsx"
click node_department_ui "https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/components/DepartmentDashboard.jsx"
click node_backend "https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/server.js"
click node_auth "https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/middleware/authMiddleware.js"
click node_auth_routes "https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/routes/authRoutes.js"
click node_student_records "https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/controllers/studentController.js"
click node_violation "https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/services/violationWorkflowService.js"
click node_service_assignment "https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/controllers/communityServiceController.js"
click node_qr_attendance "https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/controllers/qrController.js"
click node_session_service "https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/services/communityServiceSessionService.js"
click node_result_review "https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/components/ServiceResultReview.jsx"
click node_clearance "https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/controllers/clearanceController.js"
click node_certificates "https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/controllers/clearanceCertificateController.js"
click node_oversight "https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/controllers/reportController.js"
click node_db "https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/config/database.js"

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_app,node_route_map,node_api_client,node_login_ui,node_student_ui,node_admin_ui,node_department_ui toneBlue
class node_backend,node_auth,node_auth_routes,node_student_records,node_db toneAmber
class node_violation,node_service_assignment toneMint
class node_qr_attendance,node_session_service,node_result_review toneRose
class node_clearance,node_certificates,node_oversight,node_users,node_email toneIndigo
```

## Components

### User portal

- [Role-based portal](https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Role route map](https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/lib/routes.js): `frontend/src/lib/routes.js`
- [API client](https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/lib/api.js): `frontend/src/lib/api.js`
- [Login and onboarding](https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/components/LoginPage.jsx): `frontend/src/components/LoginPage.jsx`
- [Student views](https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/components/StudentDashboard.jsx): `frontend/src/components/StudentDashboard.jsx`
- [Administration views](https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/components/AdminDashboard.jsx): `frontend/src/components/AdminDashboard.jsx`
- [Department views](https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/components/DepartmentDashboard.jsx): `frontend/src/components/DepartmentDashboard.jsx`

### Identity and administration

- [HTTP API server](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/server.js): `backend/src/server.js`
- [Authentication and access](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/middleware/authMiddleware.js): `backend/src/middleware/authMiddleware.js`
- [Authentication routes](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/routes/authRoutes.js): `backend/src/routes/authRoutes.js`
- [Student records](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/controllers/studentController.js): `backend/src/controllers/studentController.js`

### Discipline workflow

- [Violation workflow](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/services/violationWorkflowService.js): `backend/src/services/violationWorkflowService.js`
- [Service assignment](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/controllers/communityServiceController.js): `backend/src/controllers/communityServiceController.js`

### Service and attendance

- [QR attendance](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/controllers/qrController.js): `backend/src/controllers/qrController.js`
- [Session processing](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/services/communityServiceSessionService.js): `backend/src/services/communityServiceSessionService.js`
- [Service result review](https://github.com/eyzen08/sti-vio-log/blob/main/frontend/src/components/ServiceResultReview.jsx): `frontend/src/components/ServiceResultReview.jsx`

### Clearance and oversight

- [Clearance processing](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/controllers/clearanceController.js): `backend/src/controllers/clearanceController.js`
- [Clearance certificates](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/controllers/clearanceCertificateController.js): `backend/src/controllers/clearanceCertificateController.js`
- [Reports, messages, audit](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/controllers/reportController.js): `backend/src/controllers/reportController.js`

### Other components

- **Students and staff**
- [PostgreSQL database](https://github.com/eyzen08/sti-vio-log/blob/main/backend/src/config/database.js): `backend/src/config/database.js`
- **Email delivery**

## Connections

- Students and staff → Role-based portal: use portal
- Role-based portal → Role route map: resolve role routes
- Role-based portal → API client: request data
- Role-based portal → Login and onboarding: show sign-in
- Role-based portal → Student views: show student views
- Role-based portal → Administration views: show admin views
- Role-based portal → Department views: show department views
- API client → HTTP API server: HTTP requests
- HTTP API server → Authentication and access: authenticate and authorize
- HTTP API server → Authentication routes: dispatch auth routes
- Authentication routes → PostgreSQL database: read and write
- HTTP API server → Student records: dispatch student routes
- Student records → PostgreSQL database: read and write
- HTTP API server → Violation workflow: dispatch violation operations
- Violation workflow → PostgreSQL database: read and write
- HTTP API server → Service assignment: dispatch service routes
- Service assignment → PostgreSQL database: read and write
- HTTP API server → QR attendance: dispatch QR routes
- QR attendance → Session processing: process attendance
- Session processing → PostgreSQL database: record sessions and progress
- Session processing → Violation workflow: transition violation
- Session processing → Reports, messages, audit: notify attendance staff
- Service result review → HTTP API server: submit review request
- HTTP API server → Clearance processing: dispatch clearance routes
- Clearance processing → PostgreSQL database: check eligibility and update
- Clearance processing → Clearance certificates: evaluate certificate eligibility
- HTTP API server → Clearance certificates: dispatch certificate routes
- Clearance certificates → PostgreSQL database: read and write
- Clearance certificates → Email delivery: send certificate
- HTTP API server → Reports, messages, audit: dispatch reporting routes
- Reports, messages, audit → PostgreSQL database: read and write
- Violation workflow → Service assignment: require service
- Service assignment → QR attendance: assigned service attendance
- Session processing → Service result review: pending result for review
- Service result review → Clearance processing: approved credit informs standing
- Clearance processing → Clearance certificates: eligible for certificate
