Follow these steps to get your Airbnb Clone running.
Before starting, ensure you have:
-
Node.js 18+ installed (Download)
node --version # Should show v18.x.x or higher -
npm installed (comes with Node.js)
npm --version
-
MongoDB 7+ installed (Download)
- OR Docker Desktop for containerized MongoDB
-
Git installed (for cloning)
git --version
Choose the method that works best for you:
Step 1: Navigate to project directory
cd airbnb-cloneStep 2: Run the start script
./start.shStep 3: Seed the database
docker-compose exec backend npm run seedStep 4: Open your browser
- Visit: http://localhost:5173
- Use credentials from seed output
To Stop:
docker-compose downmacOS:
brew services start mongodb-communityLinux:
sudo systemctl start mongodWindows:
- Start MongoDB service from Services app
- Or run
mongodfrom command prompt
Verify MongoDB is running:
mongosh
# Should connect without errorsTerminal 1 - Backend:
# Navigate to backend folder
cd airbnb-clone/backend
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Start development server
npm run devYou should see:
MongoDB connected successfully
Server running on port 5000
Terminal 2 - Frontend:
# Navigate to frontend folder
cd airbnb-clone/frontend
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Start development server
npm run devYou should see:
VITE v5.x.x ready in xxx ms
Local: http://localhost:5173/
Terminal 3 - Seed:
# Navigate to backend folder
cd airbnb-clone/backend
# Run seed script
npm run seedYou should see:
✅ Database seeded successfully!
Users: 50
Hosts: 15
Listings: 100
Bookings: 200
Reviews: 150
📧 Test user credentials:
Email: [email shown]
Password: password123
Open your browser and navigate to: http://localhost:5173
curl http://localhost:5000/healthExpected response:
{"status":"ok","message":"Server is running"}curl http://localhost:5000/api/listingsYou should see JSON with listings array.
Navigate to http://localhost:5173 in your browser.
You should see:
- Airbnb logo in header
- Search bar
- Grid of property listings with images
Solution 1: Check if MongoDB is running
# Try to connect with mongosh
mongosh
# Or check the process
# macOS/Linux:
ps aux | grep mongod
# Windows:
tasklist | findstr mongodSolution 2: Start MongoDB
# macOS:
brew services start mongodb-community
# Linux:
sudo systemctl start mongod
# Windows:
net start MongoDBSolution 3: Check MongoDB URI in .env
# Edit backend/.env
MONGODB_URI=mongodb://localhost:27017/airbnb-cloneSolution 1: Find and kill the process
# macOS/Linux:
lsof -ti:5000 | xargs kill -9
# Windows:
netstat -ano | findstr :5000
taskkill /PID [PID_NUMBER] /FSolution 2: Change the port
# Edit backend/.env
PORT=5001
# Edit frontend/.env
VITE_API_URL=http://localhost:5001/apiSolution 1: Kill the process
# macOS/Linux:
lsof -ti:5173 | xargs kill -9
# Windows:
netstat -ano | findstr :5173
taskkill /PID [PID_NUMBER] /FSolution 2: Let Vite choose another port Vite will automatically suggest an alternative port like 5174.
Solution: Clean install
# Backend
cd backend
rm -rf node_modules package-lock.json
npm install
# Frontend
cd ../frontend
rm -rf node_modules package-lock.json
npm installChecklist:
- Is the backend running? (check http://localhost:5000/health)
- Did you seed the database? (run
npm run seed) - Check browser console for errors (F12)
- Verify VITE_API_URL in frontend/.env
Re-seed database:
cd backend
npm run seedThis is normal! We use placeholder image URLs from Unsplash. Some may:
- Load slowly
- Show placeholder text
- Fail to load (fallback will show)
This is expected behavior with placeholder images.
Check Docker is running:
docker infoView container logs:
docker-compose logs backend
docker-compose logs frontend
docker-compose logs mongodbRebuild containers:
docker-compose down -v
docker-compose up --buildOnce everything is running:
- Click "Sign up" in the header
- Fill in your details
- Use a simple password like "password123" (development only!)
- Browse the home page grid
- Click on any listing to see details
- Check out the image gallery
- Click the search bar
- Enter a city name (e.g., "New York", "Paris")
- Select dates
- Choose number of guests
- Select a listing
- Choose check-in and check-out dates
- Click "Reserve"
- View your bookings in the user menu
After seeding, use the credentials shown in the console:
- Email: (shown in seed output)
- Password:
password123
Backend Changes:
- Edit files in
backend/src/ - Server auto-restarts (nodemon)
- Test with curl or browser
Frontend Changes:
- Edit files in
frontend/src/ - Page auto-reloads (Vite HMR)
- See changes instantly
Example: Add a new API endpoint
- Create controller in
backend/src/controllers/ - Define route in
backend/src/routes/ - Add route to
backend/src/index.ts - Create service in
frontend/src/services/ - Use in components
Backend:
# Add console.log statements
console.log('Debug:', variableName);
# Or use VS Code debugger
# Add breakpoints and press F5Frontend:
# Use browser DevTools (F12)
# Check Console tab for errors
# Check Network tab for API calls- ✅ Installation complete
- 📖 Read README.md for full documentation
- 🚀 Read SETUP.md for quick start guide
- 📝 Read PROJECT_SUMMARY.md for technical details
- 💻 Start coding!
# Backend
cd backend
npm install # Install dependencies
npm run dev # Start dev server
npm run build # Build for production
npm start # Run production build
npm run seed # Seed database
# Frontend
cd frontend
npm install # Install dependencies
npm run dev # Start dev server
npm run build # Build for production
npm run preview # Preview production build
# Docker
docker-compose up -d # Start all services
docker-compose down # Stop all services
docker-compose logs -f # View logs
docker-compose exec backend bash # Access backend container- Check error messages in terminal
- Look at browser console (F12)
- Review the documentation files
- Check MongoDB connection
- Verify environment variables
- Try restarting services
Congratulations! You're ready to build amazing features! 🎉