Skip to content

w-araujo/hotel-reservation-system

Repository files navigation

Hotel Reservation System

Creation of an API that manages guests and their reservations for a specific hotel

Table of Contents

🚀 Overview

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.

er

swagger

🛠️ Technologies Used

📦 Installation

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/

🚀 Usage

  • 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 file entrypoint-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

🚀 Features

Public Endpoints

  1. Register guests (Creating a generic address) | route -> (POST) guest/create
  2. Login to the system | route -> (POST) session/login

Administrator Permission (ADMIN)

  1. Can log in to the system | route -> (POST) session/login
  2. Can register new addresses (not necessary) | route -> (POST) address/create
  3. Can edit guests’ addresses or their own | route -> (PATCH) address/update/{id}
  4. Can edit guests’ data or their own | route -> (PATCH) guest/update/{id}
  5. Can update reservation to “CHECK IN” | route -> (PATCH) reservation/update/changeStatusCheckin/{id}
  6. Can update reservation to “CHECK OUT” | route -> (PATCH) reservation/update/changeStatusCheckout/{id}
  7. Can list reservations within a period | route -> (GET) reservation/getReservationsByPeriod

Guest Permission (GUEST)

  1. Can log in to the system | route -> (POST) session/login
  2. Can edit their guest data | route -> (PATCH) guest/selfUpdate
  3. Can edit their address | route -> (PATCH) address/selfUpdate
  4. Can list their own reservations | route -> (GET) profile/selfReservations
  5. Can create their reservation | route -> (POST) reservation/create
  6. Can cancel their reservation | route -> (PATCH) reservation/update/changeStatusCanceled/{id}

📝 License

This project is under the MIT license. See the file LICENCE for more details.

📧 Contact

LinkedIn

GitHub

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published