Skip to content

JunaidUsmani2468/WanderLust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

98 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WanderLust is a hotel booking web application that allows users to easily browse through various listings and reserve accommodations. It provides a clean interface for travelers to discover unique places to stay and allows hosts to list their properties for rent.

This is my first major fullstack project where I handled both the frontend and backend development. It is built as a functional clone of Airbnb and is designed with a responsive layout to ensure a seamless experience on both mobile phones and desktop computers.

⭐ If this project helped or inspired you, consider giving it a star β€” it really motivates me to keep building!


πŸš€ Live Demo

Click here to explore unique stays and start your journey! πŸ‘‰ [ 🌏 WanderLust πŸ—ΊοΈ ]

πŸ’‘ Pro Tip: Login is hassle-free! You don't need a real email IDβ€”just create a dummy account to test features like adding reviews. 😜

😎 Try this: Visit the app both as a Guest and while Logged In. The interface is smart enough to detect your status and completely adapts the User Menu and features accordingly!


🎬 Video Walkthrough

Want a quick tour instead of clicking every page? πŸ˜„
This video gives a full UI walkthrough of WanderLust β€” covering all screens, user flows, and interactions from start to finish.

Watch it here! πŸ‘‰ [ 🌐 Walkthrough πŸšΆβ€β™‚οΈ ]

✨ Built to showcase the experience, not the code β€” perfect for getting the feel of the product in minutes.


πŸ“Έ Screenshots

Immersive Home Page
Home Page
Custom designed landing page with dynamic animations
Curated Journeys Seamless Onboarding Host Opportunities
Traveler View Split UI View Host View
Immersive dark-mode interface for travelers Clean split-screen UI to guide user choice Dedicated flow for earning on your terms

🌟 Beyond the Tutorial

While this project was initially inspired by a tutorial, I have significantly expanded its capabilities, design, and architecture to build a more robust production-ready application. Here are the major custom implementations:

Feature Description
πŸ—ΊοΈ Map Integration Replaced Mapbox with Leaflet.js & Nominatim (OpenStreetMap) to keep the project 100% free and open-source.
🧬 Advanced Init & Seeding Automated users, listings, images, and reviews with ownership safety and one-command database regeneration.
🎨 Landing Page Designed a completely unique Home Page with modern aesthetics and dynamic animations.
🎴 Split Card Created a diagonal-split-Card using CSS clip-path and custom "Double-Tap" logic for mobile interaction.
πŸ” Smart Search Built a robust search logic that intelligently parses City and Country names from user queries.
🏷️ Filters Implemented category-based filtering (e.g., Farms, Pools, Arctic) for easy discovery.
πŸ‘₯ User Menu A smart, conditional dropdown menu that changes based on authentication state (Guest vs. User).
πŸ§‘β€πŸ’» Animated Logo Highly styled, custom logo using SVG icons with CSS animations to create a dynamic and engaging visual identity.
⭐ Rating System Pure JS & CSS rating logic. No external libraries used for maximum performance.
βš–οΈ Legal Pages Added professional Privacy & Terms pages ("Junaid Advocate" edition πŸ˜‰).

πŸ—ΊοΈ Why Leaflet & Nominatim?

  • The Challenge: The original tutorial relied on Mapbox, which now requires credit card details for API access.
  • My Solution: I completely re-engineered the geolocation system using Leaflet.js for rendering and OpenStreetMap (Nominatim API) for geocoding. This ensures the project remains 100% free and open-source without sacrificing interactive map functionality.

πŸ€– AI-Powered Workflow

I believe in leveraging modern tools to write cleaner, faster, and more robust code. This project was built using an AI-Assisted Development workflow, treating AI not as a code generator, but as a pair programmer.

πŸ› οΈ Tool πŸ’‘ How I Used It
ChatGPT Concept Generation: Used for brainstorming architecture (e.g., "How to handle cold-starts on Render?") and generating dummy data.
Gemini Debugging Partner: Used to analyze stack traces. I learned that pasting a raw error isn't enough; I have to provide context to get a fix.
GitHub Copilot Autofill & Refactoring: Used for boilerplate code, but applied strict manual review to ensure security and logic accuracy.

πŸš€ Key Lessons from AI Collaboration

  • 🚫 "Trust but Verify": I learned when to deny AI code. AI often suggests deprecated packages or "hallucinated" variables. I manually verified every suggestion against documentation.
  • πŸ—£οΈ Prompt Engineering (Bad Input === Bad Output): I realized AI is only as smart as my instructions. Learning to write specific, context-aware prompts saved hours of debugging.
  • 🧱 Bridging the Knowledge Gap: AI helped me implement professional features I had never touched before (like Cron Jobs and Leaflet Maps) by explaining the logic, not just giving the code.

πŸ› οΈ Tech Stack

Category Technologies
🎨 Frontend HTML5 CSS3 JavaScript Bootstrap EJS
βš™οΈ Backend Node.js Express.js Passport.js Joi
πŸ’½ Database MongoDB Mongoose Cloudinary
πŸ—ΊοΈ Maps & Tools Leaflet OpenStreetMap Git VS Code

πŸš€ Key Features

Beyond the beautiful UI, WanderLust is built on a robust full-stack architecture. Here is a breakdown of the complex engineering challenges powering the application.

Category Feature Technical Implementation
🧠 Core Logic Full MVC Architecture Built with a scalable Model-View-Controller pattern to keep code clean and modular.
πŸ” Security Authentication & AuthZ Secure login using Passport.js (Salt/Hash) πŸ›‘οΈ + Middleware for strict route protection.
πŸ§ͺ Data Automated DB Seeding One-command database regeneration with realistic demo data and ownership-safe review logic.
πŸ—ΊοΈ UX/UI Interactive Maps Integrated Leaflet APIs for dynamic location pinning and geocoding πŸ“.
πŸ“± Mobile Touch-Optimized UI Custom "Double-Tap" logic πŸ‘† to handle complex animations smoothly on touch devices.
☁️ Data Cloud Image Storage Optimized image uploading and storage handling using Cloudinary πŸ“Έ.
🚧 Safety Server-Side Validation robust data validation with Joi to prevent injection attacks and ensure data integrity.
πŸ’¬ Feedback Flash Messages Real-time success/error notifications using Express-Flash for better user guidance ✨.

πŸ“‚ Project Structure

WanderLust follows a strict MVC (Model-View-Controller) architecture to ensure scalability and code maintainability.

WanderLust/
β”‚
β”œβ”€β”€ πŸ“‚ controllers/        πŸ‘‰ (Logic handling)
β”‚   β”œβ”€β”€ πŸ“œ listings.js
β”‚   β”œβ”€β”€ πŸ“œ reviews.js
β”‚   └── πŸ“œ users.js
β”‚
β”œβ”€β”€ πŸ“‚ init/               πŸ‘‰ (Database initialization & regeneration)
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ advanceData/    πŸ‘‰ Pure seed data (NO logic)
β”‚   β”‚   β”œβ”€β”€ πŸ“œ listings.js
β”‚   β”‚   β”œβ”€β”€ πŸ“œ reviews.js
β”‚   β”‚   └── πŸ“œ users.js
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“œ seedUsers.js                  πŸ‘‰ (Bulk user creation)
β”‚   β”œβ”€β”€ πŸ“œ seedListingsAndReviews.js     πŸ‘‰ (Listings + reviews with ownership rules)
β”‚   └── πŸ“œ init.js                       πŸ‘‰ (One-command DB reset pipeline)
β”‚
β”œβ”€β”€ πŸ“‚ models/             πŸ‘‰ (Mongoose Schemas)
β”‚   β”œβ”€β”€ πŸ’½ listing.js
β”‚   β”œβ”€β”€ πŸ’½ review.js
β”‚   └── πŸ’½ user.js
β”‚
β”œβ”€β”€ πŸ“‚ node_modules/       βš™οΈ (Dependencies - Git Ignored)
β”‚
β”œβ”€β”€ πŸ“‚ public/             πŸ‘‰ (Static Assets)
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ assets/         πŸ“Έ (Images & Icons)
β”‚   β”‚   β”œβ”€β”€ πŸ–ΌοΈ card-1.avif ... card-5.avif
β”‚   β”‚   β”œβ”€β”€ πŸ–ΌοΈ compass.svg
β”‚   β”‚   β”œβ”€β”€ πŸ–ΌοΈ hero.avif
β”‚   β”‚   β”œβ”€β”€ πŸ–ΌοΈ travel.avif
β”‚   β”‚   β”œβ”€β”€ πŸ–ΌοΈ home-page.png
β”‚   β”‚   └── πŸ–ΌοΈ mobile-view-1.jpg ... mobile-view-3.jpg
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ css/            🎨 (Modular Styling)
β”‚   β”‚   β”œβ”€β”€ 🎨 home.css
β”‚   β”‚   β”œβ”€β”€ 🎨 index.css
β”‚   β”‚   β”œβ”€β”€ 🎨 show.css
β”‚   β”‚   └── 🎨 style.css
β”‚   β”‚
β”‚   └── πŸ“‚ js/             ✨ (Client-Side Logic)
β”‚       β”œβ”€β”€ ✨ home.js
β”‚       β”œβ”€β”€ ✨ index.js
β”‚       β”œβ”€β”€ ✨ script.js
β”‚       └── ✨ show.js
β”‚
β”œβ”€β”€ πŸ“‚ routes/             πŸ‘‰ (Express Routers)
β”‚   β”œβ”€β”€ 🚦 index.js
β”‚   β”œβ”€β”€ 🚦 listing.js
β”‚   β”œβ”€β”€ 🚦 review.js
β”‚   └── 🚦 user.js
β”‚
β”œβ”€β”€ πŸ“‚ utils/              πŸ‘‰ (Helpers)
β”‚   β”œβ”€β”€ πŸ› οΈ category.js
β”‚   β”œβ”€β”€ πŸ› οΈ ExpressError.js
β”‚   └── πŸ› οΈ geoData.js
β”‚
β”œβ”€β”€ πŸ“‚ views/              πŸ‘‰ (EJS Templates)
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ includes/       🧩 (Partials)
β”‚   β”‚   β”œβ”€β”€ πŸ“œ compass_icon.ejs
β”‚   β”‚   β”œβ”€β”€ πŸ“œ flash.ejs
β”‚   β”‚   β”œβ”€β”€ πŸ“œ footer.ejs
β”‚   β”‚   β”œβ”€β”€ πŸ“œ map_pin_icon.ejs
β”‚   β”‚   └── πŸ“œ navbar.ejs
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ layouts/        πŸ—οΈ (Base Layout)
β”‚   β”‚   └── πŸ“œ boilerplate.ejs
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ listings/       🏠 (Property Pages)
β”‚   β”‚   β”œβ”€β”€ πŸ“œ edit.ejs
β”‚   β”‚   β”œβ”€β”€ πŸ“œ error.ejs
β”‚   β”‚   β”œβ”€β”€ πŸ“œ index.ejs
β”‚   β”‚   β”œβ”€β”€ πŸ“œ new.ejs
β”‚   β”‚   └── πŸ“œ show.ejs
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ pages/          πŸ“„ (Custom Static Pages)
β”‚   β”‚   β”œβ”€β”€ πŸ“œ home.ejs
β”‚   β”‚   β”œβ”€β”€ πŸ“œ privacy.ejs
β”‚   β”‚   └── πŸ“œ terms.ejs
β”‚   β”‚
β”‚   └── πŸ“‚ users/          πŸ‘€ (Auth Forms)
β”‚       β”œβ”€β”€ πŸ“œ login.ejs
β”‚       └── πŸ“œ signup.ejs
β”‚
β”œβ”€β”€ βš™οΈ .env                πŸ”’ (Local Config - Git Ignored)
β”œβ”€β”€ βš™οΈ .gitignore
β”œβ”€β”€ πŸš€ app.js              (Entry Point)
β”œβ”€β”€ ☁️ cloudConfig.js      (Cloudinary Setup)
β”œβ”€β”€ βš–οΈ LICENSE             (MIT License)
β”œβ”€β”€ πŸ”’ middleware.js       (Auth Guards)
β”œβ”€β”€ πŸ“¦ package-lock.json   (Dependency Tree)
β”œβ”€β”€ πŸ“¦ package.json
β”œβ”€β”€ πŸ“– README.md
└── πŸ›‘οΈ schema.js           (Joi Validation)

πŸ”„ Application Workflow

Seamless logic meets complex architecture. This flowchart visualizes the complete end-to-end data flow, from the custom split-landing interaction to secure cloud storage and database operations.

graph TD
    A[Start: User Visits App 🌍] --> B[🎨 Split-Landing Hero Page]
    
    %% Global Feature (Added quotes below to fix the error)
    B -- "Always Available" --> Z["πŸ‘€ Smart User Menu (Guest/User)"]
    
    B --> C{Choose Path}
    
    %% Traveler Flow
    C -- "Traveler (Explore)" --> D[Explore Listings with Leaflet Map πŸ—ΊοΈ]
    D --> F[Select Property]
    
    %% Host Flow (Get Started)
    C -- "Become a Host" --> G{Is User Logged In?}
    
    %% Auth Logic
    G -- No --> E[Login / Signup πŸ”]
    E --> G
    
    %% Create Listing Logic
    G -- Yes --> J[Create New Listing Form πŸ“]
    
    J --> K[Upload Images to Cloudinary ☁️]
    K --> L[Server-Side Joi Validation πŸ›‘οΈ]
    L --> M[Save to MongoDB Atlas πŸ’½]
    M --> N[πŸš€ Live Listing on Render]
    
    %% Booking Logic
    F --> G
    G -- Yes --> H[Book Stay / Leave Review πŸ’¬]
    
    H --> O((Happy User ✨))
    N --> O

Loading

🧠 Learning Outcomes

Building WanderLust transformed my theoretical knowledge into production-grade engineering skills.

πŸŽ“ Domain πŸš€ Key Takeaways & Skills Mastered
πŸ—οΈ Architecture Mastered the MVC (Model-View-Controller) pattern, decoupling logic to ensure the codebase is scalable and maintainable.
πŸ’½ Database Engineering Designed complex One-to-Many relationships in MongoDB (connecting Users ↔ Listings ↔ Reviews) and handled cascading deletes.
πŸ€– AI-Pair Programming Leveraged Generative AI for architectural planning, debugging complex logic errors, and optimizing documentation workflows (Prompt Engineering).
πŸ”’ Security Implemented robust security measures including Session-based Authentication (Passport.js), Joi Validation, and Environment Variable protection.
⚑ Performance Ops Solved the "Cold Start" problem on Render by implementing Cron Jobs to keep the server active and responsive.
🌐 API Integration Replaced paid mapping services with Open-Source alternatives (Leaflet + Nominatim), mastering asynchronous data handling.

πŸͺ„ Installation & Setup

Want to run this project locally? Follow these simple steps.

1. Clone the repository

git clone https://github.com/JunaidUsmani2468/WanderLust.git
cd WanderLust

2. Install Dependencies

npm install

3. Configure Environment Variables
Create a .env file in the root directory and add the following keys:

CLOUD_NAME=your_cloudinary_name
CLOUD_API_KEY=your_cloudinary_api_key
CLOUD_API_SECRET=your_cloudinary_api_secret
ATLASDB_URL=your_mongodb_connection_string
MY_SECRET=your_session_secret

4. Start the Application

node app.js

5. Visit the app

http://localhost:8080

6. Database Regeneration
This project uses one shared password for all seeded demo users (defined via environment variables). Add this to your .env file:

SEED_USER_PASSWORD=your_strong_dev_password

Then regenerate the database with demo users, listings, images, and reviews:

node init/init.js

⚠️ This command clears existing data and is intended for local development only.


πŸš€ Deployment

WanderLust is production-ready and deployed using modern cloud infrastructure.

Service Role
Render Full-stack hosting with CI/CD integration for automated deployments.
MongoDB Atlas Managed Cloud Database ensuring high availability and data persistence πŸ’½.
Cloudinary Content Delivery Network (CDN) for optimized image storage and serving ⚑.
Cron-job.org Automated "Keep-Alive" pings to prevent server sleep and eliminate cold-start latency ⚑.

⚑ Performance Note: I configured an external Cron Job to ping the server every 14 minutes. This prevents the Render free-tier from "sleeping," ensuring instant load times for all users.


🀝 Contributing

Open source is at the heart of this project. While this is primarily a portfolio piece, I welcome any suggestions or optimizations!

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch.
  5. Open a Pull Request.

πŸ™ Acknowledgements

Credit where credit is due. This project was built on the strong foundation laid by Shradha Khapra and the Apna College team.

Inspiration

  • The Mentor: A massive thank you to Shradha Ma'am for making complex concepts like MVC Architecture, Middlewares, and Database Relations feel easy. Her teaching style didn't just help me copy code; it taught me how to think like a developer. 🧠
  • The "Sigma" Boost: The "Sigma Batch" provided the roadmap, but her encouragement gave me the confidence to go off-road, switch to Leaflet, integrate Cron Jobs, and truly own this project. πŸš€
  • The Community: Special thanks to the open-source contributors behind Passport.js, Leaflet, and Mongoose who make tools we love.

πŸ“œ License

Distributed under the MIT License. See LICENSE for more information.



Made with πŸ’– by Junaid


About

WanderLust is a full-stack Airbnb-inspired web app for discovering, listing, and booking unique stays with authentication, reviews, and map integration.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors