How nouh-sayed/hotel-api works
This repository is a hotel discovery and reservation product: a React client searches hotels, opens hotel details, and submits bookings through an ASP.NET Core API backed by SQL Server. The API also exposes customer, room, pricing, payment, and admin-auth capabilities; pricing rules and a hosted price updater support pricing operations. The excerpts establish the booking and pricing service paths, while several controller implementations and the updater’s behavior were not sampled, so those relationships are omitted unless explicitly documented by the source index.
Main entry points: ApplicationDbContext.cs Application database · Program.cs API host · App.js Client routes · api.jsx HTTP client
Components 22
Web client
- Client routes
hotel/src/App.js - Hotel search
hotel/src/pages/Home.jsx - Hotel details
hotel/src/pages/HotelDetails.jsx - Booking form
hotel/src/pages/Booking.jsx - HTTP client
hotel/src/services/api.jsx
Hotel API
- API host
HotelApi/HotelApi/Program.cs - Hotel catalog API
HotelApi/HotelApi/Controllers/HotelsController.cs - Room API
HotelApi/HotelApi/Controllers/RoomsController.cs - Booking API
HotelApi/HotelApi/Controllers/BookingsController.cs - Customer API
HotelApi/HotelApi/Controllers/CustomersController.cs - Pricing API
HotelApi/HotelApi/Controllers/PricingController.cs - Payments API
HotelApi/HotelApi/Controllers/PaymentsController.cs - Admin sign-in
HotelApi/HotelApi/Controllers/AdminAuthController.cs
Hotel operations
- Hotel search service
HotelApi/HotelApi/Services/HotelService.cs - Room management
HotelApi/HotelApi/Services/RoomService.cs - Booking lifecycle
HotelApi/HotelApi/Services/BookingService.cs - Customer records
HotelApi/HotelApi/Services/CustomerService.cs - Pricing rules
HotelApi/HotelApi/Services/PricingService.cs - Price updater
HotelApi/HotelApi/Services/SmartPriceUpdaterService.cs - Hotel domain models
HotelApi/HotelApi/Models
Persistence
- Application database
HotelApi/HotelApi/Data/ApplicationDbContext.cs
Other components
- Traveler
Connections 28
- Traveler → Client routes: uses
hotel/src/App.js - Client routes → Hotel search: routes to
hotel/src/App.js - Client routes → Hotel details: routes to
hotel/src/App.js - Client routes → Booking form: routes to
hotel/src/App.js - Hotel search → HTTP client: requests data
hotel/src/pages/Home.jsx - Hotel details → HTTP client: requests data
hotel/src/pages/HotelDetails.jsx - Booking form → HTTP client: submits booking
hotel/src/pages/Booking.jsx - HTTP client → API host: sends HTTP
hotel/src/services/api.jsx - Hotel catalog API → Hotel search service: delegates to
- Room API → Room management: delegates to
HotelApi/HotelApi/Controllers/RoomsController.cs - Booking API → Booking lifecycle: delegates to
HotelApi/HotelApi/Controllers/BookingsController.cs - Booking API → Application database: checks availability
HotelApi/HotelApi/Controllers/BookingsController.cs - Customer API → Customer records: delegates to
HotelApi/HotelApi/Controllers/CustomersController.cs - Pricing API → Pricing rules: delegates to
HotelApi/HotelApi/Controllers/PricingController.cs - Payments API → Application database: reads and writes
HotelApi/HotelApi/Controllers/PaymentsController.cs - Admin sign-in → Application database: checks credentials
HotelApi/HotelApi/Controllers/AdminAuthController.cs - Hotel search service → Application database: queries hotels
HotelApi/HotelApi/Services/HotelService.cs - Room management → Application database: reads and writes
- Booking lifecycle → Application database: reads and writes
HotelApi/HotelApi/Services/BookingService.cs - Customer records → Application database: reads and writes
HotelApi/HotelApi/Services/CustomerService.cs - Pricing rules → Application database: reads and writes
HotelApi/HotelApi/Services/PricingService.cs - API host → Price updater: registers hosted service
HotelApi/HotelApi/Program.cs - API host → Hotel search service: registers service
HotelApi/HotelApi/Program.cs - API host → Room management: registers service
HotelApi/HotelApi/Program.cs - API host → Booking lifecycle: registers service
HotelApi/HotelApi/Program.cs - API host → Customer records: registers service
HotelApi/HotelApi/Program.cs - API host → Pricing rules: registers service
HotelApi/HotelApi/Program.cs - Application database → Hotel domain models: maps entities
HotelApi/HotelApi/Data/ApplicationDbContext.cs