Coder Social home page Coder Social logo

hotelhub's Introduction

HotelHub

HotelHub is a web application designed for users to explore, and review hotels. It leverages EJS, MongoDB, Bootstrap CSS, Express, and Node.js, with Passport.js handling user authentication. This project showcases full CRUD functionality and allows users to manage hotel data dynamically.

Table of Contents

Features

  • User authentication with Passport.js.
  • Logged-in users can add, edit, and delete hotels.
  • Users can add and delete reviews for hotels.
  • Full CRUD functionality for hotel data.
  • Flash messages for user feedback.
  • Session management using Express Session.
  • Dynamic templating with EJS and EJS Mate.
  • Modular route handling with Express Router.

Technologies Used

  • EJS: Embedded JavaScript templates for dynamic HTML rendering.
  • MongoDB: NoSQL database for storing user, review, and hotel data.
  • Bootstrap CSS: For responsive and modern design.
  • Express: Node.js framework for building the server and handling routes.
  • Node.js: JavaScript runtime for the server-side application.
  • Passport.js: Authentication middleware for Node.js.
  • Express Session: Middleware for managing user sessions.
  • Flash: Middleware for flash messages.

Project Structure

HotelHub/
│
├── app.js                # Main file for routes and application setup
├── index.js              # Script for changing and generating sample data
├── models/
│   ├── user.js           # User schema and model
│   ├── review.js         # Review schema and model
│   └── hotelground.js    # Hotel schema and model
├── routes/
│   └── hotels.js         # Hotel-related routes
│   ├── reviews.js        # Review-related routes
│   ├── users.js          # User-related routes
├── views/
│   ├── partials/         # EJS partials
│   ├── layouts/          # Hotel-related EJS templates
│   └── ...               # Other EJS templates
├── public/               # Stylesheets and validator
│
├── package.json          # Project dependencies
└── README.md             # Project documentation

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/HotelHub.git
    cd HotelHub

Instal dependencies

  1. Install dependencies:

    npm install
  2. Set up environment variables: Create a .env file in the root directory and add the following:

    MONGO_URI=your_mongodb_uri
    SESSION_SECRET=your_session_secret
    SAMPLE_USER_ID=sample_user_id
  3. Generate sample data (if needed):

    node index.js

Usage

  1. Start the application:
    node app.js
  2. Open your browser and navigate to http://localhost:3000.

Environment Variables

  • MONGO_URI: MongoDB connection string.
  • SESSION_SECRET: Secret key for session encryption.
  • SAMPLE_USER_ID: ID for the sample data's author in the user schema.

License

This project is licensed under the MIT License. See the LICENSE file for details.

hotelhub's People

Contributors

sakshii00 avatar

Watchers

 avatar

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.