# joseph11330/cse1-syntax-gc-rfb architecture

> Architecture diagram of the GitHub repository joseph11330/cse1-syntax-gc-rfb, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joseph11330/cse1-syntax-gc-rfb
- Repository: https://github.com/joseph11330/cse1-syntax-gc-rfb

## Overview

GC-FRB is a campus room and facility booking product with separate student and admin web experiences and a backend API. Students register or sign in, discover spaces, request bookings, and manage their bookings; admins manage spaces, review reservations, and view reports. The API enforces role-based access and booking rules against Supabase. The repository also includes terminal-based admin and student workflows. Some subsystem links rely on the README or SOURCE INDEX because their source was not excerpted; those limits are reflected in the edges.

Main entry points: [`Gcfrb_backend/src/config/supabase.ts`](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/config/supabase.ts) (Supabase database), [`Gcfrb_backend/src/lib/bookingService.ts`](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/lib/bookingService.ts) (Booking service rules), [`GC-FRB/src/api.js`](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/GC-FRB/src/api.js) (API client), [`Gcfrb_backend/src/routes/adminRoutes.ts`](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/routes/adminRoutes.ts) (Admin routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experiences"]
  node_web_router["Web app router<br/>[App.jsx]"]
  node_booker["Student booking app<br/>[BookerApp.jsx]"]
  node_registration["Student registration<br/>[RegisterPage.jsx]"]
  node_admin_ui["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["API and access"]
  node_admin_routes["Admin routes<br/>[adminRoutes.ts]"]
  node_student_routes["Student routes<br/>[studentRoutes.ts]"]
  node_room_routes["Room routes<br/>[roomRoutes.ts]"]
  node_auth_guard["Auth and role guard<br/>[authMiddleware.ts]"]
  node_student_auth["Student authentication<br/>[studentAuth.ts]"]
  node_admin_auth["Admin authentication<br/>[adminAuth.ts]"]
end

subgraph group_booking["Booking operations"]
  node_student_booking["Student booking management"]
  node_reservation["Reservation requests<br/>[roomReservation.ts]"]
  node_admin_booking["Admin bookings and reports<br/>[adminDashboard.ts]"]
  node_room_admin["Facility administration<br/>[adminRooms.ts]"]
end

subgraph group_data["Data and rules"]
  node_booking_service["Booking service rules<br/>[bookingService.ts]"]
  node_booking_helpers["Booking utilities<br/>[bookings.ts]"]
  node_supabase[("Supabase database<br/>[supabase.ts]")]
end

subgraph group_terminal["Terminal workflows"]
  node_terminal_auth["Terminal sign-in<br/>[terminalAuth.ts]"]
  node_student_terminal["Student terminal<br/>[studentTerminal.ts]"]
  node_admin_terminal["Admin terminal<br/>[adminTerminal.ts]"]
end

node_visitor(("Visitor"))
node_admin(("Admin"))
node_student(("Student"))

node_visitor -->|"opens app"| node_web_router
node_admin -->|"uses"| node_admin_ui
node_student -->|"uses"| node_booker
node_web_router -->|"routes admin"| node_admin_ui
node_web_router -->|"routes visitors"| node_booker
node_booker -->|"requests data"| node_api_client
node_registration -->|"submits registration"| node_api_client
node_admin_ui -->|"requests admin data"| node_api_client
node_api_client -.->|"calls API"| node_student_routes
node_api_client -.->|"calls API"| node_admin_routes
node_api_client -.->|"calls API"| node_room_routes
node_admin_routes -->|"routes login"| node_admin_auth
node_admin_routes -->|"routes booking actions"| node_admin_booking
node_admin_routes -->|"routes room actions"| node_room_admin
node_admin_routes -->|"guards requests"| node_auth_guard
node_student_routes -->|"routes sign-in"| node_student_auth
node_student_routes -->|"routes bookings"| node_student_booking
node_student_routes -->|"guards requests"| node_auth_guard
node_room_routes -->|"routes reservations"| node_reservation
node_room_routes -->|"guards requests"| node_auth_guard
node_student_auth -->|"reads accounts"| node_supabase
node_admin_auth -->|"reads accounts"| node_supabase
node_student_booking -->|"shapes bookings"| node_booking_helpers
node_student_booking -->|"reads bookings"| node_supabase
node_reservation -->|"checks and saves"| node_booking_service
node_reservation -->|"reads booking data"| node_supabase
node_admin_booking -->|"uses booking rules"| node_booking_service
node_admin_booking -->|"shapes booking data"| node_booking_helpers
node_admin_booking -->|"reads reports"| node_supabase
node_room_admin -->|"uses booking rules"| node_booking_service
node_room_admin -->|"manages rooms"| node_supabase
node_booking_service -->|"uses time rules"| node_booking_helpers
node_booking_service -->|"checks and writes"| node_supabase
node_student_terminal -->|"authenticates"| node_terminal_auth
node_admin_terminal -->|"authenticates"| node_terminal_auth
node_student_terminal -->|"uses booking rules"| node_booking_service
node_student_terminal -->|"uses booking utilities"| node_booking_helpers
node_admin_terminal -->|"uses booking rules"| node_booking_service
node_admin_terminal -->|"uses booking utilities"| node_booking_helpers
node_terminal_auth -->|"checks accounts"| node_supabase

click node_web_router "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/GC-FRB/src/App.jsx"
click node_booker "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/GC-FRB/src/booker/BookerApp.jsx"
click node_registration "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/GC-FRB/src/booker/RegisterPage.jsx"
click node_admin_ui "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/GC-FRB/src/admin/AdminDashboard.jsx"
click node_api_client "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/GC-FRB/src/api.js"
click node_admin_routes "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/routes/adminRoutes.ts"
click node_student_routes "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/routes/studentRoutes.ts"
click node_room_routes "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/routes/roomRoutes.ts"
click node_auth_guard "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/middleware/authMiddleware.ts"
click node_student_auth "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/controllers/studentAuth.ts"
click node_admin_auth "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/controllers/adminAuth.ts"
click node_student_booking "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/controllers/studentDashboard.ts"
click node_reservation "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/controllers/roomReservation.ts"
click node_admin_booking "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/controllers/adminDashboard.ts"
click node_room_admin "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/controllers/adminRooms.ts"
click node_booking_service "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/lib/bookingService.ts"
click node_booking_helpers "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/lib/bookings.ts"
click node_supabase "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/config/supabase.ts"
click node_terminal_auth "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/cli/terminalAuth.ts"
click node_student_terminal "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/cli/studentTerminal.ts"
click node_admin_terminal "https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/cli/adminTerminal.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_web_router,node_booker,node_registration,node_admin_ui,node_api_client toneBlue
class node_admin_routes,node_student_routes,node_room_routes,node_auth_guard,node_student_auth,node_admin_auth toneAmber
class node_student_booking,node_reservation,node_admin_booking,node_room_admin toneMint
class node_booking_service,node_booking_helpers,node_supabase toneRose
class node_terminal_auth,node_student_terminal,node_admin_terminal,node_visitor,node_admin,node_student toneIndigo
```

## Components

### Web experiences

- [Web app router](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/GC-FRB/src/App.jsx): `GC-FRB/src/App.jsx`
- [Student booking app](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/GC-FRB/src/booker/BookerApp.jsx): `GC-FRB/src/booker/BookerApp.jsx`
- [Student registration](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/GC-FRB/src/booker/RegisterPage.jsx): `GC-FRB/src/booker/RegisterPage.jsx`
- [Admin dashboard](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/GC-FRB/src/admin/AdminDashboard.jsx): `GC-FRB/src/admin/AdminDashboard.jsx`
- [API client](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/GC-FRB/src/api.js): `GC-FRB/src/api.js`

### API and access

- [Admin routes](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/routes/adminRoutes.ts): `Gcfrb_backend/src/routes/adminRoutes.ts`
- [Student routes](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/routes/studentRoutes.ts): `Gcfrb_backend/src/routes/studentRoutes.ts`
- [Room routes](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/routes/roomRoutes.ts): `Gcfrb_backend/src/routes/roomRoutes.ts`
- [Auth and role guard](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/middleware/authMiddleware.ts): `Gcfrb_backend/src/middleware/authMiddleware.ts`
- [Student authentication](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/controllers/studentAuth.ts): `Gcfrb_backend/src/controllers/studentAuth.ts`
- [Admin authentication](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/controllers/adminAuth.ts): `Gcfrb_backend/src/controllers/adminAuth.ts`

### Booking operations

- [Student booking management](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/controllers/studentDashboard.ts): `Gcfrb_backend/src/controllers/studentDashboard.ts`
- [Reservation requests](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/controllers/roomReservation.ts): `Gcfrb_backend/src/controllers/roomReservation.ts`
- [Admin bookings and reports](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/controllers/adminDashboard.ts): `Gcfrb_backend/src/controllers/adminDashboard.ts`
- [Facility administration](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/controllers/adminRooms.ts): `Gcfrb_backend/src/controllers/adminRooms.ts`

### Data and rules

- [Booking service rules](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/lib/bookingService.ts): `Gcfrb_backend/src/lib/bookingService.ts`
- [Booking utilities](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/lib/bookings.ts): `Gcfrb_backend/src/lib/bookings.ts`
- [Supabase database](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/config/supabase.ts): `Gcfrb_backend/src/config/supabase.ts`

### Terminal workflows

- [Terminal sign-in](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/cli/terminalAuth.ts): `Gcfrb_backend/src/cli/terminalAuth.ts`
- [Student terminal](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/cli/studentTerminal.ts): `Gcfrb_backend/src/cli/studentTerminal.ts`
- [Admin terminal](https://github.com/joseph11330/cse1-syntax-gc-rfb/blob/main/Gcfrb_backend/src/cli/adminTerminal.ts): `Gcfrb_backend/src/cli/adminTerminal.ts`

### Other components

- **Visitor**
- **Admin**
- **Student**

## Connections

- Visitor → Web app router: opens app (evidence: `GC-FRB/src/App.jsx`)
- Admin → Admin dashboard: uses
- Student → Student booking app: uses
- Web app router → Admin dashboard: routes admin (evidence: `GC-FRB/src/App.jsx`)
- Web app router → Student booking app: routes visitors (evidence: `GC-FRB/src/App.jsx`)
- Student booking app → API client: requests data (evidence: `GC-FRB/src/booker/BookerApp.jsx`)
- Student registration → API client: submits registration (evidence: `GC-FRB/src/booker/RegisterPage.jsx`)
- Admin dashboard → API client: requests admin data (evidence: `GC-FRB/src/admin/AdminDashboard.jsx`)
- API client → Student routes: calls API (evidence: `README.md`)
- API client → Admin routes: calls API (evidence: `README.md`)
- API client → Room routes: calls API (evidence: `README.md`)
- Admin routes → Admin authentication: routes login (evidence: `Gcfrb_backend/src/routes/adminRoutes.ts`)
- Admin routes → Admin bookings and reports: routes booking actions (evidence: `Gcfrb_backend/src/routes/adminRoutes.ts`)
- Admin routes → Facility administration: routes room actions (evidence: `Gcfrb_backend/src/routes/adminRoutes.ts`)
- Admin routes → Auth and role guard: guards requests (evidence: `Gcfrb_backend/src/routes/adminRoutes.ts`)
- Student routes → Student authentication: routes sign-in (evidence: `Gcfrb_backend/src/routes/studentRoutes.ts`)
- Student routes → Student booking management: routes bookings (evidence: `Gcfrb_backend/src/routes/studentRoutes.ts`)
- Student routes → Auth and role guard: guards requests (evidence: `Gcfrb_backend/src/routes/studentRoutes.ts`)
- Room routes → Reservation requests: routes reservations (evidence: `Gcfrb_backend/src/routes/roomRoutes.ts`)
- Room routes → Auth and role guard: guards requests (evidence: `Gcfrb_backend/src/routes/roomRoutes.ts`)
- Student authentication → Supabase database: reads accounts (evidence: `Gcfrb_backend/src/controllers/studentAuth.ts`)
- Admin authentication → Supabase database: reads accounts (evidence: `Gcfrb_backend/src/controllers/adminAuth.ts`)
- Student booking management → Booking utilities: shapes bookings (evidence: `Gcfrb_backend/src/controllers/studentDashboard.ts`)
- Student booking management → Supabase database: reads bookings (evidence: `Gcfrb_backend/src/controllers/studentDashboard.ts`)
- Reservation requests → Booking service rules: checks and saves (evidence: `Gcfrb_backend/src/controllers/roomReservation.ts`)
- Reservation requests → Supabase database: reads booking data (evidence: `Gcfrb_backend/src/controllers/roomReservation.ts`)
- Admin bookings and reports → Booking service rules: uses booking rules (evidence: `Gcfrb_backend/src/controllers/adminDashboard.ts`)
- Admin bookings and reports → Booking utilities: shapes booking data (evidence: `Gcfrb_backend/src/controllers/adminDashboard.ts`)
- Admin bookings and reports → Supabase database: reads reports (evidence: `Gcfrb_backend/src/controllers/adminDashboard.ts`)
- Facility administration → Booking service rules: uses booking rules (evidence: `Gcfrb_backend/src/controllers/adminRooms.ts`)
- Facility administration → Supabase database: manages rooms (evidence: `Gcfrb_backend/src/controllers/adminRooms.ts`)
- Booking service rules → Booking utilities: uses time rules (evidence: `Gcfrb_backend/src/lib/bookingService.ts`)
- Booking service rules → Supabase database: checks and writes (evidence: `Gcfrb_backend/src/lib/bookingService.ts`)
- Student terminal → Terminal sign-in: authenticates (evidence: `Gcfrb_backend/src/cli/studentTerminal.ts`)
- Admin terminal → Terminal sign-in: authenticates (evidence: `Gcfrb_backend/src/cli/adminTerminal.ts`)
- Student terminal → Booking service rules: uses booking rules (evidence: `Gcfrb_backend/src/cli/studentTerminal.ts`)
- Student terminal → Booking utilities: uses booking utilities (evidence: `Gcfrb_backend/src/cli/studentTerminal.ts`)
- Admin terminal → Booking service rules: uses booking rules (evidence: `Gcfrb_backend/src/cli/adminTerminal.ts`)
- Admin terminal → Booking utilities: uses booking utilities (evidence: `Gcfrb_backend/src/cli/adminTerminal.ts`)
- Terminal sign-in → Supabase database: checks accounts (evidence: `Gcfrb_backend/src/cli/terminalAuth.ts`)
