How wondertech-byte/hotelui works
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: api.ts External API Client · App.tsx Route Composition · authSlice.ts Authentication State · HomePage.tsx Guest Booking Journey
Components 18
Browser Runtime
- HTML Host
index.html - Application Bootstrap
src/main.tsx - Route Composition · Composes the role-specific application areas.
src/App.tsx
Access & State
- Protected Route
src/routes/ProtectedRoute.tsx - Client Store
src/app/store.ts - Typed Store Hooks
src/app/hooks.ts - Authentication State · Owns authentication state and transitions.
src/features/auth/authSlice.ts
Guest Experience
- Guest Navigation
src/components/layout/GuestNavbar.tsx - Guest Auth Screens
src/pages/guest/LoginPage.tsx - Guest Booking Journey · Home, room discovery, details, and booking management pages.
src/pages/guest/HomePage.tsx
Hotel Operations
- Front Desk Shell
src/components/layout/FrontDeskLayout.tsx - Stay Operations · Reservation lookup plus check-in and check-out pages.
src/pages/frontdesk/FrontDeskLookup.tsx - Admin Shell
src/components/layout/AdminLayout.tsx - Admin Operations · Dashboard, bookings, rooms, and users pages.
src/pages/admin/AdminDashboard.tsx
Shared Boundaries
- External API Client · Browser client boundary for hotel and authentication APIs.
src/services/api.ts - Domain Contracts
src/types/index.ts - Reusable UI
src/components/shared/index.tsx
Other components
- Hotel & Auth APIs
Connections 22
- 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