# kakashimoto14/comlab-reservation-system architecture

> Architecture diagram of the GitHub repository kakashimoto14/comlab-reservation-system, 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/kakashimoto14/comlab-reservation-system
- Repository: https://github.com/kakashimoto14/comlab-reservation-system

## Overview

ComPort is a role-based academic laboratory reservation and operations platform. Students browse laboratories and request whole-lab or PC reservations; staff and administrators publish schedules and review requests, while administrators also manage accounts, staff assignments, and calendar events. The React application calls an Express API whose controllers delegate business rules to services backed by Prisma. Dashboards, reports, notifications, and the authenticated assistant support these workflows. The README documents email, Google Calendar, and optional AI integrations; sampled source confirms some wiring, but not every integration path.

Main entry points: [`frontend/src/api/services.ts`](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/frontend/src/api/services.ts) (API client services), [`backend/src/config/prisma.ts`](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/config/prisma.ts) (Prisma data access), [`backend/src/services/ReservationService.ts`](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/ReservationService.ts) (Reservation workflow), [`frontend/src/App.tsx`](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/frontend/src/App.tsx) (Role-based pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["Role-based pages<br/>[App.tsx]"]
  node_webapi["API client services<br/>[services.ts]"]
  node_authcontext["Session context<br/>[AuthContext.tsx]"]
end

subgraph group_api["API and identity"]
  node_authroutes["Authentication routes<br/>[auth.routes.ts]"]
  node_authcontroller["Authentication controller<br/>[AuthController.ts]"]
  node_authservice["Authentication service<br/>[AuthService.ts]"]
  node_prisma["Prisma data access<br/>[prisma.ts]"]
  node_database[("Application database")]
end

subgraph group_operations["Lab operations"]
  node_labroutes["Laboratory routes"]
  node_labcontroller["Laboratory controller"]
  node_labservice["Laboratory service"]
  node_reservation["Reservation workflow"]
  node_schedules["Schedule management<br/>[ScheduleService.ts]"]
  node_calendar["Calendar views and events<br/>[CalendarService.ts]"]
  node_staff["Staff operations<br/>[StaffService.ts]"]
end

subgraph group_support["Shared capabilities"]
  node_dashboard["Dashboards and reports"]
  node_assistant["Reservation assistant"]
  node_notifications["Notifications and reminders"]
  node_inbox["Notification inbox and streaming"]
  node_activity["Activity logging"]
  node_email["Email delivery<br/>[EmailService.ts]"]
  node_googlecalendar["Google Calendar"]
end

node_users(("Students, staff, admins"))
node_ai_provider["Optional AI provider"]

node_users -->|"use role pages"| node_webapp
node_webapp -->|"reads session"| node_authcontext
node_webapp -->|"requests operations"| node_webapi
node_webapi -->|"calls auth API"| node_authroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authcontroller -->|"invokes"| node_authservice
node_authservice -->|"reads and writes"| node_prisma
node_authservice -->|"sends messages"| node_email
node_webapi -->|"calls lab API"| node_labroutes
node_labroutes -->|"dispatches"| node_labcontroller
node_labcontroller -->|"invokes"| node_labservice
node_labservice -->|"reads and writes"| node_prisma
node_webapi -->|"requests reservations"| node_reservation
node_webapi -->|"manages schedules"| node_schedules
node_webapi -->|"manages calendar"| node_calendar
node_webapi -->|"manages staff"| node_staff
node_webapi -->|"loads summaries"| node_dashboard
node_webapi -->|"sends assistant requests"| node_assistant
node_assistant -.->|"optional inference"| node_ai_provider
node_webapi -->|"reads notifications"| node_inbox
node_notifications -->|"updates inbox"| node_inbox
node_notifications -.->|"delivers alerts"| node_email
node_reservation -->|"emits reservation events"| node_notifications
node_reservation -->|"records activity"| node_activity
node_reservation -->|"reads and writes"| node_prisma
node_schedules -->|"reads and writes"| node_prisma
node_calendar -->|"reads and writes"| node_prisma
node_staff -->|"reads and writes"| node_prisma
node_dashboard -->|"reads metrics"| node_prisma
node_prisma -->|"queries"| node_database
node_calendar -.->|"optional sync"| node_googlecalendar

click node_webapp "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/frontend/src/App.tsx"
click node_webapi "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/frontend/src/api/services.ts"
click node_authcontext "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/frontend/src/store/AuthContext.tsx"
click node_authroutes "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/routes/auth.routes.ts"
click node_authcontroller "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/controllers/AuthController.ts"
click node_authservice "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/AuthService.ts"
click node_labroutes "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/routes/laboratory.routes.ts"
click node_labcontroller "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/controllers/LaboratoryController.ts"
click node_labservice "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/LaboratoryService.ts"
click node_reservation "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/ReservationService.ts"
click node_schedules "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/ScheduleService.ts"
click node_calendar "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/CalendarService.ts"
click node_staff "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/StaffService.ts"
click node_dashboard "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/DashboardService.ts"
click node_assistant "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/ReservationAssistantService.ts"
click node_notifications "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/NotificationService.ts"
click node_inbox "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/NotificationInboxService.ts"
click node_activity "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/ActivityLogService.ts"
click node_prisma "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/config/prisma.ts"
click node_email "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/EmailService.ts"
click node_googlecalendar "https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/GoogleCalendarService.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 node_webapp,node_webapi,node_authcontext toneBlue
class node_authroutes,node_authcontroller,node_authservice,node_prisma,node_database toneAmber
class node_labroutes,node_labcontroller,node_labservice,node_reservation,node_schedules,node_calendar,node_staff toneMint
class node_dashboard,node_assistant,node_notifications,node_inbox,node_activity,node_email,node_googlecalendar toneRose
class node_users,node_ai_provider toneIndigo
```

## Components

### Web application

- [Role-based pages](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client services](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/frontend/src/api/services.ts): `frontend/src/api/services.ts`
- [Session context](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/frontend/src/store/AuthContext.tsx): `frontend/src/store/AuthContext.tsx`

### API and identity

- [Authentication routes](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/routes/auth.routes.ts): `backend/src/routes/auth.routes.ts`
- [Authentication controller](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/controllers/AuthController.ts): `backend/src/controllers/AuthController.ts`
- [Authentication service](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/AuthService.ts): `backend/src/services/AuthService.ts`
- [Prisma data access](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/config/prisma.ts): `backend/src/config/prisma.ts`
- **Application database**

### Lab operations

- [Laboratory routes](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/routes/laboratory.routes.ts): `backend/src/routes/laboratory.routes.ts`
- [Laboratory controller](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/controllers/LaboratoryController.ts): `backend/src/controllers/LaboratoryController.ts`
- [Laboratory service](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/LaboratoryService.ts): `backend/src/services/LaboratoryService.ts`
- [Reservation workflow](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/ReservationService.ts): `backend/src/services/ReservationService.ts`
- [Schedule management](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/ScheduleService.ts): `backend/src/services/ScheduleService.ts`
- [Calendar views and events](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/CalendarService.ts): `backend/src/services/CalendarService.ts`
- [Staff operations](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/StaffService.ts): `backend/src/services/StaffService.ts`

### Shared capabilities

- [Dashboards and reports](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/DashboardService.ts): `backend/src/services/DashboardService.ts`
- [Reservation assistant](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/ReservationAssistantService.ts): `backend/src/services/ReservationAssistantService.ts`
- [Notifications and reminders](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/NotificationService.ts): `backend/src/services/NotificationService.ts`
- [Notification inbox and streaming](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/NotificationInboxService.ts): `backend/src/services/NotificationInboxService.ts`
- [Activity logging](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/ActivityLogService.ts): `backend/src/services/ActivityLogService.ts`
- [Email delivery](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/EmailService.ts): `backend/src/services/EmailService.ts`
- [Google Calendar](https://github.com/kakashimoto14/comlab-reservation-system/blob/main/backend/src/services/GoogleCalendarService.ts): `backend/src/services/GoogleCalendarService.ts`

### Other components

- **Students, staff, admins**
- **Optional AI provider**

## Connections

- Students, staff, admins → Role-based pages: use role pages
- Role-based pages → Session context: reads session
- Role-based pages → API client services: requests operations
- API client services → Authentication routes: calls auth API
- Authentication routes → Authentication controller: dispatches
- Authentication controller → Authentication service: invokes
- Authentication service → Prisma data access: reads and writes
- Authentication service → Email delivery: sends messages
- API client services → Laboratory routes: calls lab API
- Laboratory routes → Laboratory controller: dispatches
- Laboratory controller → Laboratory service: invokes
- Laboratory service → Prisma data access: reads and writes
- API client services → Reservation workflow: requests reservations
- API client services → Schedule management: manages schedules
- API client services → Calendar views and events: manages calendar
- API client services → Staff operations: manages staff
- API client services → Dashboards and reports: loads summaries
- API client services → Reservation assistant: sends assistant requests
- Reservation assistant → Optional AI provider: optional inference
- API client services → Notification inbox and streaming: reads notifications
- Notifications and reminders → Notification inbox and streaming: updates inbox
- Notifications and reminders → Email delivery: delivers alerts
- Reservation workflow → Notifications and reminders: emits reservation events
- Reservation workflow → Activity logging: records activity
- Reservation workflow → Prisma data access: reads and writes
- Schedule management → Prisma data access: reads and writes
- Calendar views and events → Prisma data access: reads and writes
- Staff operations → Prisma data access: reads and writes
- Dashboards and reports → Prisma data access: reads metrics
- Prisma data access → Application database: queries
- Calendar views and events → Google Calendar: optional sync
