Booking Brains is an apartment booking platform that connects property owners with renters. This repository contains the backend implementation of the system built with ASP.NET using the Clean Architecture, CQRS pattern and MediatR, providing APIs for user management, apartment listings, booking reservations, and review functionality.
- Registration and authentication for both regular users and owners
- Role-based access control (User/Owner)
- Profile management
- CRUD operations for apartment listings (owners only)
- Photo upload requirements (minimum 4 photos per listing)
- Search and filtering functionality
- Reservation creation with availability validation
- Booking status tracking (Pending/Confirmed/Canceled/Completed)
- Prevention of double bookings
- Booking history for users
- Post-stay reviews linked to completed bookings
- One review per booking policy
- Rating system for apartments
- Validation Middleware: Centralized validation for requests, ensuring clean controllers and consistent error responses
- Global Exception Handler: Unified error handling with custom exception types for better clarity and API standardization
- Caching Middleware: Implemented caching techniques to improve performance on frequent read operations
Core feature implemented to improve monitoring
- Kafka Producer: This backend acts as a Kafka Producer, sending detailed error logs to a Kafka Topic whenever an exception occurs in the application
- Topic Management with AdminClient API: In addition to sending messages, the application also uses Kafka's AdminClient API to programmatically create and manage topics.
- Kafka Topic: All logs are sent to the topic named error-logs-topic
- Asynchronous Communication: This process is asynchronous and does not block the main application's execution, ensuring better stability
- The Consumer project: BookingApp Kafka Consumer Project
- Framework: ASP.NET Core
- Database: Entity Framework Core with SQL Server
- Authentication: JWT Bearer Tokens
- API Documentation: Swagger/OpenAPI
- Pagination: For search results
- Middleware: Custom Validation Middleware, Global Exception Handling, Caching Techniques
- Email Notifications: For booking confirmations and updates
- SignalR Notifications: Sending notifications to respective owners everytime their apartment is booked
- Hangfire: Manage background jobs such as booking status update
- Apache Kafka: For event streaming and logging
- Docker: Used to set up the Kafka service in the local development environment
- .NET 6.0 SDK or later
- SQL Server
- Visual Studio 2022 or VS Code (with C# extensions)
-
Clone the repository
git clone https://github.com/aminatpwk/Booking-App cd Booking-App -
Configure the connection string in
appsettings.json{ "ConnectionStrings": { "DefaultConnection": "YOUR_SQL_URL" } } -
Run database migrations
dotnet ef database update
-
Start Kafka with Docker
- Make sure you have Docker Desktop installed and running
- From the project's root directory, execute this command:
docker-compose up
-
Run the application
dotnet run
The application will start and be available at https://localhost:7157 or http://localhost:5184.
The API follows RESTful conventions with these main resources:
/api/users- User registration and authentication/api/apartments- Apartment listings and search/api/bookings- Booking management/api/reviews- Review submissions
Access Swagger documentation at /swagger when running the application for detailed API endpoint information.

- Only owners can create/update apartment listings
- Bookings require availability validation
- Reviews can only be submitted for completed bookings
- All apartment listings must include at least 4 photos
- Users can only review apartments they've actually stayed in
You can test API directly from
- Swagger UI;
- Postman
This project is proprietary software developed by Amina.
treat people with kindness :)