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.