This is Accommodation Rental API, a spring-boot backend built for accommodation rental
Home Rental provides different operations:
- Role-based access/authorization (Admin, Customer)
- User management: Allows to find/edit data about users in system
- Accommodation management: Allows to find/create/remove/edit data about accommodations in system
- Booking management: Allows to find/create/remove/edit data about bookings of avaliable accommodations
- Payment management: Allows to create/confirm/cancel/renew payments with support of Stripe payment system
- Telegram notifications: Admin users can be notified through Telegram bot about key operations in system
Core:
| Tool | Description |
|---|---|
| Java 17 | Core programming language of the backend |
| Maven | Project management and build tool |
Spring:
| Tool | Description |
|---|---|
| Spring Boot 3.4.2 | Advanced architecture framework for building applications |
| Spring Boot Web | Enables embedded web server and REST API development |
| Spring Data JPA | Simplifies database access operations using JPA and ORM |
| Spring Boot Security | Provides authentication and authorization capabilities |
| Spring Boot Validation | Ready-to-use collection of data constraints/checks |
Data storage and access:
| Tool | Description |
|---|---|
| MySQL 8.0.33 | Database management system |
| Hibernate | Bidirectional mapping tool between Java code and SQL database |
| Liquibase | Tool for database creation and version control |
External functional API:
| Tool | Description |
|---|---|
| Telegram Bots | HTTP-based interface to build bots for Telegram |
| Stripe API | Library to integrate Stripe payment functions to API project |
Additional libs and tools:
| Tool | Description |
|---|---|
| Lombok | Library for Java code simplification |
| MapStruct | Tool for simple data mapping |
| JWT | Authorization standard |
| Swagger | Tools to create API documentation |
| Docker | Platform for project packaging and deployment |
| Test Containers | Library to use lightweighted databases for tests |
- Download Java and Maven.
- Open your terminal (cmd) and check Java installation by
java -versionand Mavenmvn -version - Clone repository: Open your terminal (cmd) and use
https://github.com/MishaHMK/Home-Rental-App.git. - Download and install MySQL.
- Open your terminal (cmd) and create MySQL user
mysql -u USER -p. - Create a database
CREATE DATABASE DB_NAME; - Add .env file in root folder of cloned project and write down a configuration:
- Download and install Docker if you won't use Docker
put
spring.docker.compose.enabled=falsein src/main/resources/application.properties - Check if all data in .env file is put and resources files in src/main and src/java are filled
- Open terminal (cmd) in root folder and do
docker-compose buildanddocker-compose up - Run project
mvn clean installand thenjava -jar target/HomeRentalApp-0.0.1-SNAPSHOT.jar - Proceed to localy started Interactive Swagger Documentation
🔸 The project is also testable in deployed Documentation
https://www.loom.com/share/2aa05782c1404ab8a40fd4744d493328
More than 80% lines of code are covered with JUnit tests

Some endpoints require a [role] for access, use JWT token (Bearer) or Basic authentication.
AuthController: Handles registration and login requests.
- POST:
/api/auth/registration- register new user. - POST:
/api/auth/login- login user and receive JWT token.
UserController: Handles registration and login requests.
- PUT:
/api/users/update- update currently logged in user profile data [Admin]. - PATCH:
/users/{userId}/role- update role of the selected user by his id. - GET:
/api/users/me- receive currently logged in user info.
AccommodationController: Handles requests for accommodations operations (Authorization is required).
🔸 Allowed accomodation type values are: HOUSE, APARTMENT, CONDO, VACATION_HOME.
- GET:
/api/accommodations- Receive all accommodations. - GET:
/api/accommodations/{id}- Receive a specific accommodation data by its ID. - POST:
/api/accommodations- Create a new accommodation. [Admin] - PUT:
/api/accommodations/{id}- Update accommodation data by its ID. [Admin] - DELETE:
/api/accommodations/{id}- Soft delete accommodation. [Admin]
BookingController: Handles requests for bookings operations (Authorization is required).
🔸 Allowed booking type values are: PENDING, CONFIRMED, CANCELED, EXPIRED.
- GET:
/api/bookings/my- Receive all bookings of logged in user. - GET:
/api/bookings/{id}- Search a specific booking by ID. [Admin/Customer owner] - GET:
/api/bookings/search- Fiter booking by statuses or user id with optional pagination. [Admin] - POST:
/api/bookings- Create new booking. [Admin] - PUT:
/api/bookings/{id}- Update booking data. [Admin] - PUT:
/api/bookings/update-status/{id}- Change booking status. [Admin] - DELETE:
/api/bookings/{id}- Soft delete booking. [Admin]
PaymentController: Handles requests for order operations.
🔸 Allowed payment type values are: PENDING, PAID, CANCELED, EXPIRED
- GET:
/api/payments- Receive all user orders. - GET:
/api/payments/success- Receive payment confirmation. - GET:
/api/payments/cancel- Receive payment cancellation. - POST:
/api/payments- Create new payment. - PATCH:
/api/payments/{id}- Renew expired payment. [Admin]
