A full-stack property rental platform inspired by Airbnb, built with the MERN stack.
Live Demo: https://livigo.onrender.com
- User Authentication - Secure registration/login with Passport.js and session management
- Listing Management - Full CRUD operations with image upload via Cloudinary
- Advanced Search - Filter by categories (11 types) and location-based search
- Review System - Star ratings (1-5) with comment functionality
- Interactive Maps - Leaflet.js integration with OpenStreetMap geocoding
- Responsive Design - Airbnb-inspired UI with mobile-first approach
- Authorization - Role-based access control for listings and reviews
Frontend: EJS, Bootstrap 5.3, Leaflet.js, Font Awesome
Backend: Node.js 22.16, Express.js 5.2, Passport.js
Database: MongoDB 9.0, Mongoose ODM
For local development and testing, a separate MongoDB database named Livigo is used and seeded with sample data.
- Ensure your
.envfile contains:MONGO_URL=mongodb://localhost:27017/Livigo
- Run the following command to seed the
Livigodatabase with sample listings:This will clear existing listings and insert sample data.node init/index.js
- In your app, use
process.env.MONGO_URLfor local/test/dev environments to connect to the seededLivigodatabase.
Storage: Cloudinary (images), Connect-Mongo (sessions)
Validation: Joi schema validation
graph TB
Client[Web Browser] --> Express[Express Server]
Express --> Auth[Passport.js Auth]
Express --> Router[Route Handlers]
Router --> Controller[Controllers]
Controller --> Mongo[(MongoDB)]
Controller --> Cloud[Cloudinary CDN]
Auth --> Session[Session Store]
Session --> Mongo
graph LR
View[EJS Views] --> Controller[Controllers]
Controller --> Model[Mongoose Models]
Model --> DB[(MongoDB)]
DB --> Model
Model --> Controller
Controller --> View
sequenceDiagram
participant U as User
participant S as Server
participant M as Middleware
participant C as Controller
participant DB as Database
U->>S: HTTP Request
S->>M: Authentication Check
M->>M: Validate & Authorize
M->>C: Process Request
C->>DB: CRUD Operation
DB->>C: Return Data
C->>S: Render Response
S->>U: HTTP Response
Node.js 22.16.0+ | MongoDB | Cloudinary Account# Clone repository
git clone https://github.com/itssouravkumar/livigo.git
cd livigo
# Install dependencies
npm install
# Configure environment variables
cp .env.example .env
# Edit .env with your credentials
# Seed database (optional)
node init/index.js
# Start development server
npm run devPORT=3000
MONGO_ATLAS_URL=mongodb+srv://username:password@cluster.mongodb.net/livigo
SESSION_SECRET=your_session_secret_key
CLOUD_NAME=your_cloudinary_name
CLOUD_API_KEY=your_cloudinary_key
CLOUD_API_SECRET=your_cloudinary_secret| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /register |
Show registration form | No |
| POST | /register |
Create new user | No |
| GET | /login |
Show login form | No |
| POST | /login |
Authenticate user | No |
| GET | /logout |
Logout user | Yes |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /listings |
Get all listings | No |
| GET | /listings/new |
Show create form | Yes |
| POST | /listings |
Create listing | Yes |
| GET | /listings/:id |
Get listing details | No |
| GET | /listings/:id/edit |
Show edit form | Yes (Owner) |
| PUT | /listings/:id |
Update listing | Yes (Owner) |
| DELETE | /listings/:id |
Delete listing | Yes (Owner) |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /listings/:id/reviews |
Create review | Yes |
| DELETE | /listings/:id/reviews/:reviewId |
Delete review | Yes (Author) |
erDiagram
USER ||--o{ LISTING : creates
USER ||--o{ REVIEW : writes
LISTING ||--o{ REVIEW : has
USER {
ObjectId _id PK
string username UK
string email UK
string hash
string salt
}
LISTING {
ObjectId _id PK
string title
string description
object image
number price
string location
string country
enum category
ObjectId owner FK
array reviews
}
REVIEW {
ObjectId _id PK
number rating
string comment
date createdAt
ObjectId author FK
}
Categories: Trending, Rooms, Iconic Cities, Mountains, Castles, Amazing Pools, Camping, Farms, Arctic, Beachfront, Cabins
livigo/
βββ app.js # Express app configuration
βββ controllers/ # Business logic
β βββ listing.js
β βββ review.js
β βββ user.js
βββ models/ # Mongoose schemas
β βββ listing.js
β βββ review.js
β βββ user.js
βββ routes/ # Express routes
β βββ listing.js
β βββ review.js
β βββ user.js
βββ views/ # EJS templates
β βββ components/ # Reusable components
β βββ layouts/ # Page layouts
β βββ listings/ # Listing views
β βββ users/ # User views
βββ public/ # Static assets
β βββ css/
β βββ scripts/
β βββ assets/
βββ utils/ # Utility functions
βββ middlewares.js # Custom middleware
βββ schema.js # Joi validation
βββ cloudConfig.js # Cloudinary setup
User Registration β Hash Password β Save to DB β Auto Login β Create Session
User Login β Validate Credentials β Create Session β Redirect to Dashboard
Auth Check β Render Form β Upload Image β Store in Cloudinary β Save to MongoDB β Redirect
Auth Check β Validate Data (Joi) β Create Review β Update Listing β Recalculate Rating
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
This project is licensed under the MIT License - see LICENSE file.
Sourav Kumar
GitHub: @itssouravkumar
Design inspiration from Airbnb | Built with Express.js, MongoDB, and Cloudinary