Skip to content

Doguhannilt/Hotel-book

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FULL STACK MERN - HOTEL BOOKS PROJECT

Description: The "LunaHotel" project is a full-stack web application built using the MERN stack, which stands for MongoDB, Express.js, React.js, and Node.js.

Purpose: The main goal of the "Hotel Books" project is to provide users with a user-friendly platform to browse, book, and manage hotel reservations. Whether planning a vacation or a business trip, users can easily find suitable accommodations and make secure bookings.

This project was developed as a demonstration of building a modern, feature-rich web application using the MERN stack. It showcases best practices in frontend and backend development, including user authentication and CRUD operations.

Feel free to explore the "Hotel Books" project and experience the seamless booking process it offers.



Image 1 Image 2 Image 3

Project Features

  • User account management, including features for signing in, and registering.
  • Automatic logout for logged-in users.
  • Validation processes for sign-in and registration forms.
  • Ability for users to search for hotels without logging in.
  • Booking functionality for users to make and view reservations.
  • Admin panel for adding, editing, and deleting hotels.

Security Measures

  • Encryption of user passwords using the bcrypt algorithm for secure storage.
  • Use of JWT (JSON Web Tokens) for session management and security.
  • Proper configuration of Cors (Cross-Origin Resource Sharing) policies.
  • Use of express-validator for user input and form validation.

Contributors

ENV FILE

// Back-End .env
MONGODB_CONNECTION = 
PORT = 
JWT_SECRET_KEY = 
FRONTEND_URL = 

#Cloudinary Variables
CLOUDINARY_CLOUD_NAME = 
CLOUDINARY_API_KEY = 
CLOUDINARY_API_SECRET = 

NODE_ENV =

// Front-End .env 
VITE_API_BASE_URL =

Backend Libraries - Required:

Libraries
  • bcryptjs: 2.4.3
  • cloudinary: 2.0.1
  • cookie: 0.5.0
  • cookie-parser: 1.4.6
  • cookie-signature: 1.0.6
  • cors: 2.8.5
  • dotenv: 16.4.1
  • express: 4.18.2
  • express-validator: 7.0.1
  • winston: 3.12.0

Frontend Libraries - Required:

Libraries
  • @chakra-ui/react: 2.8.2
  • @emotion/react: 11.11.3
  • @emotion/styled: 11.11.0
  • @reduxjs/toolkit: 2.2.1
  • axios: 1.6.7
  • framer-motion: 11.0.5
  • immer: 10.0.3
  • js-cookie: 3.0.5
  • react: 18.2.0
  • react-datepicker: 6.2.0
  • react-hook-form: 7.50.1
  • react-icons: 5.0.1
  • react-loading: 2.0.3
  • react-query: 3.39.3
  • react-redux: 9.1.0
  • react-router-dom: 6.21.3
  • react-toastify: 10.0.4
  • redux: 5.0.1
  • redux-thunk: 3.1.0
  • winston: 3.12.0

Project Structure

Backend Project Structure
backend/
│   ├── loggers/
│   │   ├── e_logger.log
│   │   ├── logger.log
│   ├── Schemas/
│   │   ├── auth-schema.png
│   │   ├── CreateHotel.drawio.html
│   │   ├── logout.png
│   │   ├── signup.html
├── src/
│   ├── middleware/
│   │   ├── auth.js
│   ├── models/
│   │   ├── hotel.js
│   │   └── model.js
│   ├── routes/
│   │   ├── auth.js
│   │   ├── hotel.js
│   │   └── logout.js
│   │   └── myhotel.js
│   │   └── users.js
│   │   └── view.js
│   ├── utils/
│   │   ├── errorlogger.js
│   │   ├── infologger.js
│   ├── index.js
│   ├── env
└── .env.example
Frontend Project Structure
frontend/
├── public/
└── src/
    ├── app/
    │   ├── store.jsx
    ├── components/
    │   ├── Header.js
    │   ├── Footer.js
    │   └── Hero.js
    ├── config/
    │   ├── hotel-options-congif.jsx
    ├── forms/ManagaHotelForm/
    │   ├── DetailsSection.jsx
    │   ├── FacilitiesSection.jsx
    │   └── GuestsSection.jsx
    │   └── ImagesSection.jsx
    │   └── ManageHotelForm.jsx
    │   └── TypeSection.jsx
    ├── Hooks/
    │   ├── Hooks.jsx
    ├── Images/
    │   ├── About Us/...
    ├── layouts/
    │   ├── Layout.jsx
    ├── pages/
    │   ├── AddHotel.jsx
    │   ├── ContactUs.jsx
    │   └── Details.jsx
    │   └── EditHotel.jsx
    │   └── Info_Prefer.jsx
    │   └── Info.jsx
    │   └── Loading.jsx
    │   └── Login.jsx
    │   └── MainInfo.jsx
    │   └── MainPage.jsx
    │   └── MyHotels.jsx
    │   └── Register.js
    │   └── SearchBar.jsx
    ├── redux/
    │   ├── features/counter/
    │   │   ├── isLogged.jsx
    │   │   ├── viewData.jsx
    │   ├── toast/
    │   │   ├── toast.js
    ├── App.jsx
    └── main.jsx
    └── App.css
    └── index.css
    └── api-validateToken.jsx
    └── .env

Usage Guide

Clone the repository:
git clone https://github.com/Doguhannilt/Hotel-books.git

Install required dependencies:
cd Hotel-books
npm install

3. Fill in the necessary environment variables in the `.env` files.

4. Run the development server for both backend and frontend:
npm run dev

5. Visit `http://localhost:5173` or `http://localhost:5174` in your browser to view the application.

Endpoint Schemas

Schema folder is a collection of algorithms that are used in the back-end of LunaHotel.com Full Stack MERN Project

FAQ

  1. I installed all the required libraries but still doesn't work.
    A: Sometimes additional libraries may be added to the project but not displayed in the Readme file or new versions of the libraries may create new errors that we are not aware of yet. If you have any time, you can check utils folder and solve the problem or you can send me an email: [email protected] about it.

  2. I want to help fix bugs, how?
    A: If you want to spend your valuable time to fix the project's problems, you can open an issue or send me an email about it.

Acknowledgements

I would like to extend my heartfelt gratitude to the following individuals whose invaluable tutorials significantly expedited the completion of this project. Without their guidance, the process would have taken at least three months to finalize.

  • Chris Blakely
  • Dave Gray
  • Hitesh Choudhary

  • and the valuable Turkish community of kamp.us