Skip to content

Dev-Ahmed-Ashraf/Hotel_Booking_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

81 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏨 Hotel Booking System

A modern, scalable hotel booking system built with ASP.NET Core 8, Clean Architecture, CQRS, and Stripe Payments.

.NET C# License .NET CI / Docker Publish Docker Pulls

Swagger UI

✨ Key Features

For Hotel Guests

  • Browse and search hotels with filters
  • View room availability and pricing
  • Secure online booking with instant confirmation
  • Manage bookings and view history
  • Leave reviews and ratings

For Hotel Managers

  • Manage hotel and room listings
  • Handle bookings and check-ins/check-outs
  • View occupancy reports and analytics
  • Respond to guest reviews

For Administrators

  • Full system management
  • User and role administration
  • System configuration
  • Advanced reporting

πŸ› οΈ Technology Stack

πŸ— Architecture & Patterns

  • Clean Architecture (Domain β†’ Application β†’ Infrastructure β†’ API)
  • CQRS Pattern using MediatR
  • Repository Pattern + Unit of Work
  • Domain-Driven Design principles (Entities, Value Objects, Domain Events)
  • Specification Pattern for reusable queries
  • SOLID & Clean Code principles

βš™ Backend Technologies

  • .NET 8 / ASP.NET Core 8
  • Entity Framework Core 8 (SQL Server)
  • MediatR (Commands / Queries / Pipeline Behaviors)
  • FluentValidation for request validation
  • AutoMapper for DTO β†’ Entity mapping
  • Built-in Dependency Injection

πŸ” Authentication & Authorization

  • JWT Bearer Authentication
  • Role-Based Access Control (RBAC)
  • Policy-based authorization
  • Secure password hashing

🌐 API Capabilities

  • RESTful API design
  • API Versioning
  • Swagger / OpenAPI 3
  • Consistent API Response Wrapper
  • Global Exception Handling
  • CORS configuration
  • Response Caching
  • Response Compression

πŸ’Ύ Data & Persistence

  • SQL Server 2022
  • EF Core Migrations
  • Soft Delete support
  • Pagination, filtering, sorting
  • Optimized EF Core queries (AsNoTracking, compiled queries)

πŸ’³ Payments

  • Stripe PaymentIntent API
  • Webhook Handling (payment_intent.succeeded)
  • Automatic booking confirmation on payment success

πŸ§ͺ Testing

  • xUnit for unit testing
  • Integration Tests using WebApplicationFactory/TestServer
  • Moq for mocking
  • SQLite in-memory Integration Tests
  • Coverage reporting (Coverlet)

πŸ“Š Logging & Monitoring

  • Serilog (Console + File + Seq support)
  • Request/Response logging
  • Structured logging with enrichers
  • Health Checks (/health, /health/ready, /health/live)

🐳 DevOps & Deployment

  • Docker + Docker Compose
  • Environment-based configuration (Development/Production)
  • GitHub Actions (CI pipeline)
  • Secrets via Environment Variables / User Secrets

πŸ”’ Security

  • HTTPS enforcement
  • Security headers (CSP, HSTS, XSS-Protection)
  • Input validation
  • Output encoding
  • Rate limiting
  • CORS Policies

🧰 Developer Experience

  • Visual Studio 2022 / VS Code
  • Postman Collection included
  • Swagger UI for interactive testing
  • XML documentation comments

πŸš€ Quick Start

Prerequisites

Run with Docker (Recommended)

#Clone the repository
git clone https://github.com/Dev-Ahmed-Ashraf/Hotel_Booking_API.git
cd Hotel_Booking_API

#Start the full stack (API + SQL Server)
docker-compose up -d --build

πŸ“Έ Screenshots

Swagger Documentation

Postman Collection

JWT Authentication

API Response Examples

Admin Dashboard

Database Schema

πŸ“š Documentation

For detailed technical documentation, please refer to:

πŸ›  Built With

  • ASP.NET Core 8
  • EF Core 8
  • MediatR
  • FluentValidation
  • AutoMapper
  • Serilog
  • xUnit
  • Docker

🀝 Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

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

πŸ™ Acknowledgments

About

Hotel Booking API built with .NET 8 using Clean Architecture, CQRS, MediatR, AutoMapper, FluentValidation, Repository Pattern, JWT Authentication, Stripe payments, caching, logging, and SQLite integration tests.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages