This is a basic implementation of of CRUD (Create, Read, Update and Delete).
A backend API built using NodeJS and ExpressJS for a hotel management system. The API provides endpoints for managing room types and rooms.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
-
Run
git clone https://github.com/Estate360/Hotel_Management_API
to clone the repository to your local machine. -
Run
cd hotel-management-api
to navigate to the cloned repository directory. -
Run
npm install
to install the required dependencies.
Optionally, you can; Create a .env file and add the following environment variables: DATABASE=mongodb+srv://:@cluster0.ynrdrfw.mongodb.net/Hotel-Management?retryWrites=true&w=majority PORT=5000
- Run
npm run dev
to start the server.
The API should now be running at http://localhost:5000 or http://localhost:8800.
The API provides the following endpoints:
- POST /api/v1/room-types: Creates a new room type
- GET /api/v1/room-types: Gets all room types
- POST /api/v1/rooms: Creates a new room
- GET /api/v1/rooms: Gets all rooms with optional filters: search, roomType, minPrice, and maxPrice
- PATCH /api/v1/rooms/:id : Updates a room
- DELETE /api/v1/rooms/:id : Deletes a room
- GET /api/v1/rooms/:id : Gets a room by ID
If you're interested in contributing to this project, please feel free to fork the repository and make any changes you like. Once you're ready, submit a pull request to have your changes reviewed and merged into the main branch.
This project is licensed under the MIT License. See the LICENSE file for more information.