Welcome to the StaySwift: Effortless Accommodation Booking! Our platform is revolutionizing the rental process, providing a convenient and efficient experience for both seekers and administrators. For users, it's a straightforward journey from registration to booking their chosen accommodation. The user-friendly interface offers detailed information about each property, including type, location, size, amenities, daily rates, and real-time availability. For administrators, a powerful toolkit streamlines the management of the housing inventory. Adding, updating, and removing properties is a breeze, with instant availability information. Forget about paperwork – now everything is on your screen in real-time. Booking is under user control. From creating and managing bookings to modifications – it's all in the hands of the user. Administrators also easily access booking information for effective management. This is just a glimpse of how our service transforms the rental experience. Thank you for your understanding.
Technologies used <> How to use <> Entities <> Database Structure <> Endpoints <> Swagger <> Notification
If you use Postman, go to the postman
folder and import the file into Postman,
you will have all the endpoints that are in the application.
git clone https://github.com/0-zagar-0/booking-app.git
See an example of a sample .env-sample
docker-compose build
docker-compose up
example - http://localhost:8081
User with role CUSTOMER
email - [email protected]
password - User=123456789
User with role MANAGER
email - [email protected]
password - User=123456789
to use the endpoints, can you register a new user.
When you go to the session initialization endpoint, you will need to pass your card for payment, in test mode we use card_token
, for that follow this link
https://stripe.com/docs/testing?testing-method=tokens#pagos-rechazados
select the card you like and go to the Tokens
tab, maybe something like this: tok_visa
You can use these provided card tokens:
tok_visa
tok_mastercard
tok_visa_chargeDeclined
The user entity represents detailed information about registered users. At this stage, there are only 2 roles that grant certain access rights to users, these are: customer and manager.
The Accommodation entity holds crucial information about available living spaces. It includes details such as accommodation type (e.g., HOUSE, APARTMENT), location, size (e.g., STUDIO, ONE_BEDROOM), amenities, daily rental rate, and availability count. Soft deletion is implemented, allowing accommodations to be marked as deleted without permanent removal. This entity is fundamental to efficiently managing and offering diverse housing options within the system.
The Address entity serves as a cornerstone for storing location information within the system.
The Amenity entity represents various amenities available within the system. It incorporates fields for unique identification, amenity name, and a soft deletion flag.
The Booking entity represents a reservation made within the system. It includes information such as a unique identifier, check-in and check-out dates, the associated accommodation, the user making the booking, booking status, and a soft deletion flag.
The Payment entity encapsulates information about a financial transaction. It includes a unique identifier, payment status (e.g., PENDING, PAID), associated booking ID, session URL for payment processing, session ID, payment amount, and a soft deletion flag for improved data management.
HTTP Request | Endpoints | Security requirement | Description |
---|---|---|---|
POST | /api/auth/register | None | Allows users to register a new account. |
POST | /api/auth/login | None | Login with email and password. Response - JWT token |
HTTP Request | Endpoints | Security requirement | Description |
---|---|---|---|
GET | /api/users/me | CUSTOMER, MANAGER | Retrieves the profile information for the currently logged-in user. |
PUT | /api/users/{id}/role | MANAGER | Enables users to update their roles, providing role-based access. |
PUT | /api/users/me | CUSTOMER, MANAGER | Allows users to update their profile information. |
HTTP Request | Endpoints | Security requirement | Description |
---|---|---|---|
POST | /api/accommodations | MANAGER | Permits the addition of new accommodations. |
GET | /api/accommodations/all | NONE | Provides a list of available accommodations. |
GET | /api/accommodations/{id} | CUSTOMER, MANAGER | Retrieves detailed information about a specific accommodation. |
PATCH | /api/accommodations/{id} | MANAGER | Allows updates to accommodation details, including inventory management. |
DELETE | /api/accommodations/{id} | MANAGER | Enables the removal of accommodations. |
HTTP Request | Endpoints | Security requirement | Description |
---|---|---|---|
POST | /api/bookings | CUSTOMER, MANAGER | Permits the creation of new accommodation bookings. |
GET | /api/bookings/?user_id=...&status=... | MANAGER | Retrieves bookings based on user ID and their status. |
GET | /api/bookings/my | CUSTOMER, MANAGER | Retrieves user bookings |
GET | /api/bookings/{id} | CUSTOMER, MANAGER | Provides information about a specific booking. |
PATCH | /api/bookings/{id}/td> | CUSTOMER, MANAGER | Allows users to update their booking details. |
DELETE | /api/bookings/{id} | CUSTOMER, MANAGER | Enables the cancellation of bookings. |
HTTP Request | Endpoints | Security requirement | Description |
---|---|---|---|
GET | /api/payments/?user_id=... | MANAGER | Retrieves payment information for users. |
POST | /api/payments | CUSTOMER, MANAGER | Initiates payment sessions for booking transactions. |
GET | /api/payments/success | CUSTOMER, MANAGER | Handles successful payment processing through Stripe redirection. |
GET | /api/payments/cancel/ | CUSTOMER, MANAGER | Manages payment cancellation and returns payment paused messages during Stripe redirection. |
If you will test the application locally in swagger, then after launching the application, follow this link. Use the port specified in the .env file
http://localhost:8080/api/swagger-ui/index.html#
This project is also uploaded to AWS server, you can follow this link and use Swagger to test the application without installing anything
http://ec2-18-208-193-98.compute-1.amazonaws.com/api/swagger-ui/index.html#/
A telegram bot was created for managers to notify them about newly created reservations and paid or canceled payments. You can join the bot when you test the application.
https://t.me/Booking_Application_test_bot