How toshmatovdeveloper/bookingservice works
This repository implements a hotel-booking platform with booking and inventory APIs, account authentication, and event-driven email notifications. The main user workflow enters through the booking controllers, dispatches booking requests through MediatR, and returns booking results; hotel and room lookup handlers also use a distributed cache and the booking database. Authentication has separate HTTP and gRPC entry points backed by its own database. Notification consumers handle account and booking events. Several handlers and service registrations are not sampled, so their internal calls and event producers are not inferred.
Main entry points: BookingController.cs Booking endpoints · HotelController.cs Hotel endpoints · GetBookingByIdQuery.cs Booking lookup · GetHotelByIdQuery.cs Hotel lookup
Components 23
Booking API
- Booking endpoints
BookingService/src/BookingService.Presenters/Controllers/BookingController.cs - Hotel endpoints
BookingService/src/BookingService.Presenters/Controllers/HotelController.cs - Booking handlers
BookingService/src/BookingService.Application/Features/Commands/Booking - Booking lookup
BookingService/src/BookingService.Application/Features/Queries/Booking/GetBookingByIdQuery.cs - Hotel handlers
BookingService/src/BookingService.Application/Features/Commands/Hotel - Hotel lookup
BookingService/src/BookingService.Application/Features/Queries/Hotel/GetHotelByIdQuery.cs - Room endpoints
BookingService/src/BookingService.Presenters/Controllers/RoomController.cs - Room lookup
BookingService/src/BookingService.Application/Features/Queries/Room/GetRoomByIdQuery.cs - Booking database
BookingService/src/BookingService.Infrastructure/ApplicationDbContext.cs - Distributed cache
Authentication
- Account endpoints
BookingService/src/auth/BookingService.Auth/Presenters/Controllers/UserController.cs - Account handlers
BookingService/src/auth/BookingService.Auth/Application/Features - Token provider
BookingService/src/auth/BookingService.Auth/Application/Features/Tokens/TokenProvider.cs - Auth gRPC service
BookingService/src/auth/BookingService.Auth/Grpc/Services/AuthenticationService.cs - Auth database
BookingService/src/auth/BookingService.Auth/Infrastructure/AuthDbContext.cs
Notifications
- Event consumers
BookingService/src/BookingService.Notification/Infrastructure/Consumers - Send mail
BookingService/src/BookingService.Notification/Application/Features/SendMailCommand.cs - Notification database
BookingService/src/BookingService.Notification/Infrastructure/NotificationDbContext.cs
Shared contracts
- Integration events
BookingService/src/BookingService.Contracts/Events - Auth gRPC client
BookingService/src/BookingService.Grpc.Contracts/Clients/AuthGrpcClient.cs
Other components
- API user
- SMTP server
- Message broker
Connections 22
- API user → Booking endpoints: sends requests
- API user → Hotel endpoints: sends requests
- API user → Room endpoints: sends requests
- Booking endpoints → Booking handlers: dispatches commands
- Booking endpoints → Booking lookup: dispatches queries
- Hotel endpoints → Hotel handlers: dispatches commands
- Hotel endpoints → Hotel lookup: dispatches queries
- Room endpoints → Room lookup: dispatches queries
- Booking lookup → Distributed cache: reads and writes
- Booking lookup → Booking database: reads
- Hotel lookup → Distributed cache: reads and writes
- Hotel lookup → Booking database: reads
- Room lookup → Distributed cache: reads and writes
- Room lookup → Booking database: reads
- API user → Account endpoints: sends requests
- Account endpoints → Account handlers: dispatches commands
- Auth gRPC service → Auth database: reads users
- Auth gRPC client → Auth gRPC service: calls
- Message broker → Event consumers: delivers events
- Event consumers → Send mail: dispatches mail
- Event consumers → Notification database: persists mail
- Send mail → SMTP server: sends mail