A production-ready hotel booking platform built with microservices architecture using .NET 10
StayBooker is a hotel/property booking platform that demonstrates how to decompose a monolithic application into independently deployable, scalable services. It showcases real-world microservices patterns including gRPC for synchronous communication, RabbitMQ with MassTransit for event-driven messaging, an API Gateway pattern with YARP, and a Blazor WebAssembly frontend — all orchestrated with Docker Compose.
- Architecture Overview
- Services
- Tech Stack
- Data Flow
- Getting Started
- Project Structure
- Contributing
- License
StayBooker follows the Database-per-Service pattern with synchronous (gRPC/REST) and asynchronous (RabbitMQ) communication:
Client → API Gateway (YARP) → Booking Service → Guest Service (gRPC)
→ Property Service (gRPC)
→ RabbitMQ → Payment Service
→ Notification Service
| Pattern | Technology | Usage |
|---|---|---|
| Synchronous | gRPC / HTTP REST | Booking Service validates guests & properties |
| Asynchronous | RabbitMQ + MassTransit | Booking → Payment → Notification event flow |
| Service | Role | Tech | Port |
|---|---|---|---|
| API Gateway | Reverse proxy / entry point | YARP | 5010 |
| Booking Service | Core orchestrator | REST + MassTransit | 5001 |
| Guest Service | Guest profiles | REST + gRPC | 5002 |
| Property Service | Property listings | REST + gRPC | 5003 |
| Payment Service | Payment processing | MassTransit consumer | 5004 |
| Notification Service | Email notifications | MassTransit consumer | 5005 |
| Blazor WASM | Web frontend | Blazor WebAssembly | 3000 |
| RabbitMQ | Message broker | RabbitMQ + Management UI | 5672, 15672 |
| Category | Technology | Purpose |
|---|---|---|
| Runtime | .NET 10 | Core framework |
| API Gateway | YARP 2.3 | Reverse proxy, routing |
| IPC (Sync) | gRPC / REST | Service-to-service calls |
| Messaging | RabbitMQ + MassTransit 8.3 | Event-driven architecture |
| ORM | EF Core + SQLite | Database-per-service |
| Mediation | MediatR 12.5 | CQRS pattern |
| Validation | FluentValidation 12 | Input validation |
| Logging | Serilog 10 | Structured logging |
| Resilience | Polly | Retry policies |
| Frontend | Blazor WebAssembly 10 | SPA |
| Container | Docker / Compose | Orchestration |
Complete booking flow (10 steps):
- User sends
POST /api/v1/bookingswithguestId,propertyId,checkIn,checkOut,rooms - API Gateway routes to Booking Service
- Booking Service validates guest via Guest Service
- Booking Service checks property availability via Property Service
- Booking is created in database (Status:
Confirmed) BookingCreatedEventpublished to RabbitMQ- Payment Service processes payment → publishes
PaymentProcessedEvent - Booking Service updates status to
Paid - Notification Service sends confirmation email
- User receives booking confirmation response
# Prerequisites: Docker & Docker Compose
# Clone the repository
git clone https://github.com/ronakmunjapara/staybooker.git
cd staybooker
# Start all services
docker compose up --build
# Access the application
# Frontend: http://localhost:3000
# API: http://localhost:5010
# RabbitMQ: http://localhost:15672 (guest/guest)StayBooker/
├── BuildingBlocks/
│ ├── Shared/ # Events, DTOs, Constants
│ └── Shared.Contracts/ # gRPC proto contracts
├── Services/
│ ├── ApiGateway/ # YARP reverse proxy
│ ├── BookingService/ # Core booking orchestration
│ ├── GuestService/ # Guest profile management
│ ├── PropertyService/ # Property listings
│ ├── PaymentService/ # Payment processing
│ ├── NotificationService/ # Email notifications
│ └── StayBooker.Web/ # Blazor WebAssembly frontend
├── docs/ # Architecture & reference docs
├── docker-compose.yml
└── StayBooker.slnx
Contributions are welcome! Please see CONTRIBUTING.md for details.
This project is licensed under the MIT License — see LICENSE for details.