The Booking Service is an application that provides functionality for managing property rent. As a customer you can easily join, search for appropriate option, create a reservation and pay by card. As a manager, you have a lot of tools to arrange accommodations, see all bookings, payments with its status of specific user, create new accommodations and update existing ones.
- automatic checking for expired bookings once a day (and sending a message to managers)
- 30 minutes to pay for created booking (otherwise it'll be cancelled)
- telegram notifications for users about creating bookings, payments and new accommodations available
- Technologies
- Architecture
- Features
- Class diagram
- Entities
- Endpoints
- Configure Telegram Bot and Stripe account
- Project Launch with Docker
- Test with Swagger on AWS
- Programming language: Java 17
- Spring Framework: Spring Boot v3.1.5, Spring Data, Spring Security v6.1.5 (Authentication using JWT token)
- Database Management: PostgreSQL 42.7.0, Hibernate, Liquibase v4.20.0
- Notification management: Telegram bot 5.2.0
- Payment processing: Stripe 22.3.0
- Testing: JUnit 5, Mockito, TestContainers v1.19.2, PostgreSQL 42.7.0
- Deployment and Cloud Services: Docker 3.8, AWS
- Additional instruments: Maven, Lombok, Mapstruct
- Documentation: Swagger
- register in system
- log in to the system
- view all available accommodations
- find exact accommodation by id
- create new booking
- view all your bookings
- find exact booking by id
- update booking
- cancel booking
- view your profile
- update your profile
- create new payment
- cancel payment
- receiving telegram notification about creating booking
- receiving telegram notification about cancelling booking
- receiving telegram notification about success payment
- receiving telegram notification when new accommodation is added
- receiving telegram notification when new accommodation is available for booking
- register in system
- log in to the system
- create new accommodation
- update existing one
- delete accommodation
- view all bookings and it's status
- view all payments all payment of specific user
- log in to the system
- do everything the MANAGER does
- update user's roles
- User - represents any user
- Role - represents user's role in app (customer, manager or admin)
- Accommodation - represents any property
- Booking - represents user's booking of specific property for some period
- Payment - represents user's payment for booking
Request type | Endpoint | Role | Description |
---|---|---|---|
POST | /api/auth/register | ALL | register a new user |
POST | /api/auth/login | ALL | login registered user |
Request type | Endpoint | Role | Description |
---|---|---|---|
POST | /api/accommodations | MANAGER/ADMIN | create new accommodation |
GET | /api/accommodations | ALL | get a list of all accommodations |
GET | /api/accommodations/{id} | ALL | get exact accommodation by id |
PUT | /api/accommodations/{id} | MANAGER/ADMIN | update exact accommodation by id |
DELETE | /api/accommodations/{id} | MANAGER/ADMIN | delete exact accommodation by id |
Request type | Endpoint | Role | Description |
---|---|---|---|
POST | /api/bookings | USER | create a new booking |
GET | /api/bookings/my | ALL | get user's bookings |
GET | /api/bookings | MANAGER/ADMIN | get all bookings |
GET | /api/bookings/{id} | USER | get user's booking by id |
PUT | /api/bookings/{id} | USER | update user's booking by id |
DELETE | /api/bookings/{id} | USER | delete user's booking by id |
Request type | Endpoint | Role | Description |
---|---|---|---|
POST | /api/payments | USER | create payment |
GET | /api/payments/success | ALL | redirect endpoint after success stripe payment |
GET | /api/payments/cancel | ALL | redirect endpoint after cancel stripe session |
GET | /api/payments | MANAGER/ADMIN | find all payments or payment of specific user |
Request type | Endpoint | Role | Description |
---|---|---|---|
GET | /api/users/me | USER | get user's profile |
PUT | /api/users/me | USER | update user's profile |
PUT | /api/users/{id}/role | ADMIN | update user's roles |
- to create a telegram bot and get secret token follow this instructions: https://blog.devgenius.io/how-to-set-up-your-telegram-bot-using-botfather-fd1896d68c02
- to create Stripe account ang get it secret follow next instructions: https://paymentsplugin.com/blog/stripe-api-keys
- Clone the repository from GitHub
- Create a
.env
file with the necessary environment variables (as an example for filling - .env.sample). - Run
mvn clean package
command - Run
docker-compose build
command to build, anddocker-compose up
to start the Docker containers - The application should be running at http://localhost:8088. You can test the operation of the application using swagger http://localhost:8088/swagger-ui/index.html.
Access the AWS deployment at http://ec2-3-94-255-245.compute-1.amazonaws.com/swagger-ui/index.html
Here you can find our telegram bot: https://t.me/lux_fm_booking_bot
If you want to test admin endpoints, use the following credentials:
- Email: admin@gmail.com
- Password: 123456