Travel-and-Accommodation-Booking-Platform

Your Next Adventure Awaits - Explore Our Travel and Accommodation Solutions! 🚀🌍🌟

Overview 💥

This project is a comprehensive hotel booking platform designed to provide users with a seamless experience in searching for hotels, viewing detailed information, and making secure bookings. The platform features an advanced search capability, personalized recommendations, and a secure checkout process. For administrators, there is a dedicated interface for managing cities, hotels, and rooms, with functionalities for creating, updating, and deleting entries. User authentication is handled securely through JWT, ensuring robust role-based access control and a maintainable system architecture.

Functional Requirements And Non-Functional Requirements

🗂 Database Schema Design

DataBaseDigram

Key Features 🌟

1.🔒 User Authentication

🌐 API Endpoints

User Endpoints

HTTP Method Endpoint Description Authorization
POST /api/auth/register Create a new user account with username, password, and email. All
POST /api/auth/login Authenticate a user and generate a token if credentials are valid. All

Role Endpoints

HTTP Method Endpoint Description Authorization
POST /api/auth/assign-role Assign a role to a user identified by their email address. Admin

Token Endpoints

HTTP Method Endpoint Description Authorization
POST /api/token/revokeToken Revokes the specified token and removes it from the user’s refresh tokens. User or Admin

Detailed Endpoint Description:

Owner Endpoints

HTTP Method Endpoint Description Authorization
GET /api/owner/{id} Retrieve an owner by its unique identifier. All
POST /api/owner Create a new owner. Admin
PUT /api/owner/{id} Update an existing owner. Admin
DELETE /api/owner/{id} Delete an existing owner. Admin
GET /api/owner Retrieve all owners. All

City Endpoints

HTTP Method Endpoint Description Authorization
POST /api/city Add a new city. Admin
GET /api/city Retrieve cities with optional filtering by name and description. All
GET /api/city/{id} Retrieve a city by its unique identifier, with optional hotels. All
PUT /api/city/{id} Update the information of an existing city. Admin
DELETE /api/city/{id} Delete an existing city. Admin
GET /api/city/{cityId}/hotels Retrieve hotels for a specific city. All
POST /api/city/{cityId}/hotels Add a hotel to a specific city. Admin
DELETE /api/city/{cityId}/hotel/{hotelId} Remove a hotel from a specific city. Admin
POST /api/city/{cityId}/upload-image Upload an image for a specific city. Admin
DELETE /api/city/{cityId}/delete-image/{publicId} Delete an image from a specific city. Admin
GET /api/city/{cityId}/images Get all images for a specific city. All

Hotel Endpoints

HTTP Method Endpoint Description Authorization
POST /api/hotel Add a new hotel. Admin
GET /api/hotel Retrieve hotels with optional filtering by name and description. All
GET /api/hotel/{id} Retrieve a hotel by its unique identifier. All
PUT /api/hotel/{id} Update the information of an existing hotel. Admin
DELETE /api/hotel/{id} Delete an existing hotel. Admin
GET /api/hotel/{hotelId}/rooms Retrieve rooms for a specific hotel. All
POST /api/hotel/{hotelId}/rooms Add a room to a specific hotel. Admin
DELETE /api/hotel/{hotelId}/room/{roomId} Remove a room from a specific hotel. Admin
POST /api/hotel/{hotelId}/upload-image Upload an image for a specific hotel. Admin
DELETE /api/hotel/{hotelId}/delete-image/{publicId} Delete an image from a specific hotel. Admin
GET /api/hotel/{hotelId}/images Get all images for a specific hotel. All
POST /api/hotel/{hotelId}/amenities Add an amenity to a specific hotel. Admin
DELETE /api/hotel/{hotelId}/amenities/{amenityId} Remove an amenity from a specific hotel. Admin
GET /api/hotel/{hotelId}/amenities Get all amenities for a specific hotel. All
GET /api/hotel/{id}/rating Get the review rating of a specific hotel. All

Amenity Endpoints

HTTP Method Endpoint Description Authorization
GET /search-results/amenities Retrieve all available amenities. Includes details like name, description, and associated room classes. All

Booking Endpoints

HTTP Method Endpoint Description Authorization
POST /api/booking/confirm Confirm a booking and send a confirmation email. Requires booking confirmation data. All
GET /api/booking/{id} Retrieve a booking by its unique identifier. Admin
POST /api/booking/create Create a new booking. Requires user email in the token for identification. All
PUT /api/booking/{id}/Update_status Update the status of a booking. Requires user email in the token. User

Home Page Endpoints

HTTP Method Endpoint Description Authorization
GET /api/homepage/trending-destinations Get the top 5 most visited cities with details. All
GET /api/homepage/search Search for hotels based on various criteria such as city name, star rating, number of rooms, and dates. All

Invoice Endpoints

HTTP Method Endpoint Description Authorization
POST /api/invoice Creates a new invoice record. Admin
GET /api/invoice/{id} Retrieves a specific invoice record by ID. All
GET /api/invoice/by-booking/{bookingId} Retrieves all invoice records for a specific booking. All
PUT /api/invoice/{id} Updates an existing invoice record. Admin
DELETE /api/invoice/{id} Deletes an invoice record. Admin

Review Endpoints

HTTP Method Endpoint Description Authorization
POST /api/review Creates a new review. Requires ‘User’ role. User
GET /api/review/{id} Retrieves a review by its ID. All
PUT /api/review/{id} Updates an existing review. Requires ‘User’ role. User
DELETE /api/review/{id} Deletes a review by its ID. Requires ‘Admin’ role. Admin

Room Class Endpoints

