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.
- Secure user registration and login
- Session-based authentication using Passport.js
- Protected routes with authorization middleware
- User-specific listing and review management
- Logout functionality
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.
- Image uploads using Multer
- Image storage and optimization using Cloudinary
- Dynamic image rendering for listings
- Integrated Mapbox API
- Display property locations on interactive maps
- Geographical visualization of listings
Users can:
- Add reviews to listings
- Delete their own reviews
- View community feedback
- Server-side validation using Joi
- Custom Express error handling middleware
- Async error handling wrapper
- User-friendly flash messages
The application follows the MVC (Model-View-Controller) architecture.
User
|
| HTTP Requests
|
v
Routes Layer
|
v
Controllers Layer
|
v
Models Layer
|
v
MongoDB Database
- User interacts with the frontend (EJS + Bootstrap)
- Request reaches Express routes
- Controllers process business logic
- Mongoose models communicate with MongoDB
- Response is returned to the client
| Technology | Purpose |
|---|---|
| EJS | Server-side templating |
| Bootstrap 5 | Responsive UI |
| CSS | Custom styling |
| 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 |
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
{
username,
email,
password,
listings[]
}{
title,
description,
price,
location,
country,
image,
owner,
reviews[]
}{
comment,
rating,
author,
listing
}| 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 |
| Method | Endpoint | Description |
|---|---|---|
| POST | /listing/:id/reviews | Add review |
| DELETE | /listing/:id/reviews/:reviewId | Delete review |
| Method | Endpoint | Description |
|---|---|---|
| GET | /signup | Signup page |
| POST | /signup | Register user |
| GET | /login | Login page |
| POST | /login | Authenticate user |
| GET | /logout | Logout user |
User Signup
|
v
Password Hashing
|
v
MongoDB Storage
|
v
Login Request
|
v
Passport Authentication
|
v
Session Creation
|
v
Protected Routes Access
git clone https://github.com/Mahak0747/WanderHub.gitnpm installCreate 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
npm startApplication runs on:
http://localhost:8080
β
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
- 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
Mahak Goswami
Full Stack Developer
This project is licensed under the ISC License.