# wondertech-byte/hotelui architecture

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

- Interactive diagram: https://gitdiagram.com/wondertech-byte/hotelui
- Repository: https://github.com/wondertech-byte/hotelui

## Overview

#### Purpose and Entry Points
This is a TypeScript frontend for hotel operations, separating guest self-service, front-desk workflows, and administration. The README contains no implementation guidance. Application bootstrap and root composition are in `src/main.tsx` and `src/App.tsx`; the HTML host is `index.html`.

#### Application Shell and Routing
`src/App.tsx` is the likely route-composition boundary for the three user areas. Authorization is centralized in `src/routes/ProtectedRoute.tsx`, allowing route access policy to remain outside individual pages. The route structure is expressed through page directories rather than a backend or server-rendered framework.

#### Role-Specific Experience Layers
Guest-facing navigation/layout is represented by `src/components/layout/GuestNavbar.tsx`. Operational staff are separated into dedicated shells: `src/components/layout/FrontDeskLayout.tsx` and `src/components/layout/AdminLayout.tsx`. These layouts are the principal UI boundary between guest, front-desk, and administrator journeys.

#### State and Authentication
Shared client state is organized around a Redux-style store in `src/app/store.ts`, with typed/application hooks in `src/app/hooks.ts`. Authentication state and transitions are isolated in `src/features/auth/authSlice.ts`; this state is expected to drive `ProtectedRoute.tsx` and role-aware navigation. Auth screens live under `src/pages/guest/LoginPage.tsx`, `src/pages/guest/RegisterPage.tsx`, and `src/pages/guest/ForgotPasswordPage.tsx`.

#### Core Hotel Workflows
Guest booking discovery and management are represented by `src/pages/guest/HomePage.tsx`, `src/pages/guest/RoomsPage.tsx`, `src/pages/guest/RoomDetailPage.tsx`, and `src/pages/guest/MyBookingsPage.tsx`. Front-desk staff perform reservation lookup and stay transitions through `src/pages/frontdesk/FrontDeskLookup.tsx`, `src/pages/frontdesk/FrontDeskCheckIn.tsx`, and `src/pages/frontdesk/FrontDeskCheckOut.tsx`. Administrators oversee aggregate operations through `src/pages/admin/AdminDashboard.tsx`, `src/pages/admin/AdminBookingsPage.tsx`, `src/pages/admin/AdminRoomsPage.tsx`, and `src/pages/admin/AdminUsersPage.tsx`.

#### Service and Type Boundaries
`src/services/api.ts` is the client’s external-service boundary; no backend, database, or deployment infrastructure is present in the repository tree. Shared domain/request shapes should be centralized in `src/types/index.ts`, keeping pages and state logic aligned with API contracts. Shared reusable UI is collected in `src/components/shared/index.tsx`.

#### Runtime and Styling
The project is configured as a Vite-based TypeScript frontend (`vite.config.ts`, `tsconfig.json`) with Tailwind/PostCSS styling (`tailwind.config.js`, `postcss.config.js`, `src/index.css`). It runs entirely as a browser client from the evidence available; external hotel/auth APIs are reached through `src/services/api.ts`.

