Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A full-stack web application designed to facilitate hotel management and booking. It allows users to list properties, view details, leave reviews, and manage their bookings. The application is built using the MERN stack (MongoDB, Express.js, Node.js) and follows the MVC Architecture.

Notifications You must be signed in to change notification settings

CodeLander07/Holiday-Homes

Repository files navigation

TripEasy - Hotel Management App

TripEasy is a full-stack web application designed to facilitate hotel management and booking. It allows users to list properties, view details, leave reviews, and manage their bookings. The application is built using the MEN stack (MongoDB, Express.js, Node.js) and follows the MVC (Model-View-Controller) architecture.

πŸš€ Features

  • User Authentication & Authorization:
    • Secure Sign Up and Login functionality using Passport.js.
    • Authorization checks to ensure only owners can edit/delete their listings.
  • CRUD Operations for Listings:
    • Users can Create, Read, Update, and Delete hotel listings.
    • Upload images for listings (stored via Cloudinary).
  • Review System:
    • Users can leave ratings and comments on listings.
    • Reviews can be deleted by their authors.
  • Responsive Design:
    • Built with Bootstrap for a mobile-friendly user interface.
  • Data Validation:
    • Server-side validation using Joi to ensure data integrity.
  • Session Management:
    • Persistent sessions using MongoDB (connect-mongo).
  • Flash Messages:
    • Interactive feedback messages (success/error) for user actions.

πŸ› οΈ Tech Stack & Dependencies

The project utilizes the following technologies and libraries:

Backend

  • Node.js: JavaScript runtime environment.
  • Express.js: Web framework for Node.js.
  • Mongoose: ODM for MongoDB.
  • Passport.js: Authentication middleware for Node.js.
  • Joi: Data validation library.

Frontend

  • EJS (Embedded JavaScript): Templating engine.
  • EJS-Mate: Layout support for EJS.
  • Bootstrap: CSS framework for styling.

Utilities & Middleware

  • Cloudinary & Multer: For handling image uploads and storage.
  • Connect-Flash: For displaying flash messages.
  • Express-Session: For managing user sessions.
  • Method-Override: To support PUT and DELETE requests in HTML forms.
  • Dotenv: For environment variable management.

πŸ“‚ Folder Structure

TripEasy/
β”œβ”€β”€ controllers/ # Logic for handling requests (MVC Controller)
β”œβ”€β”€ init/ # Database initialization scripts
β”œβ”€β”€ models/ # Mongoose schemas and models (MVC Model)
β”œβ”€β”€ public/ # Static files (CSS, JS, Images)
β”œβ”€β”€ Routes/ # Express routes definitions
β”œβ”€β”€ utils/ # Utility functions (Error handling, wrappers)
β”œβ”€β”€ views/ # EJS templates (MVC View)
β”œβ”€β”€ app.js # Main application entry point
β”œβ”€β”€ cloudConfig.js # Cloudinary configuration
β”œβ”€β”€ middleware.js # Custom middleware (Auth, Validation)
β”œβ”€β”€ schema.js # Joi validation schemas
β”œβ”€β”€ .env # Environment variables (not committed)
└── package.json # Project dependencies and scripts

βš™οΈ Installation & Setup

  1. Clone the repository:

    git clone https://github.com/CodeLander07/Holiday-Homes.git
    cd Holiday-Homes
  2. Install dependencies:

    npm install
  3. Set up Environment Variables: Create a .env file in the root directory and add the following credentials:

    CLOUD_NAME=your_cloudinary_cloud_name
    CLOUD_API_KEY=your_cloudinary_api_key
    CLOUD_API_SECRET=your_cloudinary_api_secret
    MONGOURL=your_mongodb_connection_string
    SESSION_SECRET=your_session_secret
  4. Initialize the Database (Optional): If you want to seed the database with initial data:

    node init/index.js
  5. Run the Application:

    node app.js
    # OR for development with nodemon
    npm run dev
  6. Access the App: Open your browser and go to http://localhost:3000.

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

This project is licensed under the ISC License.

About

A full-stack web application designed to facilitate hotel management and booking. It allows users to list properties, view details, leave reviews, and manage their bookings. The application is built using the MERN stack (MongoDB, Express.js, Node.js) and follows the MVC Architecture.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /