A Backend to an hotel booking application that allows travelers to create a profile, search for room, compare, and book accommodations for their trips. This application focuses on providing a seamless booking experience, detailed information about the hotels, and secure payment processing.
-
User: User can register, login, logout, update password, verify username, update profile and update password.
-
Bookings: User can request for a booking and check his booking Status.
-
Rooms: Get available room, search room by status such as suite type, price and maximum guest, check all available rooms and update rooms.
-
Profile: Get user profile, update password and delete user.
- JavaScript
- Node
- Express
- dotenv
- nodemon
- bcryptjs
- cors
- jsonwebtoken
- joi
- clone the repository
git clone [email protected]:olawuwo-abideen/booking.git
- navigate to the folder
cd booking.git
Open a terminal window session, or the equivalent on your machine, and enter the following command to install all the Node modules needed to run the app:
npm install
After doing an npm install
enter the following npm start
command:
npm start
Set up the environment variables:
Create the .env file and setup the MongoDB URL.
The server will start running on the specified port (default: 3000) and establish a connection to the MongoDB database.
This will start the app and set it up to listen for incoming connections on port 3000. Open up your browser of choice and go to the url
http://localhost:3000
to start using the app.
The following API endpoints are available:
-
BaseUrl https://localhost:3000/
-
POST /api/register
- Register a new user -
POST /api/login
- User login -
POST /api/logout
- User logout -
POST /api/request-password-reset-link
- User update password -
POST /api/email-verification-request
- Verify User email -
PATCH /api/email-verification
- User update Profile -
PATCH /api/reset-password
- User update password
GET /api/user-bookings
- Get User bookingsPOST /api/bookings
- Request a bookings
GET /api/allrooms
- Get all available RoomsGET /api/rooms/:id
-Get a room by parameter RoomsGET /api//searchrooms/:value
- Search rooms by ParametersGET /api/rooms
- Get a roomsPOST /api/room
- Add a RoomPUT /api/rooms/:id
- Update a Room
GET /api/profile
- Get a user profilePATCH /api/profile
- Update a user profilePATCH /api/password
- Update user passwordDELETE /api/profile
- Delete a user
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
👤 Olawuwo Abideen
- GitHub: @Olawuwo Abideen
- Twitter: @Olawuwo Abideen
- LinkedIn: @Olawuwo Abideen