Skip to content

IhorTrokhymchuk/booking-application

Repository files navigation

Booking Application API

My Photo

Project Description

Imagine a booking service in your area, offering individuals the opportunity to rent homes, apartments, and other accommodations for their chosen duration. Currently, this service faces significant operational challenges due to antiquated, manual processes for managing properties, renters, financial transactions, and booking records. Our project addresses these issues by creating an efficient online platform for managing housing rentals, transforming the way people experience accommodation booking.

Technologies

Here's a breakdown of the main technologies used in this project:

Frameworks and Libraries

  • Spring Boot: Framework for building Java-based applications. It provides a comprehensive set of tools for building RESTful APIs, integrating with databases, and more.
  • Spring Data JPA: Allows for seamless interaction with relational databases using JPA (Java Persistence API).
  • Spring Security: Provides authentication and authorization capabilities, with JWT support.
  • Springdoc OpenAPI: Offers OpenAPI (Swagger) documentation for your RESTful APIs.

Database and ORM

  • MySQL: The primary database for storing booking information, user data, and other details.
  • Liquibase: A tool for managing database migrations and version control for schema changes.
  • MapStruct: A mapping framework for converting between data objects and DTOs.

Testing

  • JUnit: The primary testing framework.
  • Testcontainers: Allows for integration testing with real database instances.
  • Mockito: Provides support for mocking dependencies in tests.

Messaging and Integration

  • Telegram Bots: Integration with Telegram for automated messaging and notifications.
  • Stripe: A platform for handling online payments and transactions.

Utilities

  • Lombok: Helps reduce boilerplate code for entity classes and more.
  • Checkstyle: A tool to ensure code style consistency.
  • Dotenv: Simplifies environment variable management.
  • Docker Compose: Facilitates running multiple Docker containers for development and testing.

Project Structure

The project follows the standard Spring Boot structure with controllers, services, and repositories. The src directory contains the source code, and the test directory includes test cases.

Setup

To set up and run the project locally, follow these steps:

  1. Ensure you have Java 17 installed.
  2. Ensure you have Maven installed.
  3. Ensure you have Docker installed.
  4. Update the database configuration in the .env file.
  5. Build the project using Maven:
    mvn clean package
  6. Build the image using Docker:
    docker compose build
  7. Run the application using Docker:
    docker-compose up

Example .env

###MYSQL###
MYSQLDB_USER=root
MYSQLDB_ROOT_PASSWORD=root1234
MYSQLDB_DATABASE=booking_app
MYSQLDB_LOCAL_PORT=3307
MYSQLDB_DOCKER_PORT=3306

###DOCKER###
SPRING_LOCAL_PORT=8081
SPRING_DOCKER_PORT=8080
DEBUG_PORT=5005

###JWT###
JWT_SECRET=horekrtrfkjbadjw12345jwodjwod1234jwdjowj9234902349
JWT_EXPIRATIONS=300000

###STRIPE_SECRET_KEY###
STRIPE_SECRET_KEY=
STRIPE_CANCEL_URL=http://localhost:8081/payments/cancel/{CHECKOUT_SESSION_ID}
STRIPE_SUCCESS_URL=http://localhost:8081/payments/success/{CHECKOUT_SESSION_ID}

###TELEGRAM###
BOT_NAME=
BOT_TOKEN=
TELEGRAM_SECRET=qrasderkajs564re

For use

  1. User 1:

  2. User 2:

Postman Collection

For a quick start, use the provided Postman collection to test the API endpoints. Import the collection into Postman and follow the included documentation.

Acknowledgments

Special thanks to the Spring Boot community and the contributors to the libraries and tools used in this project. Your dedication and expertise make projects like these possible.

Feel free to explore, contribute, and provide feedback. Happy coding!

Contact

For questions or support, contact the project maintainer at [email protected]

About

This is a BookingApplication

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published