WanderLust is a full-stack travel listing platform built with Node.js, Express, MongoDB, EJS, and Passport authentication. It allows users to browse stays, create and manage listings, upload listing images, leave reviews, and interact through subscriber and contact flows.
This project is designed as a real-world CRUD web application with authentication, authorization, server-side rendering, validation, media uploads, session management, and third-party map/geocoding integration.
- Full-stack MVC architecture with clean separation of routes, controllers, models, middleware, and views
- User authentication with Passport Local and
passport-local-mongoose - Protected create, edit, and delete flows for listings
- Ownership-based authorization for listing updates and deletes
- Review creation and deletion with author-based permission checks
- Cloudinary image upload support using Multer
- MapTiler geocoding integration for listing coordinates
- Search, category filtering, and price filtering
- Session persistence with MongoDB-backed session store
- Flash messaging for user feedback
- Contact message management and subscriber management panels
- Node.js
- Express.js
- MongoDB
- Mongoose
- EJS
- EJS-Mate
- Bootstrap-based server-rendered UI
- Passport.js
- Passport Local
- Passport Local Mongoose
- Express Session
- Connect Mongo
- Joi
- Method Override
- Connect Flash
- Cookie Parser
- Cloudinary
- Multer
- Multer Storage Cloudinary
- MapTiler Geocoding API
- User registration
- User login
- User logout
- Persistent login sessions
- Redirect-to-original-page after authentication
- Create a new travel listing
- Upload cover images for listings
- Edit and delete owned listings
- View all listings
- View individual listing details
- Automatic geocoding for location and country
- Listing categories such as
Trending,Rooms,Cities,Mountains,Pools,Camping, and more
- Add reviews to listings
- Rating support
- Review author protection for delete actions
- Average rating calculation on listing detail pages
- Cascade cleanup of listing reviews when a listing is deleted
- Search by title
- Search by location
- Search by country
- Filter by category
- Filter by price threshold
- Contact form for user messages
- Admin-style message listing, editing, and deletion flow
- Newsletter or subscriber capture flow
- Subscriber edit and delete support
WANDERLUST/
βββ controllers/ # Request handlers and business logic
βββ middleware/ # Authentication and authorization middleware
βββ models/ # Mongoose schemas and models
βββ public/ # Static assets
βββ routes/ # Express routes
βββ uploads/ # Local upload-related workspace files
βββ utils/ # Utility helpers and custom error handling
βββ views/ # EJS templates
βββ app.js # Main application entry point
βββ cloudConfig.js # Cloudinary configuration
βββ schema.js # Joi schemas
βββ validation.js # Validation middleware
βββ package.json
This application follows the MVC pattern:
- Models define the MongoDB data structure.
- Routes define request endpoints.
- Controllers contain the main business logic.
- Middleware handles reusable guards such as authentication and authorization.
- Views render server-side HTML using EJS.
This structure keeps the app scalable and easier to maintain as features grow.
Create a .env file in the project root and configure the following values:
MONGO_URI=your_mongodb_connection_string
SECRET=your_session_secret
CLOUD_NAME=your_cloudinary_cloud_name
CLOUD_API_KEY=your_cloudinary_api_key
CLOUD_API_SECRET=your_cloudinary_api_secret
MAPTILER_KEY=your_maptiler_api_keygit clone https://github.com/dk5847001-stack/WanderLust.git
cd WanderLustnpm installAdd the .env file using the keys listed above.
npm startThe app runs on:
http://localhost:3000
If a PORT environment variable is provided by the hosting platform, the app will use that automatically.
GET /- Home pageGET /register- Register pagePOST /register- Create a user accountGET /login- Login pagePOST /login- Authenticate userPOST /logout- Logout user
GET /listings- List all listingsGET /listings/new- Render new listing formPOST /listings- Create listingGET /listings/:id- Listing detail pageGET /listings/:id/edit- Edit form for ownerPUT /listings/:id- Update listingDELETE /listings/:id- Delete listingGET /listings/api- JSON listing feed with filters
POST /listings/:id/reviews- Create reviewDELETE /listings/:id/reviews/:reviewId- Delete review
GET /message- Contact pagePOST /message- Submit messageGET /message/read- Read saved messagesGET /subscriber- View subscribersPOST /subscriber- Add subscriber
This project is ready to be deployed as a Render Web Service.
- Runtime:
Node - Build Command:
npm install - Start Command:
npm start
MONGO_URISECRETCLOUD_NAMECLOUD_API_KEYCLOUD_API_SECRETMAPTILER_KEY
- Use MongoDB Atlas for production instead of a local MongoDB URL.
- Do not commit your
.envfile. - Make sure Cloudinary credentials are valid before testing image uploads.
- The application expects the hosting platform to provide
PORT, which Render does automatically.
emailusername- password handling via Passport Local Mongoose
titledescriptionimagepricelocationcountrygeometrycategoryreviewsowner
- linked to listing
- linked to author
- rating and comment data
- name
- subject
- message
- Joi-based request validation for listings and reviews
- Authentication checks for protected routes
- Authorization checks for listing owners and review authors
- Session-backed login state
- Flash-based error and success communication
- Practical full-stack architecture
- Strong CRUD coverage
- Clean feature separation
- Useful third-party service integration
- Good foundation for scaling into a production-grade travel marketplace
- Add role-based admin authorization for message and subscriber management
- Add pagination for listings
- Add advanced filters like date availability and sorting
- Add image gallery support per listing
- Add wishlists or favorites
- Add booking workflow
- Add automated tests
- Add API documentation
- Add rate limiting and security headers
Developed by the WanderLust project owner.
If you want, this README can be further customized with:
- project screenshots
- live demo link
- author name and portfolio links
- badges for Node, Express, MongoDB, and Render
This project is currently shared without a custom license file. Add an MIT license if you plan to make it open source for wider reuse.