Creation of an API that manages guests and their reservations for a specific hotel
This API is automated with Docker, running its migrations, creating typings, and running the API together with the SQL Server database. It has Swagger available for making requests and includes user permission control.
Make sure you have node installed on your computer: https://nodejs.org/pt
Make sure you have dokcer installed on your computer: https://www.docker.com/
- Open the terminal or command prompt.
-
To clone the project via HTTPS, run this command:
git clone https://github.com/w-araujo/hotel-reservation-system.git
-
Make a copy of the
.env.example
file and rename this copy to.env
, then fill in the remaining data. -
Now open the terminal at the root of the project and run the command
sudo docker compose up
to execute Docker Compose. -
Wait 30 seconds for the migrations to run automatically (if they don’t run, change the time
sleep
in the root project fileentrypoint-dev.sh
to a longer time) -
After completing all the steps above, run the seeds to populate the database with this command:
npm run prisma:seed
in the root project. - If you don’t want to run the seeds, create a guest (Swagger) and change their role to "ADMIN" directly in the database.
- Use Swagger at this URL: Swagger
- Register guests (Creating a generic address) | route -> (POST) guest/create
- Login to the system | route -> (POST) session/login
- Can log in to the system | route -> (POST) session/login
- Can register new addresses (not necessary) | route -> (POST) address/create
- Can edit guests’ addresses or their own | route -> (PATCH) address/update/{id}
- Can edit guests’ data or their own | route -> (PATCH) guest/update/{id}
- Can update reservation to “CHECK IN” | route -> (PATCH) reservation/update/changeStatusCheckin/{id}
- Can update reservation to “CHECK OUT” | route -> (PATCH) reservation/update/changeStatusCheckout/{id}
- Can list reservations within a period | route -> (GET) reservation/getReservationsByPeriod
- Can log in to the system | route -> (POST) session/login
- Can edit their guest data | route -> (PATCH) guest/selfUpdate
- Can edit their address | route -> (PATCH) address/selfUpdate
- Can list their own reservations | route -> (GET) profile/selfReservations
- Can create their reservation | route -> (POST) reservation/create
- Can cancel their reservation | route -> (PATCH) reservation/update/changeStatusCanceled/{id}
This project is under the MIT license. See the file LICENCE for more details.