Giter Club home page Giter Club logo

samrat-p / mern-hotel-booking-app- Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 7.18 MB

The MERN Hotel Booking App is a full-stack web application for hotel booking, featuring user authentication, hotel management, booking management, and secure payments via Stripe. Built with MongoDB, Express.js, React, and Node.js, it offers a robust and user-friendly solution for managing hotel reservations.

TypeScript 97.93% JavaScript 1.71% HTML 0.29% CSS 0.07%

mern-hotel-booking-app-'s Introduction

MERN Hotel Booking App

Overview

This project is a full-stack web application for hotel booking, built using the MERN stack (MongoDB, Express.js, React.js, and Node.js). It includes features for user authentication, hotel management, booking management, and more.

Features

  • User Authentication: Registration, login, and JWT-based authentication.
  • Hotel Management: Create, read, update, and delete hotel details.
  • Booking Management: Users can book hotels, and admins can manage bookings.
  • Search and Filter: Search for hotels based on various criteria.
  • Payment Integration: Secure payments using Stripe.

Folder Structure

  • backend: Contains the server-side code, including routes, controllers, models, and configuration files.
  • frontend: Contains the client-side code, built with React.
  • e2e-tests: Contains end-to-end tests for the application.

Technologies Used

  • Frontend: React, Redux, Bootstrap
  • Backend: Node.js, Express.js, MongoDB, Mongoose
  • Authentication: JWT
  • Payments: Stripe
  • Testing: Jest, Cypress

Installation

  1. Clone the repository:
    git clone https://github.com/samrat-p/MERN-hotel-Booking-App-.git
  2. Install dependencies for both frontend and backend:
    cd backend
    npm install
    cd ../frontend
    npm install
  3. Set up environment variables:
  • Create a .env file in the backend directory and add the necessary configurations (e.g., MongoDB URI, JWT secret).

Run the Application

  1. In the backend directory:
    npm start
  2. In the frontend directory:
    npm start

Usage

Contributing

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Commit your changes (git commit -am 'Add some feature').
  4. Push to the branch (git push origin feature/YourFeature).
  5. Open a pull request.

License

This project is licensed under the MIT License.

Contact

For any inquiries, you can contact the project maintainer via the GitHub repository.

mern-hotel-booking-app-'s People

Contributors

samrat-p avatar

Watchers

 avatar

mern-hotel-booking-app-'s Issues

CSS is not applying on the Header.tsx Issue - A1

Tailwind css classes are not applying on frontend/src/components/Header.tsx
Trying to add tailwind base,components and utilities inside frontend/src/index.css file but after rewriting the code it does not showup on the header.tsx file
console gives an error of " No utility classes were detected in your source files. If this is unexpected, double-check the content option in your Tailwind CSS configuration"
tried with @tailwind base; method and also with @import 'tailwindcss/base' method
none of them seems to work....

Maybe missing something on tailwind.config.js or is it something to do with postcss or autoprefixer???

will update if something get fixed or not

hotel booking button does not do anything!!!

after filing the stripe form, clicking onto the "Book now", does not do anything, it creates the post requests but the booking payload does not happen, on the other side into the stripe logs the payable amount service is created but failed due to no interaction.
i checked myself there is no error with my backend, every other post request does happen, payment-intent, user details but the booking payload does not happens.
i will review the codes myself and fix the error as soon as possible

Selecting multiple hotel types causes fatal crash to backend server

If a user is selecting more than 1 hotel types when sorting hotels, it causes fatal crash to backend server.
Its something to do with mongoDb, cuz the error msg is related to mongoDb
{ stringValue: "[ 'Hiking Resort', 'Cabin' ]",
messageFormat: undefined,
kind: 'string',
value: [ 'Hiking Resort', 'Cabin' ],
path: 'type',
reason: null,
valueType: 'Array',
model: Model { Hotel }
}
Error: Cannot set headers after they are sent to the client

{
code: 'ERR_HTTP_HEADERS_SENT'
}

JWT token Invalid - 401 status

const verifyToken = (req: Request, res: Response, next: NextFunction) => {
const token = req.cookies["auth_token"];
if (!token) {
return res.status(401).json({ message: "unauthorized-c" });
}
try {
const decoded = jwt.verify(token, process.env.JWT_SECRET_KEY as string);
req.userId = (decoded as JwtPayload).userId;
next();
} catch (error) {
return res.status(401).json({ message: "Unauthorized" });
}

this code does not verify the auth_token from backend api and gives 401 status, i have changed the key of jwt_secert_key and expands the expiration upto 360 days , i have tried everything, nothing seems to work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.