Skip to content

API Accommodation Booking Service - Java-based Spring Boot project with Layered Architecture. Uses Telegram API, Stripe API and PostgreSQL RDB

Notifications You must be signed in to change notification settings

jv-sep23-binov/accommodation-booking-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BINOV BOOKING

Embark on a housing revolution with our BINOV Booking! 🌟 Our goal? Streamline property management, empower customers, and redefine how you experience housing rentals.

Picture this: Effortless booking, real-time property availability checks, and a seamless interface for both customers and managers. Add, view, and modify accommodations with ease. The best part? Secure, cashless transactions through Stripe, making payments a breeze. πŸ’³πŸ’¨

But wait, there's more! Stay in the loop with our Telegram Notifications Service. Get instant updates on bookings, cancellations, and successful payments. Say goodbye to the old and welcome the future of hassle-free, modern housing rentals! πŸš€πŸ 

P.S. You can easily read the documentation and test our project HERE.πŸ˜‰

img_1.png

We used such technologies and tools:

Spring Boot

A framework for building and deploying Java applications with an embedded server, simplifying configuration and accelerating development.

Spring Data JPA

Part of the Spring Data project, providing an abstraction for working with databases through JPA (Java Persistence API), simplifying interaction with relational databases.

Spring MVC

Model-View-Controller framework for developing web applications, enabling easy creation of websites and web services.

Spring Security

Framework for securing Spring applications, adding authentication and authorization to protect resources.

AWS (Amazon Web Services)

A comprehensive and widely-used cloud computing platform offering a variety of services such as computing power, storage, databases, machine learning, and more.

Docker

Platform for automating deployment and managing containerized applications, simplifying work with isolated environments.

JUnit

A popular testing framework for Java that provides annotations to identify test methods, assertions for testing expected results, and test runners for executing test cases.

Liquibase

Tool for version control of database schemas, allowing controlled schema changes.

Lombok

Library that automates code generation to reduce boilerplate cLombok: ode, such as getters, setters, and equals/hashCode.Lombok: ode, such as getters, setters, and equals/hashCode.

Mapstruct

Library for automatic code generation of mappings between Java objects, simplifying conversion between different models.

Maven

Tool for managing project dependencies, compilation, building, and publishing of Java programs.

Mockito

A mocking framework for Java that allows the creation of mock objects in automated tests, facilitating the isolation of code units for more effective testing.

PostgreSQL

Relational database that uses the SQL language for managing and interacting with data.

Stripe API

A set of tools and APIs for building online payment solutions, allowing developers to integrate payment processing into their applications.

Swagger

Tool for automatically generating API documentation, allowing developers to interactively engage with and understand the structure of the API.

Telegram API

A set of APIs provided by Telegram Messenger for building chatbots, integrations, and other applications on the Telegram platform.

img_1.png

Project structure:

img_1.png

The project has such controllers:

πŸ“πŸ”‘Authentication Controller - endpoints with open access for new users who want to register and for registered users who want to log in.

HTTP method Endpoint Description
POST /auth/registration Register a new customer.
POST /auth/login Login as a registered customer.

πŸ§‘β€πŸ’Ό Customer Controller - endpoints for managing customers.

HTTP method Endpoint Role Description
PUT /customers/{id}/role" MANAGER Enables managers to update customers roles, providing role-based access.
GET /customers/me CUSTOMER Retrieves the profile information for the currently logged-in customer.
PUT /customers/me CUSTOMER Allows customers to update their profile information.

🏠 Accommodation Controller - endpoints for managing accommodations.

HTTP method Endpoint Role Description
POST /accommodations MANAGER Permits the addition of new accommodations.
GET /accommodations CUSTOMER Provides a list of available accommodations.
GET /accommodations/{id} CUSTOMER Retrieves detailed information about a specific accommodation.
PUT /accommodations/{id} MANAGER Allows updates to accommodation details.
PUT /accommodations/{id}/address MANAGER Allows updates to accommodation address.
DELETE /accommodations/{id} MANAGER Enables the removal of accommodations.

πŸ—“οΈ Booking Controller - endpoints for managing bookings.

HTTP method Endpoint Role Description
PATCH /bookings/{id}/status MANAGER Allows manager to change booking status.
POST /bookings CUSTOMER Permits the creation of new accommodation bookings.
GET /bookings/my CUSTOMER Retrieves customer bookings.
GET /bookings/{id} CUSTOMER Provides information about a specific booking.
PUT /bookings/{id} CUSTOMER Allows customers to update their booking details.
DELETE /bookings/{id} CUSTOMER Enables the cancellation of bookings.
GET /bookings//search MANAGER Retrieves bookings based on customer ID and their status.

πŸ’³ Payment Controller (Stripe) - endpoints for managing payments.

HTTP method Endpoint Role Description
GET /payments ALL Get payments history of certain customer.
POST /payments MANAGER Checkout payment for user's booking.
GET /payments/success - Redirection after successfully processing of payment.
GET /payments/cancel - Redirection after unsuccessfully processing of payment.

img_4.png

img_1.png

Notifications Service (Telegram):

Receive instant updates on:

  • πŸ“… New bookings
  • 🏑 Newly created/released accommodations
  • πŸ’³ Successful payments

Our Notifications Service acts as the central hub, allowing seamless interactions with other services to keep administrators in the loop. πŸ”„

Key Features:

  • πŸ€– Utilizes Telegram API for secure notifications
  • πŸ’¬ Engage through Telegram Chats
  • πŸš€ Enhance efficiency with purpose-built Telegram Bots

Stay in control and informed with our Telegram Notifications Service! 🌟

img_1.png

Challenges and Solutions:

  1. ❌Payment Session Creation

    Challenge: We encountered difficulties in creating payment sessions, but through diligent research and exploration of the Stripe documentation, we successfully resolved these issues. Understanding the intricacies of payment session creation proved crucial to ensuring a seamless payment process.

  2. 🚨Console Error Overload

Challenge: Our console was flooded with errors, mainly stemming from the fact that a single token was used by everyone. This issue was hampering the user experience and platform functionality.

Solution: To overcome this challenge, we implemented a solution by creating a new bot for each user. This not only addressed the error overload but also improved the security and individualized the interactions for each user, ensuring a more stable and reliable system.

img_1.png

Possible Improvements:

  • 🌟 User Reviews and Ratings: Implement a feature for users to leave reviews and ratings for accommodations. This can enhance the decision-making process for other users and provide valuable feedback for property owners.

  • πŸ” Advanced Search Filters: Enhance the search functionality with advanced filters such as price range, specific amenities, and accommodation types. This will provide users with more precise search results based on their preferences. img_1.png

You can test and use this project:

  1. πŸš€ Install Docker
  2. πŸ“¦ Clone THIS repository
  3. πŸ”§ Configure a ".env" file with necessary environment variables
  4. πŸ› οΈ Run the command mvn clean package
  5. 🚒 Use docker-compose up --build to build and launch Docker containers
  6. 🌐 Access the locally running application at http://localhost:8088

OR

  1. You can easily read the documentation and test our project HERE. img_1.png

Authors:

Releases

No releases published

Packages

No packages published