# toomnineteen/utcc-booking-room-frontend architecture

> Architecture diagram of the GitHub repository toomnineteen/utcc-booking-room-frontend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/toomnineteen/utcc-booking-room-frontend
- Repository: https://github.com/toomnineteen/utcc-booking-room-frontend

## Overview

This is a React frontend for a Thai-language classroom booking system. Users browse a date-based booking calendar, submit bookings, view booking records, search and paginate classroom listings, and edit or delete an existing booking. The route configuration connects these pages under the shared navigation layout; page components call the API layer, while a persisted Zustand store loads faculty, semester, and time-slot options. Admin layout files exist, but the sampled router has its admin route commented out. Source coverage is limited to the provided excerpts and index references.

Main entry points: [`src/routes/AppRoutes.jsx`](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/routes/AppRoutes.jsx) (Page routes), [`src/components/user/PageHomeCalendarCard.jsx`](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/components/user/PageHomeCalendarCard.jsx) (Booking calendar), [`src/components/user/PageHomeBookingEdit.jsx`](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/components/user/PageHomeBookingEdit.jsx) (Edit booking), [`src/api/readBookingApi.js`](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/api/readBookingApi.js) (Booking API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["React app<br/>[App.jsx]"]
  node_routes["Page routes<br/>[AppRoutes.jsx]"]
  node_layout["Main layout<br/>[Layout.jsx]"]
  node_nav["Main navigation<br/>[MainNav.jsx]"]
  node_adminlayout["Admin layout<br/>[LayoutAdmin.jsx]"]
  node_adminhome["Admin home<br/>[PageHomeAdmin.jsx]"]
end

subgraph group_booking["Booking workflow"]
  node_home["Booking calendar"]
  node_bookinglist["Booking records"]
  node_edit["Edit booking"]
  node_modal["Booking modal"]
end

subgraph group_rooms["Room discovery"]
  node_roomlist["Room search<br/>[PageListRoom.jsx]"]
  node_roomstats["Room statistics card"]
end

subgraph group_services["Client services"]
  node_bookingapi["Booking API<br/>[readBookingApi.js]"]
  node_store["Booking options store"]
  node_roomapi["Room data API<br/>[readapi.js]"]
end

node_user(("Visitor"))
node_externalapi{{"Booking and room service"}}

node_user -->|"opens"| node_app
node_app -->|"renders"| node_routes
node_routes -->|"routes through"| node_layout
node_layout -->|"renders"| node_nav
node_routes -->|"routes to"| node_home
node_routes -->|"routes to"| node_roomlist
node_routes -->|"routes to"| node_bookinglist
node_routes -->|"routes to"| node_edit
node_home -->|"reads and creates"| node_bookingapi
node_home -->|"renders"| node_modal
node_home -->|"links to"| node_edit
node_bookinglist -->|"reads"| node_bookingapi
node_edit -->|"reads, updates, deletes"| node_bookingapi
node_edit -->|"loads options"| node_store
node_roomlist -->|"queries"| node_roomapi
node_roomlist -->|"renders"| node_roomstats
node_store -->|"loads options via"| node_roomapi
node_bookingapi -->|"HTTP requests"| node_externalapi
node_roomapi -->|"HTTP requests"| node_externalapi
node_routes -.->|"admin route disabled"| node_adminlayout
node_adminlayout -.->|"outlet target"| node_adminhome

click node_app "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/App.jsx"
click node_routes "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/routes/AppRoutes.jsx"
click node_layout "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/layouts/Layout.jsx"
click node_nav "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/components/navbar/MainNav.jsx"
click node_home "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/components/user/PageHomeCalendarCard.jsx"
click node_bookinglist "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/pages/PageBookingRoom.jsx"
click node_edit "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/components/user/PageHomeBookingEdit.jsx"
click node_modal "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/components/user/PageHomeBookingModal.jsx"
click node_bookingapi "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/api/readBookingApi.js"
click node_store "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/store/BookingRoom-Store.jsx"
click node_roomlist "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/pages/PageListRoom.jsx"
click node_roomstats "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/components/user/PageListRoomCardStat.jsx"
click node_roomapi "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/api/readapi.js"
click node_adminlayout "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/layouts/LayoutAdmin.jsx"
click node_adminhome "https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/pages/admin/PageHomeAdmin.jsx"

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_routes,node_layout,node_nav,node_adminlayout,node_adminhome toneBlue
class node_home,node_bookinglist,node_edit,node_modal toneAmber
class node_roomlist,node_roomstats toneMint
class node_bookingapi,node_store,node_roomapi toneRose
class node_user,node_externalapi toneIndigo
```

## Components

### Application shell

- [React app](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/App.jsx): `src/App.jsx`
- [Page routes](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/routes/AppRoutes.jsx): `src/routes/AppRoutes.jsx`
- [Main layout](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/layouts/Layout.jsx): `src/layouts/Layout.jsx`
- [Main navigation](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/components/navbar/MainNav.jsx): `src/components/navbar/MainNav.jsx`
- [Admin layout](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/layouts/LayoutAdmin.jsx): `src/layouts/LayoutAdmin.jsx`
- [Admin home](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/pages/admin/PageHomeAdmin.jsx): `src/pages/admin/PageHomeAdmin.jsx`

### Booking workflow

- [Booking calendar](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/components/user/PageHomeCalendarCard.jsx): `src/components/user/PageHomeCalendarCard.jsx`
- [Booking records](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/pages/PageBookingRoom.jsx): `src/pages/PageBookingRoom.jsx`
- [Edit booking](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/components/user/PageHomeBookingEdit.jsx): `src/components/user/PageHomeBookingEdit.jsx`
- [Booking modal](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/components/user/PageHomeBookingModal.jsx): `src/components/user/PageHomeBookingModal.jsx`

### Room discovery

- [Room search](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/pages/PageListRoom.jsx): `src/pages/PageListRoom.jsx`
- [Room statistics card](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/components/user/PageListRoomCardStat.jsx): `src/components/user/PageListRoomCardStat.jsx`

### Client services

- [Booking API](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/api/readBookingApi.js): `src/api/readBookingApi.js`
- [Booking options store](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/store/BookingRoom-Store.jsx): `src/store/BookingRoom-Store.jsx`
- [Room data API](https://github.com/toomnineteen/utcc-booking-room-frontend/blob/main/src/api/readapi.js): `src/api/readapi.js`

### Other components

- **Visitor**
- **Booking and room service**

## Connections

- Visitor → React app: opens
- React app → Page routes: renders (evidence: `src/App.jsx`)
- Page routes → Main layout: routes through (evidence: `src/routes/AppRoutes.jsx`)
- Main layout → Main navigation: renders (evidence: `src/layouts/Layout.jsx`)
- Page routes → Booking calendar: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Page routes → Room search: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Page routes → Booking records: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Page routes → Edit booking: routes to (evidence: `src/routes/AppRoutes.jsx`)
- Booking calendar → Booking API: reads and creates (evidence: `src/components/user/PageHomeCalendarCard.jsx`)
- Booking calendar → Booking modal: renders (evidence: `src/components/user/PageHomeCalendarCard.jsx`)
- Booking calendar → Edit booking: links to (evidence: `src/components/user/PageHomeCalendarCard.jsx`)
- Booking records → Booking API: reads (evidence: `src/pages/PageBookingRoom.jsx`)
- Edit booking → Booking API: reads, updates, deletes (evidence: `src/components/user/PageHomeBookingEdit.jsx`)
- Edit booking → Booking options store: loads options (evidence: `src/components/user/PageHomeBookingEdit.jsx`)
- Room search → Room data API: queries (evidence: `src/pages/PageListRoom.jsx`)
- Room search → Room statistics card: renders (evidence: `src/pages/PageListRoom.jsx`)
- Booking options store → Room data API: loads options via (evidence: `src/store/BookingRoom-Store.jsx`)
- Booking API → Booking and room service: HTTP requests (evidence: `src/api/readBookingApi.js`)
- Room data API → Booking and room service: HTTP requests (evidence: `src/api/readapi.js`)
- Page routes → Admin layout: admin route disabled (evidence: `src/routes/AppRoutes.jsx`)
- Admin layout → Admin home: outlet target