HTTP Method Endpoint Description Authorization
POST /api/roomclass Creates a new room class. Requires ‘Admin’ role. Admin
GET /api/roomclass/{id} Retrieves a specific room class by ID. All
PUT /api/roomclass/{id} Updates an existing room class. Requires ‘Admin’ role. Admin
POST /api/roomclass/{roomClassId}/addamenity Adds an amenity to a specific room class. Requires ‘Admin’ role. Admin
DELETE /api/roomclass/{roomClassId}/amenities/{amenityId} Deletes an amenity from a specific room class. Requires ‘Admin’ role. Admin
GET /api/roomclass/{roomClassId}/amenities Retrieves all amenities for a specific room class. All
POST /api/roomclass/{roomClassId}/rooms Adds a new room to a specific room class. Requires ‘Admin’ role. Admin
GET /api/roomclass/{roomClassId}/rooms Retrieves all rooms for a specific room class. All
DELETE /api/roomclass/{roomClassId}/rooms/{roomId} Deletes a specific room from a room class. Requires ‘Admin’ role. Admin
POST /api/roomclass/{roomClassId}/upload-image Uploads an image for a specific room class. Requires ‘Admin’ role. Admin
DELETE /api/roomclass/{roomClassId}/delete-image/{publicId} Deletes an image from a specific room class. Requires ‘Admin’ role. Admin
GET /api/roomclass/{roomClassId}/image/{publicId} Retrieves details of an image associated with a specific room class. All

Room Endpoints

HTTP Method Endpoint Description Authorization
GET /api/room/by-price Retrieves rooms within a specific price range. All
GET /api/room/{id} Retrieves a specific room by ID. All
POST /api/room/{roomId}/upload-image Uploads an image for a specific room. Requires ‘Admin’ role. Admin
DELETE /api/room/{roomId}/delete-image/{publicId} Deletes an image from a specific room. Requires ‘Admin’ role. Admin
GET /api/room/{roomId}/image/{publicId} Retrieves details of an image associated with a specific room. All
GET /api/room/available-without-bookings Retrieves available rooms with no bookings. All

Discount Endpoints

HTTP Method Endpoint Description Authorization
POST /api/discount Adds a new discount to a room. Admin
PATCH /api/discount/{id} Updates a discount by ID. Admin
GET /api/discount Retrieves a list of all available discounts. All
GET /api/discount/{id} Retrieves the details of a specific discount by ID. All
DELETE /api/discount/{id} Deletes a discount by ID. Admin
GET /api/discount/active Retrieves a list of currently active discounts. All
GET /api/discount/top-discounts Retrieves a list of rooms with the highest active discounts. All

Image Endpoints

HTTP Method Endpoint Description Authorization
POST /api/image/{entityType}/{entityId}/upload-image Uploads an image for a specific entity (e.g., room, hotel) using the entity type and ID. Admin
GET /api/image/images/{type} Retrieves all images associated with a specific entity type. User or Admin
DELETE /api/image/delete-image/{publicId} Deletes an image by its PublicId. Admin
GET /api/image/details/{publicId} Retrieves details of an image by its PublicId. User or Admin

Hotel Amenities Endpoints

HTTP Method Endpoint Description Authorization
GET /api/hotelAmenities Retrieve amenities by hotel name with optional pagination. Admin, User
GET /api/hotelAmenities/all Retrieve all amenities by hotel name. Admin, User
PUT /api/hotelAmenities/{amenityId} Update a specific amenity by its ID. Admin

Layered architecture

Clean Architecture It achieves this by separating the application into different layers that have distinct responsibilities:

clean-architecture-layers

1. Domain Layer

Contains the core business logic and domain entities. This layer is independent of other layers and focuses on the business rules and domain models.

Components:

Image Storage

Cloudinary Integration

Cloudinary is used for managing and storing images in the Hotel Booking Platform. It provides a scalable, secure, and feature-rich solution for image storage and transformation.

cloud

We add account informations on appsettings.json and create an entity whose name is CloudinarySettings.

setting

1. Image Upload

2. Image Retrieval

3. Image Deletion

0

🔋🪫 Testing Frameworks

Ensuring code quality and functionality with comprehensive testing suites using:

Design Patterns

In the Hotel Booking Platform, several design patterns are employed to ensure a clean, maintainable, and scalable architecture. Here’s a summary of the key patterns used:

1. Unit of Work Pattern

The Unit of Work pattern is used to manage changes to multiple entities in a single transaction. This pattern ensures that changes to the database are handled in a single unit, maintaining data consistency and integrity.

Unitofwork

2. Generic Repository Pattern

The Generic Repository pattern provides a way to manage CRUD operations in a consistent and reusable manner. This pattern abstracts the data access layer and provides a generic implementation for common operations.

layers

🕰️ Project Management

Use of Trello for Task Management

Board

Setup Guide

1. System Requirements

2. Clone the Repository

git clone https://github.com/Leen-odeh3/Travel-and-Accommodation-Booking-Platform.git
cd Travel-and-Accommodation-Booking-Platform

3. Configure appsettings.json

Open the appsettings.json file located in your project directory and configure the connection string for SQL Server. Replace the <connection_string> placeholder with your SQL Server connection string:

  "ConnectionStrings": {
    "SqlServer": "<connection_string>"
  }
}

🛟 Contact and Support

If you have any questions or comments about the project, please feel free to contact me at leenodeh287@gmail.com.

🏅 Acknowledgements

I extend my sincere gratitude to Foothill Technology Solutions for granting me the opportunity to participate in this internship cycle. Their unwavering support has been instrumental throughout the development of this project.

![download](https://github.com/user-attachments/assets/e0ff60a8-63e0-44c6-8890-1391c1a39e75) #### Thank you for your interest. I look forward to hearing from you! 🥳