Main entry points: [`src/services/api.ts`](https://github.com/wondertech-byte/hotelui/blob/main/src/services/api.ts) (External API Client), [`src/App.tsx`](https://github.com/wondertech-byte/hotelui/blob/main/src/App.tsx) (Route Composition), [`src/features/auth/authSlice.ts`](https://github.com/wondertech-byte/hotelui/blob/main/src/features/auth/authSlice.ts) (Authentication State), [`src/pages/guest/HomePage.tsx`](https://github.com/wondertech-byte/hotelui/blob/main/src/pages/guest/HomePage.tsx) (Guest Booking Journey)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Browser Runtime"]
  node_html["HTML Host<br/>Vite host<br/>[index.html]"]
  node_main{{"Application Bootstrap<br/>React entry<br/>[main.tsx]"}}
  node_app["Route Composition<br/>React root<br/>[App.tsx]"]
end

subgraph group_access["Access &amp; State"]
  node_protected_route["Protected Route<br/>authorization guard<br/>[ProtectedRoute.tsx]"]
  node_store[("Client Store<br/>Redux store<br/>[store.ts]")]
  node_hooks["Typed Store Hooks<br/>state access<br/>[hooks.ts]"]
  node_auth_slice["Authentication State<br/>Redux slice<br/>[authSlice.ts]"]
end

subgraph group_guest["Guest Experience"]
  node_guest_nav["Guest Navigation<br/>guest layout<br/>[GuestNavbar.tsx]"]
  node_guest_auth["Guest Auth Screens<br/>login/register/recovery<br/>[LoginPage.tsx]"]
  node_guest_booking["Guest Booking Journey<br/>discovery and bookings<br/>[HomePage.tsx]"]
end

subgraph group_operations["Hotel Operations"]
  node_frontdesk_layout["Front Desk Shell<br/>staff layout"]
  node_frontdesk_flow["Stay Operations<br/>front-desk workflow"]
  node_admin_layout["Admin Shell<br/>administrator layout<br/>[AdminLayout.tsx]"]
  node_admin_operations["Admin Operations<br/>oversight workflow<br/>[AdminDashboard.tsx]"]
end

subgraph group_shared["Shared Boundaries"]
  node_api{{"External API Client<br/>service boundary<br/>[api.ts]"}}
  node_types["Domain Contracts<br/>shared TypeScript types<br/>[index.ts]"]
  node_shared_ui["Reusable UI<br/>shared components<br/>[index.tsx]"]
end

node_external_apis{{"Hotel &amp; Auth APIs<br/>external services"}}

node_html -->|"loads"| node_main
node_main -->|"mounts"| node_app
node_app -->|"applies"| node_protected_route
node_app -->|"guest routes"| node_guest_nav
node_app -->|"front-desk routes"| node_frontdesk_layout
node_app -->|"admin routes"| node_admin_layout
node_protected_route -->|"authorizes from"| node_auth_slice
node_auth_slice -->|"registered in"| node_store
node_hooks -->|"typed access"| node_store
node_guest_nav -->|"navigates"| node_guest_booking
node_guest_auth -->|"updates"| node_auth_slice
node_frontdesk_layout -->|"hosts"| node_frontdesk_flow
node_admin_layout -->|"hosts"| node_admin_operations
node_guest_booking -->|"uses"| node_api
node_frontdesk_flow -->|"uses"| node_api
node_admin_operations -->|"uses"| node_api
node_auth_slice -->|"auth requests"| node_api
node_api -->|"HTTP requests"| node_external_apis
node_api -->|"uses contracts"| node_types
node_guest_booking -->|"renders"| node_shared_ui
node_frontdesk_flow -->|"renders"| node_shared_ui
node_admin_operations -->|"renders"| node_shared_ui

click node_html "https://github.com/wondertech-byte/hotelui/blob/main/index.html"
click node_main "https://github.com/wondertech-byte/hotelui/blob/main/src/main.tsx"
click node_app "https://github.com/wondertech-byte/hotelui/blob/main/src/App.tsx"
click node_protected_route "https://github.com/wondertech-byte/hotelui/blob/main/src/routes/ProtectedRoute.tsx"
click node_store "https://github.com/wondertech-byte/hotelui/blob/main/src/app/store.ts"
click node_hooks "https://github.com/wondertech-byte/hotelui/blob/main/src/app/hooks.ts"
click node_auth_slice "https://github.com/wondertech-byte/hotelui/blob/main/src/features/auth/authSlice.ts"
click node_guest_nav "https://github.com/wondertech-byte/hotelui/blob/main/src/components/layout/GuestNavbar.tsx"
click node_guest_auth "https://github.com/wondertech-byte/hotelui/blob/main/src/pages/guest/LoginPage.tsx"
click node_guest_booking "https://github.com/wondertech-byte/hotelui/blob/main/src/pages/guest/HomePage.tsx"
click node_frontdesk_layout "https://github.com/wondertech-byte/hotelui/blob/main/src/components/layout/FrontDeskLayout.tsx"
click node_frontdesk_flow "https://github.com/wondertech-byte/hotelui/blob/main/src/pages/frontdesk/FrontDeskLookup.tsx"
click node_admin_layout "https://github.com/wondertech-byte/hotelui/blob/main/src/components/layout/AdminLayout.tsx"
click node_admin_operations "https://github.com/wondertech-byte/hotelui/blob/main/src/pages/admin/AdminDashboard.tsx"
click node_api "https://github.com/wondertech-byte/hotelui/blob/main/src/services/api.ts"
click node_types "https://github.com/wondertech-byte/hotelui/blob/main/src/types/index.ts"
click node_shared_ui "https://github.com/wondertech-byte/hotelui/blob/main/src/components/shared/index.tsx"

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_html,node_main,node_app toneBlue
class node_protected_route,node_store,node_hooks,node_auth_slice toneAmber
class node_guest_nav,node_guest_auth,node_guest_booking toneMint
class node_frontdesk_layout,node_frontdesk_flow,node_admin_layout,node_admin_operations toneRose
class node_api,node_types,node_shared_ui toneIndigo
class node_external_apis toneNeutral
```

## Components

### Browser Runtime

- [HTML Host](https://github.com/wondertech-byte/hotelui/blob/main/index.html): Vite host · `index.html`
- [Application Bootstrap](https://github.com/wondertech-byte/hotelui/blob/main/src/main.tsx): React entry · `src/main.tsx`
- [Route Composition](https://github.com/wondertech-byte/hotelui/blob/main/src/App.tsx): React root · Composes the role-specific application areas. · `src/App.tsx`

### Access & State

- [Protected Route](https://github.com/wondertech-byte/hotelui/blob/main/src/routes/ProtectedRoute.tsx): authorization guard · `src/routes/ProtectedRoute.tsx`
- [Client Store](https://github.com/wondertech-byte/hotelui/blob/main/src/app/store.ts): Redux store · `src/app/store.ts`
- [Typed Store Hooks](https://github.com/wondertech-byte/hotelui/blob/main/src/app/hooks.ts): state access · `src/app/hooks.ts`
- [Authentication State](https://github.com/wondertech-byte/hotelui/blob/main/src/features/auth/authSlice.ts): Redux slice · Owns authentication state and transitions. · `src/features/auth/authSlice.ts`

### Guest Experience

- [Guest Navigation](https://github.com/wondertech-byte/hotelui/blob/main/src/components/layout/GuestNavbar.tsx): guest layout · `src/components/layout/GuestNavbar.tsx`
- [Guest Auth Screens](https://github.com/wondertech-byte/hotelui/blob/main/src/pages/guest/LoginPage.tsx): login/register/recovery · `src/pages/guest/LoginPage.tsx`
- [Guest Booking Journey](https://github.com/wondertech-byte/hotelui/blob/main/src/pages/guest/HomePage.tsx): discovery and bookings · Home, room discovery, details, and booking management pages. · `src/pages/guest/HomePage.tsx`

### Hotel Operations

- [Front Desk Shell](https://github.com/wondertech-byte/hotelui/blob/main/src/components/layout/FrontDeskLayout.tsx): staff layout · `src/components/layout/FrontDeskLayout.tsx`
- [Stay Operations](https://github.com/wondertech-byte/hotelui/blob/main/src/pages/frontdesk/FrontDeskLookup.tsx): front-desk workflow · Reservation lookup plus check-in and check-out pages. · `src/pages/frontdesk/FrontDeskLookup.tsx`
- [Admin Shell](https://github.com/wondertech-byte/hotelui/blob/main/src/components/layout/AdminLayout.tsx): administrator layout · `src/components/layout/AdminLayout.tsx`
- [Admin Operations](https://github.com/wondertech-byte/hotelui/blob/main/src/pages/admin/AdminDashboard.tsx): oversight workflow · Dashboard, bookings, rooms, and users pages. · `src/pages/admin/AdminDashboard.tsx`

### Shared Boundaries

- [External API Client](https://github.com/wondertech-byte/hotelui/blob/main/src/services/api.ts): service boundary · Browser client boundary for hotel and authentication APIs. · `src/services/api.ts`
- [Domain Contracts](https://github.com/wondertech-byte/hotelui/blob/main/src/types/index.ts): shared TypeScript types · `src/types/index.ts`
- [Reusable UI](https://github.com/wondertech-byte/hotelui/blob/main/src/components/shared/index.tsx): shared components · `src/components/shared/index.tsx`

### Other components

- **Hotel & Auth APIs**: external services

## Connections

- HTML Host → Application Bootstrap: loads
- Application Bootstrap → Route Composition: mounts
- Route Composition → Protected Route: applies
- Route Composition → Guest Navigation: guest routes
- Route Composition → Front Desk Shell: front-desk routes
- Route Composition → Admin Shell: admin routes
- Protected Route → Authentication State: authorizes from
- Authentication State → Client Store: registered in
- Typed Store Hooks → Client Store: typed access
- Guest Navigation → Guest Booking Journey: navigates
- Guest Auth Screens → Authentication State: updates
- Front Desk Shell → Stay Operations: hosts
- Admin Shell → Admin Operations: hosts
- Guest Booking Journey → External API Client: uses
- Stay Operations → External API Client: uses
- Admin Operations → External API Client: uses
- Authentication State → External API Client: auth requests
- External API Client → Hotel & Auth APIs: HTTP requests
- External API Client → Domain Contracts: uses contracts
- Guest Booking Journey → Reusable UI: renders
- Stay Operations → Reusable UI: renders
- Admin Operations → Reusable UI: renders
