π¨ A Spring Boot-based REST API for managing hotel room reservations and user accounts.
810
Run the Application using Docker Compose
docker-compose up
All necessary configurations are included in the docker-compose.yml file and environment variables are defined in the .env file.
Set the database URL, username, and password in the application.properties file.
./mvnw spring-boot:run
| Method | Endpoint | Description | Access |
|---|---|---|---|
| POST | /api/auth/signup | Register a new user | Public |
| POST | /api/auth/signin | Login a user and get the authentication token | Public |
| GET | /api/rooms/available | Retrieve a list of available rooms between given dates | Public |
| GET | /api/rooms/{id} | Retrieve room details by ID | Public |
| GET | /api/rooms/room/{roomNumber} | Retrieve room by room number | Public |
| GET | /api/rooms/all | Retrieve all rooms as RoomDTO | Public |
| GET | /api/rooms/occupied | Retrieve all currently occupied rooms | HOTEL, ADMIN |
| GET | /api/rooms/availableNow | Retrieve all currently available rooms | Public |
| POST | /api/rooms/create | Create a new room | ADMIN |
| PUT | /api/rooms/update | Update an existing room | ADMIN |
| DELETE | /api/rooms/{id} | Delete a room by ID | ADMIN |
| GET | /api/user | Retrieve the authenticated userβs details | Authenticated |
| GET | /api/user/all | Retrieve all users | HOTEL, ADMIN |
| PUT | /api/user/update/password | Update the authenticated userβs password | Authenticated |
| PUT | /api/user/update/personal | Update the userβs personal data | Authenticated, ADMIN |
| POST | /api/user/create | Create a new user with specific role | ADMIN |
| DELETE | /api/user/{username} | Delete a user | ADMIN |
| GET | /api/user/search | Search for users based on some criteria | HOTEL, ADMIN |
| GET | /api/user/find | Find a specific user by ID, username or email | HOTEL, ADMIN |
| GET | /api/guest/all | Retrieve all guests | HOTEL, ADMIN |
| PUT | /api/guest/update/personal | Update the guest's personal data | HOTEL, ADMIN |
| POST | /api/guest/create | Create a new guest | HOTEL, ADMIN |
| GET | /api/hotel/allGuests | Retrieve all Users and Guests | HOTEL, ADMIN |
| GET | /api/hotel/searchGuests | Search for Users and Guests based on some criteria | HOTEL, ADMIN |
| GET | /api/hotel/findGuest | Find a specific Guest or User by ID | HOTEL, ADMIN |
| POST | /api/hotel/checkin/{reservationId} | Check-in with a given reservation ID | HOTEL, ADMIN |
| POST | /api/hotel/checkout/{reservationId} | Check-out with a given reservation ID | HOTEL, ADMIN |
| POST | /api/hotel/confirmReservation/{reservationId} | Confirm a given reservation ID | HOTEL, ADMIN |
| POST | /api/reservation/createReservation | Create a new reservation | Authenticated |
| GET | /api/reservation/{id} | Retrieve reservation details by ID | Authenticated |
| GET | /api/reservation/guest/{id} | Retrieve all reservations by guest ID | Authenticated |
| DELETE | /api/reservation/{reservationId} | Cancel a reservation by reservation ID | HOTEL, ADMIN |
| GET | /api/reservation/all | Retrieve all reservations | HOTEL, ADMIN |
| GET | /api/reservation/my | Retrieve all of the user's reservations | Authenticated |
| PUT | /api/reservation/update | Update an existing reservation | HOTEL, ADMIN |
The API is also documented using Swagger UI, which allows you to test endpoints directly from your browser.
π The Swagger UI page will then be available at http://server:port/swagger-ui.html and the OpenAPI description will be available at the following url for json format: http://server:port/v3/api-docs
For example, if you are running the application locally, it would be: http://localhost:8080/swagger-ui.htmlβ
By default, the application is initialized with an administrator account:
adminpasswordThis project is licensed under the MIT License - see the LICENSEβ file for details.
Content type
Image
Digest
sha256:a1126039dβ¦
Size
610 MB
Last updated
about 3 years ago
docker pull danio189/roomreserve