# noid55/thebooking architecture

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

- Interactive diagram: https://gitdiagram.com/noid55/thebooking
- Repository: https://github.com/noid55/thebooking

## Overview

TheBooking is a study-room booking product delivered as two independent applications: an ASP.NET MVC app and an ASP.NET API with a React client. In both, students find rooms and manage bookings; the MVC app also documents open study sessions, participation, and messaging, while admins manage rooms, buildings, and equipment. The graph preserves those capabilities and the API/client split. Some links are omitted where sampled source does not show the caller; dashed links indicate documented capabilities whose implementation wiring was not sampled.

Main entry points: [`src/thebooking/DAL/BookingDbContext.cs`](https://github.com/noid55/thebooking/blob/main/src/thebooking/DAL/BookingDbContext.cs) (SQLite database), [`subapp2/thebooking-react/src/App.tsx`](https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/App.tsx) (Application routes), [`src/thebooking/Controllers/BookingController.cs`](https://github.com/noid55/thebooking/blob/main/src/thebooking/Controllers/BookingController.cs) (Booking workflow), [`subapp2/thebooking-react/src/rooms/RoomListPage.tsx`](https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/rooms/RoomListPage.tsx) (Room search and display)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mvc["MVC application"]
  node_mvc_booking["Booking workflow"]
  node_mvc_rooms["Room search and admin<br/>[RoomController.cs]"]
  node_mvc_buildings["Building admin"]
  node_mvc_equipment["Equipment admin"]
  node_mvc_messages["Session messaging"]
  node_mvc_account["Accounts and roles"]
  node_booking_rules["Booking rules<br/>[BookingService.cs]"]
end

subgraph group_api["API application"]
  node_api_booking["Booking endpoints"]
  node_api_rooms["Room endpoints"]
  node_api_buildings["Building endpoints"]
  node_api_equipment["Equipment endpoints"]
  node_api_rules["Booking rules<br/>[BookingService.cs]"]
end

subgraph group_client["React client"]
  node_react_routes["Application routes<br/>[App.tsx]"]
  node_react_rooms["Room search and display<br/>[RoomListPage.tsx]"]
  node_react_room_views["Room grids and tables<br/>[RoomGrid.tsx]"]
  node_react_buildings["Building management"]
  node_react_equipment["Equipment management"]
  node_react_bookings["My bookings<br/>[MyBookingsPage.tsx]"]
  node_room_service["Room API client<br/>[roomService.ts]"]
  node_booking_service["Booking API client<br/>[bookingService.ts]"]
end

subgraph group_data["Booking data"]
  node_database[("SQLite database")]
end

node_student(("Student or admin"))

node_student -.->|"manages bookings"| node_mvc_booking
node_student -.->|"searches rooms"| node_mvc_rooms
node_student -.->|"sends messages"| node_mvc_messages
node_student -.->|"registers or signs in"| node_mvc_account
node_mvc_booking -->|"validates"| node_booking_rules
node_mvc_booking -.->|"reads and writes"| node_database
node_mvc_rooms -.->|"reads and writes"| node_database
node_mvc_buildings -.->|"manages records"| node_database
node_mvc_equipment -.->|"manages records"| node_database
node_mvc_messages -.->|"stores messages"| node_database
node_api_booking -->|"validates"| node_api_rules
node_api_booking -.->|"reads and writes"| node_database
node_api_rooms -.->|"reads and writes"| node_database
node_api_buildings -.->|"reads and writes"| node_database
node_api_equipment -.->|"reads and writes"| node_database
node_react_routes -->|"routes to"| node_react_rooms
node_react_routes -->|"routes to"| node_react_buildings
node_react_routes -->|"routes to"| node_react_equipment
node_react_routes -->|"routes to"| node_react_bookings
node_react_rooms -->|"renders"| node_react_room_views
node_react_rooms -->|"requests rooms"| node_room_service
node_room_service -->|"calls endpoints"| node_api_rooms
node_booking_service -->|"calls endpoints"| node_api_booking
node_react_bookings -.->|"uses client"| node_booking_service

click node_mvc_booking "https://github.com/noid55/thebooking/blob/main/src/thebooking/Controllers/BookingController.cs"
click node_mvc_rooms "https://github.com/noid55/thebooking/blob/main/src/thebooking/Controllers/RoomController.cs"
click node_mvc_buildings "https://github.com/noid55/thebooking/blob/main/src/thebooking/Controllers/BuildingController.cs"
click node_mvc_equipment "https://github.com/noid55/thebooking/blob/main/src/thebooking/Controllers/EquipmentController.cs"
click node_mvc_messages "https://github.com/noid55/thebooking/blob/main/src/thebooking/Controllers/MessageController.cs"
click node_mvc_account "https://github.com/noid55/thebooking/blob/main/src/thebooking/Controllers/AccountController.cs"
click node_booking_rules "https://github.com/noid55/thebooking/blob/main/src/thebooking/Services/BookingService.cs"
click node_api_booking "https://github.com/noid55/thebooking/blob/main/subapp2/api/Controllers/BookingAPIController.cs"
click node_api_rooms "https://github.com/noid55/thebooking/blob/main/subapp2/api/Controllers/RoomAPIController.cs"
click node_api_buildings "https://github.com/noid55/thebooking/blob/main/subapp2/api/Controllers/BuildingAPIController.cs"
click node_api_equipment "https://github.com/noid55/thebooking/blob/main/subapp2/api/Controllers/EquipmentAPIController.cs"
click node_api_rules "https://github.com/noid55/thebooking/blob/main/subapp2/api/Services/BookingService.cs"
click node_react_routes "https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/App.tsx"
click node_react_rooms "https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/rooms/RoomListPage.tsx"
click node_react_room_views "https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/rooms/RoomGrid.tsx"
click node_react_buildings "https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/buildings/BuildingListPage.tsx"
click node_react_equipment "https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/equipment/EquipmentListPage.tsx"
click node_react_bookings "https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/bookings/MyBookingsPage.tsx"
click node_room_service "https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/services/roomService.ts"
click node_booking_service "https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/services/bookingService.ts"
click node_database "https://github.com/noid55/thebooking/blob/main/src/thebooking/DAL/BookingDbContext.cs"

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_mvc_booking,node_mvc_rooms,node_mvc_buildings,node_mvc_equipment,node_mvc_messages,node_mvc_account,node_booking_rules toneBlue
class node_api_booking,node_api_rooms,node_api_buildings,node_api_equipment,node_api_rules toneAmber
class node_react_routes,node_react_rooms,node_react_room_views,node_react_buildings,node_react_equipment,node_react_bookings,node_room_service,node_booking_service toneMint
class node_database toneRose
class node_student toneIndigo
```

## Components

### MVC application

- [Booking workflow](https://github.com/noid55/thebooking/blob/main/src/thebooking/Controllers/BookingController.cs): `src/thebooking/Controllers/BookingController.cs`
- [Room search and admin](https://github.com/noid55/thebooking/blob/main/src/thebooking/Controllers/RoomController.cs): `src/thebooking/Controllers/RoomController.cs`
- [Building admin](https://github.com/noid55/thebooking/blob/main/src/thebooking/Controllers/BuildingController.cs): `src/thebooking/Controllers/BuildingController.cs`
- [Equipment admin](https://github.com/noid55/thebooking/blob/main/src/thebooking/Controllers/EquipmentController.cs): `src/thebooking/Controllers/EquipmentController.cs`
- [Session messaging](https://github.com/noid55/thebooking/blob/main/src/thebooking/Controllers/MessageController.cs): `src/thebooking/Controllers/MessageController.cs`
- [Accounts and roles](https://github.com/noid55/thebooking/blob/main/src/thebooking/Controllers/AccountController.cs): `src/thebooking/Controllers/AccountController.cs`
- [Booking rules](https://github.com/noid55/thebooking/blob/main/src/thebooking/Services/BookingService.cs): `src/thebooking/Services/BookingService.cs`

### API application

- [Booking endpoints](https://github.com/noid55/thebooking/blob/main/subapp2/api/Controllers/BookingAPIController.cs): `subapp2/api/Controllers/BookingAPIController.cs`
- [Room endpoints](https://github.com/noid55/thebooking/blob/main/subapp2/api/Controllers/RoomAPIController.cs): `subapp2/api/Controllers/RoomAPIController.cs`
- [Building endpoints](https://github.com/noid55/thebooking/blob/main/subapp2/api/Controllers/BuildingAPIController.cs): `subapp2/api/Controllers/BuildingAPIController.cs`
- [Equipment endpoints](https://github.com/noid55/thebooking/blob/main/subapp2/api/Controllers/EquipmentAPIController.cs): `subapp2/api/Controllers/EquipmentAPIController.cs`
- [Booking rules](https://github.com/noid55/thebooking/blob/main/subapp2/api/Services/BookingService.cs): `subapp2/api/Services/BookingService.cs`

### React client

- [Application routes](https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/App.tsx): `subapp2/thebooking-react/src/App.tsx`
- [Room search and display](https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/rooms/RoomListPage.tsx): `subapp2/thebooking-react/src/rooms/RoomListPage.tsx`
- [Room grids and tables](https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/rooms/RoomGrid.tsx): `subapp2/thebooking-react/src/rooms/RoomGrid.tsx`
- [Building management](https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/buildings/BuildingListPage.tsx): `subapp2/thebooking-react/src/buildings/BuildingListPage.tsx`
- [Equipment management](https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/equipment/EquipmentListPage.tsx): `subapp2/thebooking-react/src/equipment/EquipmentListPage.tsx`
- [My bookings](https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/bookings/MyBookingsPage.tsx): `subapp2/thebooking-react/src/bookings/MyBookingsPage.tsx`
- [Room API client](https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/services/roomService.ts): `subapp2/thebooking-react/src/services/roomService.ts`
- [Booking API client](https://github.com/noid55/thebooking/blob/main/subapp2/thebooking-react/src/services/bookingService.ts): `subapp2/thebooking-react/src/services/bookingService.ts`

### Booking data

- [SQLite database](https://github.com/noid55/thebooking/blob/main/src/thebooking/DAL/BookingDbContext.cs): `src/thebooking/DAL/BookingDbContext.cs`

### Other components

- **Student or admin**

## Connections

- Student or admin → Booking workflow: manages bookings
- Student or admin → Room search and admin: searches rooms
- Student or admin → Session messaging: sends messages
- Student or admin → Accounts and roles: registers or signs in
- Booking workflow → Booking rules: validates (evidence: `src/thebooking/Controllers/BookingController.cs`)
- Booking workflow → SQLite database: reads and writes
- Room search and admin → SQLite database: reads and writes
- Building admin → SQLite database: manages records
- Equipment admin → SQLite database: manages records
- Session messaging → SQLite database: stores messages
- Booking endpoints → Booking rules: validates (evidence: `subapp2/api/Controllers/BookingAPIController.cs`)
- Booking endpoints → SQLite database: reads and writes
- Room endpoints → SQLite database: reads and writes
- Building endpoints → SQLite database: reads and writes
- Equipment endpoints → SQLite database: reads and writes
- Application routes → Room search and display: routes to (evidence: `subapp2/thebooking-react/src/App.tsx`)
- Application routes → Building management: routes to (evidence: `subapp2/thebooking-react/src/App.tsx`)
- Application routes → Equipment management: routes to (evidence: `subapp2/thebooking-react/src/App.tsx`)
- Application routes → My bookings: routes to (evidence: `subapp2/thebooking-react/src/App.tsx`)
- Room search and display → Room grids and tables: renders (evidence: `subapp2/thebooking-react/src/rooms/RoomListPage.tsx`)
- Room search and display → Room API client: requests rooms (evidence: `subapp2/thebooking-react/src/rooms/RoomListPage.tsx`)
- Room API client → Room endpoints: calls endpoints (evidence: `subapp2/thebooking-react/src/services/roomService.ts`)
- Booking API client → Booking endpoints: calls endpoints (evidence: `subapp2/thebooking-react/src/services/bookingService.ts`)
- My bookings → Booking API client: uses client
