Skip to content

Mahak0747/WanderHub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

38 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌍 WanderHub - Full Stack Travel Stay Booking Platform

WanderHub Banner

πŸš€ Overview

WanderHub is a full-stack travel accommodation platform inspired by Airbnb that enables users to discover, create, and manage travel stay listings.

The application provides a complete host and traveler experience with secure authentication, property management, image hosting, location-based discovery, and user reviews.

Built with a scalable MVC architecture, the project demonstrates backend API design, database modeling, authentication workflows, cloud integration, and production-level error handling.


✨ Features

πŸ‘€ User Management & Authentication

  • Secure user registration and login
  • Session-based authentication using Passport.js
  • Protected routes with authorization middleware
  • User-specific listing and review management
  • Logout functionality

🏠 Property Listing Management

Users can:

  • Create new property listings
  • Upload property images
  • Edit existing listings
  • Delete their own listings
  • View detailed property information
  • Browse available stays

Implemented complete CRUD operations following RESTful API principles.


πŸ“· Cloud Image Management

  • Image uploads using Multer
  • Image storage and optimization using Cloudinary
  • Dynamic image rendering for listings

πŸ—ΊοΈ Location-Based Features

  • Integrated Mapbox API
  • Display property locations on interactive maps
  • Geographical visualization of listings

⭐ Reviews & Ratings

Users can:

  • Add reviews to listings
  • Delete their own reviews
  • View community feedback

πŸ›‘οΈ Validation & Error Handling

  • Server-side validation using Joi
  • Custom Express error handling middleware
  • Async error handling wrapper
  • User-friendly flash messages

πŸ—οΈ System Architecture

The application follows the MVC (Model-View-Controller) architecture.

User
 |
 | HTTP Requests
 |
 v
Routes Layer
 |
 v
Controllers Layer
 |
 v
Models Layer
 |
 v
MongoDB Database

Architecture Flow:

  1. User interacts with the frontend (EJS + Bootstrap)
  2. Request reaches Express routes
  3. Controllers process business logic
  4. Mongoose models communicate with MongoDB
  5. Response is returned to the client

🧰 Tech Stack

Frontend

Technology Purpose
EJS Server-side templating
Bootstrap 5 Responsive UI
CSS Custom styling

Backend

Technology Purpose
Node.js Runtime environment
Express.js Backend framework
MongoDB Database
Mongoose ODM
Passport.js Authentication
Joi Data validation
Multer File handling
Cloudinary Image storage
Mapbox SDK Maps integration

πŸ“‚ Project Structure

WanderHub/

β”‚
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ listings.js        # Property schema
β”‚   β”œβ”€β”€ reviews.js         # Review schema
β”‚   └── users.js           # User schema
β”‚
β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ listings.js        # Listing routes
β”‚   β”œβ”€β”€ reviews.js         # Review routes
β”‚   └── users.js           # Authentication routes
β”‚
β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ listings.js        # Listing business logic
β”‚   β”œβ”€β”€ reviews.js         # Review controllers
β”‚   └── users.js           # User controllers
β”‚
β”œβ”€β”€ views/
β”‚   β”œβ”€β”€ layouts/
β”‚   β”œβ”€β”€ listings/
β”‚   β”œβ”€β”€ users/
β”‚   β”œβ”€β”€ includes/
β”‚   └── error.ejs
β”‚
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ css/
β”‚   └── javascript/
β”‚
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ wrapAsync.js       # Async error handling
β”‚   └── ExpressError.js    # Custom errors
β”‚
β”œβ”€β”€ middleware.js          # Authentication middleware
β”œβ”€β”€ schema.js              # Joi validation schemas
β”œβ”€β”€ cloudConfig.js         # Cloudinary configuration
β”œβ”€β”€ app.js                 # Application entry point
└── package.json

πŸ—„οΈ Database Design

User Collection

{
 username,
 email,
 password,
 listings[]
}

Listing Collection

{
 title,
 description,
 price,
 location,
 country,
 image,
 owner,
 reviews[]
}

Review Collection

{
 comment,
 rating,
 author,
 listing
}

πŸ”Œ API Endpoints

Listings

Method Endpoint Description
GET /listings Get all listings
POST /listings Create listing
GET /listing/:id Get listing details
PUT /listing/:id Update listing
DELETE /listing/:id Delete listing

Reviews

Method Endpoint Description
POST /listing/:id/reviews Add review
DELETE /listing/:id/reviews/:reviewId Delete review

Authentication

Method Endpoint Description
GET /signup Signup page
POST /signup Register user
GET /login Login page
POST /login Authenticate user
GET /logout Logout user

πŸ” Authentication Flow

User Signup
     |
     v
Password Hashing
     |
     v
MongoDB Storage
     |
     v
Login Request
     |
     v
Passport Authentication
     |
     v
Session Creation
     |
     v
Protected Routes Access

βš™οΈ Installation & Setup

Clone Repository

git clone https://github.com/Mahak0747/WanderHub.git

Install Dependencies

npm install

Environment Variables

Create a .env file:

ATLASDB_URL=your_mongodb_url

CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_KEY=your_cloudinary_key
CLOUDINARY_SECRET=your_cloudinary_secret

MAP_TOKEN=your_mapbox_token

SECRET=your_session_secret

Run Application

npm start

Application runs on:

http://localhost:8080

πŸ§ͺ Engineering Highlights

βœ… RESTful API design
βœ… MVC backend architecture
βœ… Secure authentication system
βœ… Database schema modeling
βœ… Cloud-based image storage
βœ… Third-party API integration
βœ… Middleware-based request handling
βœ… Server-side validation
βœ… Error handling strategies


πŸš€ Future Improvements

  • Payment gateway integration
  • Booking calendar system
  • Real-time chat between hosts and travelers
  • Recommendation system
  • Admin dashboard
  • Advanced search and filtering
  • Deployment using AWS/Docker

πŸ“Έ Screenshots


πŸ‘¨β€πŸ’» Author

Mahak Goswami

Full Stack Developer


πŸ“œ License

This project is licensed under the ISC License.

About

WunderHub is a full-stack Airbnb-inspired rental platform built with MongoDB, featuring secure authentication, location-based verification, authorization, and protected property management for users.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors