Hotelium is a hotel booking manager that allows users to create accounts, search for hotels, view hotel details, and make reservations.
Project Name: Hotelium 🏨🌍💼
Development Start Date: 23/11/2023 ⏩
Status: Paused 🛑
Technologies used: ☕ Spring Boot | Ⓜ Maven | 🔐 Spring Security | 💾 MySQL | 🚈 Railway | 🪂 Swagger | 🟠 Postman
🚈 Railway Deploy Link: Coming soon
🪂 Swagger Link: Coming soon
🟠 Postman Import File Link: Hotelium Postman
Hotelium is a comprehensive solution designed to simplify the management of hotel bookings. It provides users with a seamless experience from account creation to booking confirmation, ensuring efficiency and ease of use for both hotel managers and guests.
- User Registration & Authentication: Create an account and log in securely.
- Hotel Search: Search hotels by destination, check-in/out dates, and guest details.
- Hotel Details: View descriptions, amenities, and room prices.
- Room Booking: Select and reserve rooms with payment details.
- Booking Management: View, manage, and cancel reservations.
Development followed clear stages from environment setup to final documentation. For details, refer to the project.todo
file in the project root.
The postman-hotelium.json
file in the project contains all configured routes. You can import this file into Postman and start using the routes without manually exploring the code. Additionally, JSON bodies for tests are already saved in the files.
Swagger provides a user-friendly interface to explore and test the API endpoints. You can access the Swagger UI at Hotelium Swagger.
Spring Security is a powerful and flexible framework that focuses on authentication and authorization within Java applications. It helps secure the application by managing user access based on roles and permissions, protecting endpoints, and ensuring that sensitive operations are only available to authorized users.
In Hotelium, Spring Security is integrated to handle user login, protecting the application against unauthorized access. It provides a robust security layer that includes features like password encryption, token-based authentication, and protection against common vulnerabilities.
For testing purposes, you can use the following credentials at {{base_url}}/auth
route:
{
"email": "email@email.com",
"password": "hotelium"
}
Please note that Railway may be deactivated due to inactivity or other technical reasons. If this happens, you may need to clone the repository to your machine and connect to the database locally.
Clone the repository:
git clone https://github.com/LadyJessie19/Hotelium.git
To start the application:
- Navigate to the project directory.
- Run the following command to build and start the application:
mvn spring-boot:run
This will start the application on the default port, typically 8080
.
-
Import the file
postman-hotelium.json
into Postman. -
Create a new environment in Postman.
-
Set the environment variable
base_url
with the server address:- If running locally, the
base_url
will behttp://localhost:8080
. - If running on Railway, the
base_url
will behttps://hotelium.up.railway.app
. - Note: I prefer not to include the "/" at the end of the
base_url
variable, so I add it manually in each route.
- If running locally, the
-
Set another environment variable called
token
for the authentication token:- Explanation: To automate tests, I created a script within the
Login
route that generates the token and saves it in the environment variable. A test user is available in the database (if still active) with the following credentials:
{ "email": "email@email.com", "password": "hotelium" }
- Explanation: To automate tests, I created a script within the
- Note: All of this is already saved in the Postman import file. Just run the request to
{{base_url}}/auth
for thetoken
variable to be updated automatically. Oh, and all requests are already configured withToken
in the Authorization headers configuration. 🥳
Ready! Now you can test the routes and access the files. 😉
- Developer: Jessie M Bentes
If you want to contribute to the project, follow these steps:
- Fork the project.
- Create a new branch (
git checkout -b feature/new-feature
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/new-feature
). - Create a new Pull Request.
This project is licensed under the MIT License.