Skip to content

ronakmunjapara/StayBooker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


🏨 StayBooker

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.


📋 Table of Contents


🏗 Architecture Overview

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

Communication Patterns

Pattern Technology Usage
Synchronous gRPC / HTTP REST Booking Service validates guests & properties
Asynchronous RabbitMQ + MassTransit Booking → Payment → Notification event flow

🚀 Services

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

🛠 Tech Stack

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

🔄 Data Flow

Complete booking flow (10 steps):

  1. User sends POST /api/v1/bookings with guestId, propertyId, checkIn, checkOut, rooms
  2. API Gateway routes to Booking Service
  3. Booking Service validates guest via Guest Service
  4. Booking Service checks property availability via Property Service
  5. Booking is created in database (Status: Confirmed)
  6. BookingCreatedEvent published to RabbitMQ
  7. Payment Service processes payment → publishes PaymentProcessedEvent
  8. Booking Service updates status to Paid
  9. Notification Service sends confirmation email
  10. User receives booking confirmation response

🏁 Getting Started

# 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)

📁 Project Structure

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

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.


📄 License

This project is licensed under the MIT License — see LICENSE for details.


Built with ❤️ by @ronakmunjapara

About

Production-ready hotel booking platform built with .NET 10 microservices architecture featuring gRPC, RabbitMQ/MassTransit, YARP API Gateway, and Blazor WASM frontend.

Topics

Resources

License

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Contributors