A HTML CSS and JavaScript designed application using Express.js as the backend, node.js as the run-time environment and MongoDB as the database.
- nodemon app.js
Wanderlust is a web application built using Node.js, Express, and MongoDB. It allows users to manage travel listings and reviews. The application integrates EJS for templating, Mongoose for database interactions, and Express middleware for enhanced functionality.
- MongoDB Connection: Connects to a local MongoDB instance at
mongodb://127.0.0.1:27017/wanderlust. - Express Middleware: Uses
express-session,connect-flash,method-override, andexpress.staticfor enhanced routing and request handling. - Templating with EJS: Uses
ejs-mateas the view engine for dynamic HTML rendering. - Flash Messages: Displays success and error messages using
connect-flash. - Routes Handling: Includes routes for
listingsandreviews. - Error Handling: Uses custom middleware for handling errors.
Ensure you have Node.js and MongoDB installed on your system.
-
Clone the repository:
git clone <repository-url> cd wanderlust
-
Install dependencies:
npm install
-
Start MongoDB:
mongod
-
Run the application:
node app.js
or using nodemon (if installed):
nodemon app.js
-
Access the application in the browser:
http://localhost:8080/
/project-root
|-- models/ # Mongoose models
|-- public/ # Static files (CSS, JS, images)
|-- views/ # EJS templates
|-- utils/ # Utility functions
|-- app.js # Main application file
|-- Schema.js # Mongoose schema definitions
|-- listing.js # Listing route handlers
|-- review.js # Review route handlers
express-session: Session managementconnect-flash: Flash messagesmethod-override: Enables PUT and DELETE requestsmongoose: MongoDB ODM for Node.jsejs-mate: Layouts for EJS templates
The app includes an error-handling middleware that catches all unhandled routes and server errors.
Feel free to contribute! Fork the repository and create a pull request.
This project is licensed under the MIT License.
Abhisek Anjana and Mayank Choudhary


