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.
- 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.
-
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.
- 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.
- 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
- Clone the repository:
git clone https://github.com/thepriyansh01/HotelBook.com.git- Install dependencies for the server-side:
cd server
npm install- Install dependencies for the client-side:
cd client
npm install- Install dependencies for the admin-side:
cd admin
npm install- 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- Start the server:
cd server
nodemon- Start the client:
cd client
npm start- Start the admin:
cd admin
npm start- Access the application: Open your browser and visit http://localhost:3000 & http://localhost:3001 to access the Hotel Booking System.
This project is licensed under the MIT License.








