A full-stack vacation rental marketplace web application built with the MERN stack (MongoDB, Express, React-like EJS templating, Node.js). AtlasRoute allows users to browse, create, and review property listings - similar to Airbnb.
- Features
- Tech Stack
- Project Structure
- Prerequisites
- Installation
- Configuration
- Running the Application
- API Routes
- Database Schema
- Screenshots
- License
- User Authentication: Secure signup, login, and logout using Passport.js
- Listing Management: Create, read, update, and delete property listings
- Review System: Users can add ratings and comments to listings
- Image Upload: Cloudinary integration for storing listing images
- Interactive Maps: MapPLS integration for displaying locations
- Category Filtering: Browse listings by categories (Trending, Rooms, Mountains, Castles, Amazing Pools, Camping, Farms, Arctic)
- Price Display: Toggle to show/hide taxes (GST)
- Flash Notifications: User-friendly flash messages for actions
- Session Management: Persistent sessions with MongoDB store
- Server-side validation using Joi
- Responsive design with Tailwind CSS
- Protected routes for authenticated users
- Auto-delete reviews when a listing is deleted
- Runtime: Node.js v25.2.1
- Framework: Express.js v5.2.1
- Database: MongoDB with Mongoose ODM v9.0.2
- Template Engine: EJS v3.1.10
- Authentication: Passport.js v0.7.0 with passport-local-mongoose
- Styling: Tailwind CSS v4.1.18
- UI Components: Bootstrap (via CDN)
- Icons: Font Awesome
- Image Upload: Multer + Cloudinary
- Maps: MapPLS Web Maps
- Validation: Joi
- Sessions: express-session + connect-mongo
- Flash Messages: connect-flash
- Environment Variables: dotenv
AtlasRoute/
βββ app.js # Main application entry point
βββ CloudConfig.js # Cloudinary configuration
βββ schema.js # Joi validation schemas
βββ middleware.js # Custom middleware functions
βββ package.json # Dependencies and scripts
βββ controller/ # Route controllers
β βββ listing.js
β βββ review.js
β βββ user.js
βββ init/ # Database initialization
β βββ data.js # Sample data
β βββ index.js
βββ models/ # Mongoose models
β βββ listing.js
β βββ review.js
β βββ user.js
βββ public/ # Static files
β βββ css/
β β rating.css
β β βββ style.css
β βββ images/
β βββ JS/
β βββ script.js
βββ routes/ # Express routes
β βββ listing.js
β βββ review.js
β βββ user.js
βββ uploads/ # Uploaded files (temporary)
βββ utils/ # Utility functions
β βββ ExpressError.js
β βββ wrapAsync.js
βββ views/ # EJS templates
βββ error.ejs
βββ includes/
β βββ flash.ejs
β βββ footer.ejs
β βββ navbar.ejs
βββ layouts/
β βββ boilerplate.ejs
βββ listings/
β βββ edit.ejs
β βββ index.ejs
β βββ new.ejs
β βββ show.ejs
βββ users/
βββ home.ejs
βββ login.ejs
βββ signup.ejs
Before running the application, make sure you have:
- Node.js (v18 or higher) installed
- MongoDB (local or Atlas cloud) running
- Cloudinary account for image storage
- MapPLS API key for maps
-
Clone the repository
git clone <repository-url> cd AtlasRoute
-
Install dependencies
npm install
-
Create environment file Create a
.envfile in the root directory:# Database ATLASDB_URL=mongodb://localhost:27017/atlasroute # Session SECRET=your-secret-key-here # Cloudinary CLOUD_NAME=your-cloud-name CLOUD_API=your-cloud-api-key CLOUD_API_SECRET=your-cloud-api-secret # MapPLS MAP_SDK_KEY=your-mappls-api-key
| Variable | Description |
|---|---|
ATLASDB_URL |
MongoDB connection string |
SECRET |
Secret key for session encryption |
CLOUD_NAME |
Cloudinary cloud name |
CLOUD_API |
Cloudinary API key |
CLOUD_API_SECRET |
Cloudinary API secret |
MAP_SDK_KEY |
MapPLS API key |
The application uses MongoDB for data storage. The database schema includes:
- Listings: Property listings with title, description, price, location, images, and coordinates
- Reviews: User reviews with ratings and comments
- Users: User accounts with email and authentication data
-
Start MongoDB (if running locally)
mongod
-
Run the application
node app.js # or npm start -
Access the application Open your browser and navigate to:
http://localhost:8080
| Method | Route | Description |
|---|---|---|
| GET | /listing |
List all listings |
| GET | /listing/new |
Show new listing form (auth required) |
| POST | /listing |
Create new listing (auth required) |
| GET | /listing/:id |
Show listing details |
| GET | /listing/:id/edit |
Show edit form (owner only) |
| PUT | /listing/:id |
Update listing (owner only) |
| DELETE | /listing/:id |
Delete listing (owner only) |
| Method | Route | Description |
|---|---|---|
| POST | /listing/:id/reviews |
Add review to listing |
| DELETE | /listing/:id/reviews/:reviewId |
Delete review |
| Method | Route | Description |
|---|---|---|
| GET | /signup |
Show signup form |
| POST | /signup |
Create new user |
| GET | /login |
Show login form |
| POST | /login |
Authenticate user |
| GET | /logout |
Logout user |
| Method | Route | Description |
|---|---|---|
| GET | /listing?category=<name> |
Filter listings by category |
Available Categories: Trending, Rooms, Mountains, Castles, Amazing pools, Camping, Farms, Arctic
{
title: String (required),
description: String,
image: { url: String, filename: String },
price: Number,
location: String,
country: String,
geometry: { type: "Point", coordinates: [longitude, latitude] },
reviews: [ObjectId ref: Review],
owner: ObjectId ref: User,
category: String
}{
rating: Number (1-5),
comment: String,
createdAt: Date
}{
email: String (required, unique),
username: String (unique, provided by passport-local-mongoose)
}The application includes the following views:
- Home Page (
/) - Landing page with welcome message - Listings Index (
/listing) - Browse all listings with category filters - Listing Show (
/listing/:id) - Detailed view with map and reviews - New Listing (
/listing/new) - Form to create new listing - Edit Listing (
/listing/:id/edit) - Form to edit existing listing - Login (
/login) - User login form - Signup (
/signup) - User registration form
ISC License
Built with β€οΈ using Node.js, Express, and MongoDB