Full-stack Airbnb clone built with Next.js 14, featuring property listings, booking system, user authentication, search filters, favorites, and interactive maps. π NextAuth β’ ποΈ MongoDB β’ π¨ Tailwind CSS β’ π± Responsive Design
- π Property Listings - Create, view, and manage property listings π
- π Advanced Search - Filter by location, dates, guests, and categories π―
- π Booking System - Complete reservation management with calendar π
- π Favorites - Save and manage favorite properties β€οΈ
- π Authentication - NextAuth with Google, GitHub, and email login π
- πΊοΈ Interactive Maps - Leaflet integration for property locations π
- π€ User Dashboard - Manage trips, properties, and reservations π’
- π± Responsive Design - Mobile-first approach with Tailwind CSS π²
- π¨ Modern UI - Clean, intuitive interface with smooth animations β¨
- π Multi-Provider Auth - Social login integration π
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
- βοΈ Next.js 14.2.4 - React framework π
- π React 18 - UI library π¨
- π― Tailwind CSS 3.4.1 - Utility-first CSS π
- π React Icons 5.2.1 - Icon library π
- π Prisma 5.15.1 - Database ORM π οΈ
- π MongoDB - NoSQL database π
- π NextAuth 4.24.7 - Authentication π€
- π bcrypt 5.1.1 - Password hashing π
- πΊοΈ Leaflet 1.9.4 - Interactive maps π
- βοΈ React Leaflet 4.2.1 - React wrapper πΊοΈ
- π World Countries 5.0.0 - Country data π
- π React Hook Form 7.52.0 - Form management π
- π React Date Range 2.0.1 - Date picker π
- π¨ React Select 5.8.0 - Select components π―
- π₯ React Hot Toast 2.4.1 - Toast notifications π
- π React Spinners 0.14.1 - Loading indicators β³
- π Axios 1.7.2 - HTTP client π
- π Date-fns 3.6.0 - Date utilities π°οΈ
- π Query String 9.0.0 - URL parsing π
- πͺ Zustand 4.5.2 - State management π¦
- βοΈ Cloudinary 6.6.2 - Image hosting πΈ
- Node.js 18+ π’
- MongoDB database ποΈ
- Cloudinary account βοΈ
- NextAuth providers (Google, GitHub) π
-
Clone repository π₯
git clone https://github.com/chayan-1906/Airbnb-Next.js.git cd Airbnb-Next.js
-
Install dependencies π¦
npm install
-
Environment setup βοΈ
cp .env.example .env
-
Configure environment π§
DATABASE_URL="mongodb+srv://..." NEXTAUTH_SECRET="your-secret-key" NEXTAUTH_URL="http://localhost:3000" GITHUB_ID="your-github-id" GITHUB_SECRET="your-github-secret" GOOGLE_CLIENT_ID="your-google-client-id" GOOGLE_CLIENT_SECRET="your-google-client-secret" NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="your-cloud-name" NEXT_PUBLIC_CLOUDINARY_API_KEY="your-cloudinary-api-key" CLOUDINARY_API_SECRET="your-cloudinary-api-secret"
-
Database setup ποΈ
npx prisma db push
-
Start development server π
npm run dev
app/
βββ api/ # API routes
β βββ auth/ # NextAuth configuration
β βββ listings/ # Property CRUD operations
β βββ reservations/ # Booking management
β βββ favorites/ # Favorites management
βββ components/ # Reusable components
β βββ inputs/ # Form components
β βββ listings/ # Property components
β βββ modals/ # Modal components
β βββ navbar/ # Navigation components
βββ hooks/ # Custom React hooks
βββ libs/ # Utility libraries
βββ providers/ # Context providers
βββ favorites/ # Favorites page
βββ trips/ # User trips
βββ properties/ # User properties
βββ reservations/ # User reservations
- Create Listing - Multi-step form with image upload πΈ
- Category Selection - Beach, mountain, city, etc. ποΈ
- Location Picker - Interactive map integration πΊοΈ
- Pricing & Details - Room count, amenities, description π°
- Location Search - Country/city selection π
- Date Range - Check-in/out calendar π
- Guest Count - Adults, children, infants π₯
- Category Filter - Property type filtering π
- Calendar Integration - Available dates display π
- Price Calculation - Dynamic pricing with fees π΅
- Reservation Management - Book, cancel, view trips π«
- Conflict Prevention - Prevent double bookings
β οΈ
- NextAuth Integration - Multiple providers π
- User Sessions - Secure session management π
- Protected Routes - Authentication guards π‘οΈ
- User Profiles - Profile management π€
{
id: String // MongoDB ObjectId
name: String? // User display name
email: String // Unique email
image: String? // Profile picture URL
hashedPassword: String? // Encrypted password
favoriteIds: String[] // Favorite property IDs
createdAt: DateTime // Account creation
updatedAt: DateTime // Last update
}
{
id: String // MongoDB ObjectId
title: String // Property title
description: String // Property description
imageSrc: String // Main image URL
category: String // Property category
roomCount: Int // Number of rooms
bathroomCount: Int // Number of bathrooms
guestCount: Int // Max guests
locationValue: String // Country/location
price: Int // Price per night
userId: String // Owner ID
createdAt: DateTime // Creation date
}
{
id: String // MongoDB ObjectId
userId: String // Guest ID
listingId: String // Property ID
startDate: DateTime // Check-in date
endDate: DateTime // Check-out date
totalPrice: Int // Total cost
createdAt: DateTime // Booking date
}
Method | Endpoint | Description | Auth |
---|---|---|---|
GET |
/api/listings |
Get all listings | β |
POST |
/api/listings |
Create new listing | β |
DELETE |
/api/listings/[id] |
Delete listing | β |
GET |
/api/reservations |
Get user reservations | β |
POST |
/api/reservations |
Create reservation | β |
DELETE |
/api/reservations/[id] |
Cancel reservation | β |
POST |
/api/favorites/[id] |
Add to favorites | β |
DELETE |
/api/favorites/[id] |
Remove from favorites | β |
POST |
/api/register |
User registration | β |
- ListingCard - Property card with image, price, location π‘
- ListingHead - Property header with title, location, actions π
- ListingInfo - Property details, host info, amenities π
- ListingReservation - Booking form with calendar π
- Input - Styled form inputs with validation π
- Counter - Number input with increment/decrement π’
- ImageUpload - Cloudinary image upload πΈ
- Calendar - Date range picker π
- CategoryInput - Category selection π·οΈ
- LoginModal - User authentication π
- RegisterModal - User registration π
- RentModal - Property creation wizard π
- SearchModal - Advanced search filters π
- Touch-friendly interface π
- Collapsible navigation π±
- Optimized images πΌοΈ
- Swipe gestures π
- Hover effects π±οΈ
- Keyboard navigation β¨οΈ
- Multi-column layouts π
- Sidebar navigation π
- Password hashing with bcrypt π
- CSRF protection via NextAuth π‘οΈ
- Input validation and sanitization π
- Rate limiting on API endpoints β‘
- Secure headers configuration π
- Server-side rendering for SEO π
- Image optimization with Next.js πΌοΈ
- Code splitting for faster loads π¦
- Caching strategies πΎ
- Lazy loading components β³
# Development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Generate Prisma client
npm run prisma:generate
# Run on custom port
npm run serve
- Connect GitHub repository π
- Configure environment variables βοΈ
- Deploy automatically on push π
DATABASE_URL
- MongoDB connection stringNEXTAUTH_SECRET
- NextAuth secret keyNEXTAUTH_URL
- Application URLGITHUB_ID
- GitHub OAuth app IDGITHUB_SECRET
- GitHub OAuth secretGOOGLE_CLIENT_ID
- Google OAuth client IDGOOGLE_CLIENT_SECRET
- Google OAuth secretNEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
- Cloudinary cloud nameNEXT_PUBLIC_CLOUDINARY_API_KEY
- Cloudinary API KeyCLOUDINARY_API_SECRET
- Cloudinary API Secret
- Node.js: β₯18.0.0 π’
- MongoDB: β₯5.0 ποΈ
- Memory: 1GB RAM minimum πΎ
- Storage: 2GB disk space πΏ
- Fork repository π΄
- Create feature branch (
git checkout -b feature/amazing-feature
) π - Commit changes (
git commit -m 'Add amazing feature'
) πΎ - Push branch (
git push origin feature/amazing-feature
) π - Open Pull Request π
- Map rendering on mobile devices may be slow πΊοΈ
- Image upload requires stable internet connection πΈ
Padmanabha Das
- GitHub: @chayan-1906 π
- LinkedIn: Padmanabha Das πΌ
- Email: padmanabhadas9647@gmail.com π§
Give a βοΈ if this project helped you! π
Made with β€οΈ by Padmanabha Das
β Star this repo if you found it helpful!