Skip to content

Latest commit

 

History

61 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hotel Manager Web App

Description

The Hotel Manager App is a web application which allows hotel managers to manage bookings and users to book those rooms.

Hotel Manager API

Libraries Used

  • Spring Boot
  • Spring Data JPA
  • Spring Web
  • Postgresql

Setup Instructions

  1. Clone the repository:
git clone https://github.com/PiravenNan/HotelManager 
  1. Navigate to the project directory
cd HotelManager
  1. Ensure you have Java, Maven and PostgreSQL installed and running. Create the database:
createdb hotelBooking
  1. Build the project
mvn clean install
  1. Start the application
mvn spring-boot:run
  1. Access the application at https://localhost:8080

API Routes

Users

  • Add New User:

    • Method: Post
    • URL: /users/addUser
    • Request Body:
      {
        "username" : "String",
        "password" : "String",
        "name"     : "String"
      }
  • Update User Info:

    • Method: Patch
    • URL: /users/updateUser/{userId}
    • Request Body:
      {
        "password" : "String (optional)",
        "name"     : "String (optional)"
      }
  • Book User to Room:

    • Method: POST
    • URL: /users/booking/{userId}/{roomId}
  • Remove User from Room:

    • Method: DELETE
    • URL: /users/booking/{userId}/{roomId}
  • Get User by ID:

    • Method: GET
    • URL: /users/user/{userId}

Managers

  • Get Manager by Id:

    • Method: GET
    • URL: /managers/{managerId}
  • Add New Manager:

    • Method: Post
    • URL: /managers/addManager
    • Request Body:
      {
        "username" : "String",
        "password" : "String",
        "name"     : "String"
      }
  • Update Manager Info:

    • Method: Patch
    • URL: /managers/updateManager/{managerId}
    • Request Body:
      {
        "password" : "String (optional)",
        "name"     : "String (optional)"
      }
  • Add New Building:

    • Method: Post
    • URL: /managers/addNewBuilding/1
    • Request Body:
      {
        "numberOfFloors"  : "int",
        "roomsPerFloor"   : "int",
        "capacityPerRoom" : "int",
        "dayRate"         : "int"
      }
  • Get All Buildings by Manager's Id:

    • Method: GET
    • URL: /allBuildings/{managerId}

Buildings

  • Get Building by Id:

    • Method: GET
    • URL: /buildings/{buildingId}

Rooms

  • Get Room by Id:

    • Method: GET
    • URL: /rooms/{roomId}
  • Get Room by Building and RoomNumber:

    • Method: GET
    • URL: /rooms/getRoomByDoorNumber/{buildingID}/{doorNumber}
  • Update Room Properties:

    • Method: Patch
    • URL: /rooms/updateRoom/{roomId}
    • Request Body:
      {
        "Capacity" : "int (optional)",
        "DayRate"  : "int (optional)"
      }

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages