Skip to content

Student-coder-web/Wonderlust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WonderLust - Vacation Rental Application

A Node.js web application for browsing vacation rental listings built with Express, MongoDB, and EJS.

Features

  • Browse all vacation rental listings
  • View detailed information for individual listings
  • Responsive design with modern UI
  • MongoDB database integration
  • Sample data included

Prerequisites

Before running this application, make sure you have the following installed:

  • Node.js (version 14 or higher)
  • MongoDB (running locally on port 27017)
  • npm (comes with Node.js)

Installation

  1. Clone or download the project files

  2. Install dependencies:

    npm install
  3. Start MongoDB: Make sure MongoDB is running on your local machine. If you haven't installed MongoDB, you can download it from mongodb.com.

  4. Initialize the database with sample data:

    npm run init-db
  5. Start the application:

    npm start

    Or for development with auto-restart:

    npm run dev

Usage

Once the application is running:

  1. Open your web browser and go to http://localhost:8080
  2. Click on "All Listings" or go to http://localhost:8080/listings to see all vacation rentals
  3. Click on any listing to view its details

Available Scripts

  • npm start - Start the application
  • npm run dev - Start the application with nodemon (auto-restart on file changes)
  • npm run init-db - Initialize the database with sample data

Project Structure

Wonderlust/
├── app.js              # Main application file
├── package.json        # Dependencies and scripts
├── models/
│   └── listing.js      # MongoDB schema for listings
├── views/
│   └── listings/
│       ├── index.ejs   # All listings page
│       └── show.ejs    # Individual listing page
└── init/
    ├── data.js         # Sample data
    └── index.js        # Database initialization script

Database Schema

Each listing contains:

  • title - Property title
  • description - Property description
  • image - Object with filename and url
  • price - Price per night
  • location - City/location
  • country - Country

Troubleshooting

MongoDB Connection Issues

  • Make sure MongoDB is running on localhost:27017
  • Check if the MongoDB service is started
  • Verify your MongoDB installation

Port Already in Use

  • The application runs on port 8080 by default
  • If the port is busy, you can change it in app.js

No Listings Showing

  • Run npm run init-db to populate the database with sample data
  • Check the MongoDB connection in the console

Technologies Used

  • Backend: Node.js, Express.js
  • Database: MongoDB with Mongoose ODM
  • Template Engine: EJS
  • Frontend: HTML, CSS, JavaScript

License

ISC

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors