You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For an in-depth breakdown of the system design, detailed UML/Mermaid diagrams, component blueprints, end-to-end data flows, and user experience (UX) state machines, see our dedicated guide:
@@ -4,59 +4,111 @@ This document provides a comprehensive technical blueprint of the **Booking Syst
4
4
5
5
---
6
6
7
-
## 1. High-Level System Architecture
7
+
## 1. High-Level System Architecture & Design
8
8
9
9
The Booking System is designed as a decoupled client-server architecture. It consists of a modern Single Page Application (SPA) frontend and a relational database-backed web API service, coordinated locally through a reverse proxy/dev-proxy configuration and deployed via Docker containers.
10
10
11
-
### Architectural Component Diagram
11
+
### 1.1 Granular System Components Design
12
+
13
+
The diagram below details the concrete components, files, utility modules, and database structures that interact across boundaries, illustrating the inner layers of both the React frontend and the Django backend:
The application presents a fluid, responsive user experience. It maps client-side interactions to secure screens, using route guards to intercept unauthenticated requests and gracefully managing input errors with real-time feedback.
154
+
155
+
### 2.1 UX Screen State Transition Diagram
156
+
157
+
The following state machine chart details how screens transition during standard operations, emphasizing route guarding and redirection context matching:
ReservationsPage --> LogoutPage : Click "Logout" on Navbar
218
+
LogoutPage --> BookingPage_Guest : Clears session caches & Redirects to Home
219
+
220
+
class BookingPage_Guest,ReservationsPage guest;
221
+
class EditReservationPage,LoginPage,RouteRecovery auth;
222
+
class DisplayAuthError,RequireAuthGuard err;
223
+
```
224
+
225
+
### 2.2 Interactive UX Scenario Playbooks
226
+
227
+
#### Scenario A: The Guest Booking Workflow
228
+
1.**Landing**: The user lands on `/` (`BookingPage`). The weather module fetches Dublin meteorological stats dynamically from Open-Meteo.
229
+
2.**Date Picking**: Choosing a date triggers an async fetch to retrieve current bookings for that date.
230
+
3.**Form Entry**: Fills in the name and picks a 30-minute interval from the dropdown selection list.
231
+
4.**Submission**: Click **Reserve**.
232
+
-**Case 1 (Invalid Input - Past Reservation)**: Backend rejects with `400 Bad Request`. An alert banner is shown with the message `Cannot make a reservation for a past date/time.`
233
+
-**Case 2 (Invalid Input - Double Booking)**: Slot is occupied. Backend returns `400 Bad Request` with `Booking Failed: Already Reserved.`
234
+
-**Case 3 (Valid Input)**: Backend creates the slot and responds with `201 Created`. The list of bookings for that date is refreshed, and a success banner is shown which automatically fades after 3 seconds.
235
+
236
+
#### Scenario B: The Secure Edit Redirect Journey (Route Guarding)
237
+
1.**Browse**: User lands on `/reservations`, browsing the list of bookings.
238
+
2.**Action**: User clicks the **Edit** link next to a specific reservation row.
239
+
3.**Guard Check**: The `RequireAuth` higher-order component intercepts the route, executing a background query (`getAuthStatus()`) to check if the session is authenticated.
240
+
4.**Redirect**:
241
+
- The user is not logged in. `RequireAuth` redirects them to `/login` using:
@@ -193,9 +345,7 @@ Frontend URL routing is managed by `react-router-dom` (v7) inside `frontend/src/
193
345
[EditReservationPage]
194
346
```
195
347
196
-
-**`RequireAuth` Guard Component**: Intercepts requests to `/reservations/edit/:id`. It fires a background verification check using `getAuthStatus()`. If the user is unauthenticated, it redirects them to `/login` while passing the current path inside React Router's location state (`state: { from: location }`) to support automatic return redirection upon successful login.
0 commit comments