Skip to content

Prototype of Hotel Booking website. Implemented authentication and Booking logic. Also created admin page for detailed information using various DB queries and CRUD operations.

License

Notifications You must be signed in to change notification settings

bepriyansh/HotelBook.com

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MERN Project - Hotel Booking System

This is a MERN (MongoDB, Express, React, Node.js) project for a Hotel Booking System. It consists of a server, client-side, and admin-side components. Users can create accounts, log in using JWT authentication, and search for hotels and book them within a range of dates. The backend utilizes bcrypt for password encryption and CORS for handling cross-origin requests, while the frontend uses Axios for making API requests.

Features

Client Side

  • User Registration: Users can create an account with their details.
  • User Login: Users can log in using their credentials.
  • Authentication: JWT tokens are used for user authentication.
  • Password Encryption: User passwords are encrypted using bcrypt.
  • Search Hotels: Users can search for hotels based on the desired city and date range.
  • City Suggestions: As users type in the search bar, they receive suggestions for cities.

Screenshot 2023-10-31 222654 Screenshot 2023-10-31 222708 Screenshot 2023-10-31 222930 Screenshot 2023-10-31 222939 Screenshot 2023-10-31 222945 Screenshot 2023-10-31 222956 Screenshot 2023-10-31 223025 Screenshot 2023-10-31 223037

Admin Side

  • Hotel Management: Admin can create, update, and delete hotel information.

  • Room Management: Admin can add, upadate and delete rooms for each hotel.

  • Admin Profiles: Admin can create additional admin profiles.

  • User Profile Deletion: Admin can delete user profiles.

    Screenshot 2023-10-31 223843

State Management

  • Context API: Context API is used for state management in both the admin and client sides.
  • useReducer: useReducer hook is utilized for managing login and search details state.

Tech Stack

  • Frontend: React.js
  • Backend: Node.js, Express.js
  • Database: MongoDB
  • State Management: Context API, useReducer
  • Authentication: JWT (JSON Web Tokens)
  • Password Encryption: bcrypt
  • Cross-Origin Requests: CORS
  • HTTP Requests: Axios
  • Date Range Selection: React Date Range

Setup Instructions

  1. Clone the repository:
git clone https://github.com/thepriyansh01/HotelBook.com.git
  1. Install dependencies for the server-side:
cd server
npm install
  1. Install dependencies for the client-side:
cd client
npm install
  1. Install dependencies for the admin-side:
cd admin
npm install
  1. Set up the environment variables:

Create a .env file in the server directory and add the following variables:

MONGO_URI=your-mongodb-uri
JWT_SECRET_KEY=your-jwt-secret
  1. Start the server:
cd server
nodemon
  1. Start the client:
cd client
npm start
  1. Start the admin:
cd admin
npm start
  1. Access the application: Open your browser and visit http://localhost:3000 & http://localhost:3001 to access the Hotel Booking System.

License

This project is licensed under the MIT License.

About

Prototype of Hotel Booking website. Implemented authentication and Booking logic. Also created admin page for detailed information using various DB queries and CRUD operations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published