Skip to content

git-adventures/airbnb-clone

Repository files navigation

🏠 Airbnb Clone - Full Stack Booking Platform

Airbnb Clone

A production-ready Airbnb clone with property listings, reservations, and advanced search functionality. Built with Next.js 15, React 19, Tailwind CSS, Prisma, MongoDB, and NextAuth for authentication with Google and GitHub OAuth support.

Credit: This project is based on the tutorial by Antonio Erdeljac (Code With Antonio)

✨ Features

πŸ” Authentication

  • πŸ“§ Email/Password - Traditional credential-based authentication
  • πŸ™ GitHub OAuth - Sign in with GitHub account
  • πŸ”΅ Google OAuth - Sign in with Google account
  • πŸ”’ Secure Sessions - JWT-based session management with NextAuth
  • πŸ”‘ Prisma Adapter - Seamless database integration for auth

🏑 Property Listings

  • βž• Multi-Step Creation - Intuitive 6-step listing creation wizard
  • 🏷️ Category Selection - Choose from 15 unique property categories
  • πŸ—ΊοΈ Location Picker - Interactive map with country autocomplete
  • πŸ›οΈ Amenities Counter - Guests, rooms, and bathrooms configuration
  • πŸ–ΌοΈ Image Upload - Cloudinary CDN integration for property photos
  • πŸ’° Pricing Setup - Set nightly rates for your property

🏷️ Property Categories

  • πŸ–οΈ Beach - Properties close to the beach
  • 🌬️ Windmills - Properties with windmills
  • πŸ›οΈ Modern - Modern architecture properties
  • πŸŒ„ Countryside - Rural countryside properties
  • 🏊 Pools - Properties with swimming pools
  • 🏝️ Islands - Island properties
  • 🎣 Lake - Lakeside properties
  • ⛷️ Skiing - Ski-in/ski-out properties
  • 🏰 Castles - Historic castle properties
  • πŸ•οΈ Camping - Camping and glamping spots
  • ❄️ Arctic - Arctic adventure properties
  • πŸ¦‡ Cave - Unique cave dwellings
  • 🏜️ Desert - Desert oasis properties
  • 🏚️ Barns - Converted barn properties
  • πŸ’Ž Lux - Luxury premium properties

πŸ“… Reservations System

  • πŸ“† Date Range Picker - Interactive calendar for booking dates
  • πŸ’° Price Calculation - Automatic total price based on selected dates
  • 🚫 Date Blocking - Prevents double bookings with reserved date validation
  • πŸ“‹ Booking Management - Create and cancel reservations

πŸ” Search & Filters

  • πŸ“ Location Filter - Search by country/region with map preview
  • πŸ“… Date Filter - Filter by check-in and check-out dates
  • πŸ‘₯ Guest Filter - Filter by number of guests
  • πŸ›οΈ Room Filter - Filter by number of rooms
  • 🚿 Bathroom Filter - Filter by number of bathrooms
  • 🏷️ Category Filter - Browse by property category

πŸ‘€ User Dashboard

  • ❀️ Favorites - Save and manage favorite listings
  • 🧳 My Trips - View all your upcoming and past reservations
  • 🏠 My Properties - Manage your listed properties
  • πŸ“₯ Guest Reservations - View reservations made on your properties

πŸš€ Core Platform Features

  • πŸ“± Responsive Design - Mobile-first approach with Tailwind CSS
  • ⏳ Loading States - Smooth loading indicators and skeletons
  • ❌ Error Handling - User-friendly error pages
  • 🍞 Toast Notifications - Real-time feedback with react-hot-toast
  • πŸ—ΊοΈ Interactive Maps - Leaflet-powered location display
  • 🌍 Country Data - World countries with flags and coordinates

πŸ› οΈ Tech Stack

Frontend

Backend & Database

Maps & Location

Media & Utilities

πŸ“‹ Prerequisites

Before you begin, ensure you have:

πŸš€ Getting Started

1. Clone the repository

git clone https://github.com/git-adventures/airbnb-clone.git
cd airbnb-clone

2. Install dependencies

npm install
# or
bun install

3. Setup Environment Variables

Create a .env file in the root directory:

# MongoDB Database
DATABASE_URL=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/<database>

# NextAuth Configuration
NEXTAUTH_SECRET=your_nextauth_secret_generate_with_openssl
NEXTAUTH_URL=http://localhost:3000

# GitHub OAuth (optional)
GITHUB_ID=your_github_oauth_client_id
GITHUB_SECRET=your_github_oauth_client_secret

# Google OAuth (optional)
GOOGLE_CLIENT_ID=your_google_oauth_client_id
GOOGLE_CLIENT_SECRET=your_google_oauth_client_secret

# Cloudinary (for image uploads)
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name

4. Setup Prisma Database

# Generate Prisma client
npx prisma generate

# Push schema to database
npx prisma db push

# (Optional) Open Prisma Studio to manage database
npx prisma studio

5. Start the development server

npm run dev
# or
bun run dev

Open http://localhost:3000 in your browser.

πŸ“¦ Available Scripts

Command Description
npm run dev Start development server with Turbopack
npm run build Build for production
npm start Start production server
npm run lint Run ESLint

πŸ”§ Troubleshooting

Database Issues

  • Ensure DATABASE_URL is correct and includes the database name
  • Run npx prisma db push to sync schema
  • Check MongoDB Atlas dashboard for connection status
  • Whitelist your IP address in MongoDB Atlas Network Access

Authentication Issues

  • Verify OAuth credentials are correct
  • Check callback URLs match your NEXTAUTH_URL
  • Ensure NEXTAUTH_SECRET is set (generate with openssl rand -base64 32)
  • For Google OAuth, configure authorized redirect URIs

Image Upload Issues

  • Verify NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME is set correctly
  • Configure upload presets in Cloudinary dashboard
  • Check browser console for CORS errors

Map Not Loading

  • Leaflet requires client-side rendering (already handled with dynamic imports)
  • Check if location data is being passed correctly

πŸ“š Resources

πŸ™ Acknowledgments


⭐ If you found this project helpful, please give it a star!

πŸ“š Resources:

Releases

No releases published

Packages

 
 
 

Contributors

Languages