Airbnb Clone
A full-stack Airbnb-style booking application built with Node.js, Express, EJS, and MongoDB β allowing hosts to list homes and guests to browse and reserve them.
Live Demo: airbnb-sooty-eight.vercel.app
Features
- π Host dashboard β add, edit, and delete home listings
- π User authentication (signup/login) with session-based auth
- πΈ Image and PDF uploads via Cloudinary (cloud storage)
- πΊοΈ Browse and reserve listed homes
- π Responsive UI styled with Tailwind CSS
- βοΈ Deployed as a serverless app on Vercel
Tech Stack
| Layer | Technology |
|---|---|
| Backend | Node.js, Express.js |
| Templating | EJS |
| Database | MongoDB (Mongoose ODM) |
| Sessions | express-session + connect-mongodb-session |
| File Uploads | Multer + Cloudinary |
| Styling | Tailwind CSS |
| Deployment | Vercel (serverless functions) |
Project Structure
airbnb/
βββ app.js # App entry point
βββ vercel.json # Vercel serverless config
βββ controllers/ # Route handlers (auth, host, store, errors)
βββ models/ # Mongoose schemas (Home, User)
βββ routes/ # Express routers
βββ utils/ # Helper utilities (path resolution, etc.)
βββ views/ # EJS templates
β βββ auth/
β βββ host/
β βββ store/
βββ public/ # Static assets (CSS, images)
βββ package.json
Getting Started (Local Setup)
Prerequisites
- Node.js (v18+ recommended)
- A MongoDB Atlas account (or local MongoDB instance)
- A Cloudinary account (free tier works)
1. Clone the repository
git clone https://github.com/raushandeveloper/airbnb.git
cd airbnb
2. Install dependencies
npm install
3. Configure environment variables
Create a .env file in the project root:
MONGO_URI=your_mongodb_connection_string
SESSION_SECRET=your_session_secret
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
4. Run the app locally
npm start
This runs the Express server (via nodemon) alongside the Tailwind CSS watcher.
The app will be available at http://localhost:3001.
Deployment (Vercel)
This project is configured for serverless deployment on Vercel:
vercel.jsonroutes all requests throughapp.jsand explicitly includes theviews/andpublic/folders (required since EJS templates aren't traced by Vercel's default bundler).- File uploads (photos and PDFs) are stored on Cloudinary, since Vercel's serverless filesystem is read-only except for the temporary
/tmpdirectory. - MongoDB connection is cached across function invocations to avoid reconnecting on every request.
To deploy your own copy:
- Push the repo to GitHub
- Import the project into Vercel
- Add the environment variables listed above under Project Settings β Environment Variables
- Deploy π
Known Limitations
- Uploaded files rely on Cloudinary; there is no local fallback in production.
- Session store is MongoDB-backed, so a valid
MONGO_URIis required for login to work.
License
ISC
Log in or sign up for Devpost to join the conversation.