A production-ready full-stack Airbnb clone built with modern technologies and best practices.
- β 33 REST API Endpoints fully functional
- π JWT Authentication with role-based access (Guest/Host)
- π³ Stripe Payment Integration with webhooks
- π Property Management (CRUD, publish/unpublish)
- π Booking System with status management
- β Review System with ratings
- β€οΈ Favorites/Wishlist functionality
- π Prisma ORM with SQLite/PostgreSQL support
- π‘οΈ Input Validation with class-validator
- π Error Handling with proper HTTP status codes
- β‘ App Router with server components
- π¨ shadcn/ui + TailwindCSS for modern UI
- π± Responsive Design mobile-first approach
- π Zustand for state management
- πͺ Custom Hooks for API integration
- π― TypeScript end-to-end type safety
- π SEO Optimized with meta tags
airbnb-full-clone/
βββ apps/
β βββ api-gateway/ # NestJS Backend
β β βββ src/
β β β βββ auth/ # Authentication module
β β β βββ properties/ # Property management
β β β βββ bookings/ # Booking system
β β β βββ payments/ # Stripe integration
β β β βββ reviews/ # Review system
β β β βββ favorites/ # Wishlist functionality
β β β βββ common/ # Shared utilities
β β βββ test/ # API tests
β β
β βββ web/ # Next.js Frontend
β βββ src/
β β βββ app/ # App router pages
β β βββ components/ # React components
β β βββ lib/ # Utilities & API clients
β β βββ types/ # TypeScript types
β
βββ packages/
βββ database/ # Prisma schema & migrations
βββ prisma/
- Framework: NestJS 10
- Language: TypeScript 5
- Database: Prisma ORM (SQLite/PostgreSQL)
- Authentication: JWT with Passport
- Payments: Stripe API
- Validation: class-validator, class-transformer
- Documentation: REST API with 33 endpoints
- Framework: Next.js 15 (App Router)
- Language: TypeScript 5
- Styling: TailwindCSS + shadcn/ui
- State: Zustand
- Forms: React Hook Form + Zod
- HTTP Client: Axios
- UI Components: Radix UI + shadcn/ui
- Node.js 18+
- pnpm 8+
git clone https://github.com/YOUR_USERNAME/airbnb-fullstack-clone.git
cd airbnb-fullstack-clone
pnpm installcd packages/database
npx prisma generate
npx prisma migrate dev --name initBackend (apps/api-gateway/.env):
DATABASE_URL="file:../../packages/database/prisma/dev.db"
JWT_SECRET=your_jwt_secret_key
STRIPE_SECRET_KEY=sk_test_...
STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...Frontend (apps/web/.env.local):
NEXT_PUBLIC_API_URL=http://localhost:3001/api
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...Backend:
cd apps/api-gateway
pnpm run start:dev
# Server runs on http://localhost:3001Frontend:
cd apps/web
pnpm run dev
# App runs on http://localhost:3000# Backend
cd apps/api-gateway
pnpm run build
pnpm run start:prod
# Frontend
cd apps/web
pnpm run build
pnpm run startPOST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user
GET /api/properties- List all propertiesGET /api/properties/:id- Get property detailsPOST /api/properties- Create property (Host only)PATCH /api/properties/:id- Update propertyDELETE /api/properties/:id- Delete propertyPATCH /api/properties/:id/publish- Publish propertyGET /api/properties/my-properties- Get my properties
POST /api/bookings- Create bookingGET /api/bookings/my-bookings- Get my bookingsGET /api/bookings/host-bookings- Get bookings (Host)GET /api/bookings/:id- Get booking detailsPATCH /api/bookings/:id/confirm- Confirm booking (Host)PATCH /api/bookings/:id/cancel- Cancel booking
POST /api/payments/create-intent- Create payment intentPOST /api/payments/confirm- Confirm paymentGET /api/payments/booking/:id- Get payment by bookingPOST /api/payments/:id/refund- Refund paymentPOST /api/payments/webhook- Stripe webhook
POST /api/reviews- Create reviewGET /api/reviews/property/:id- Get property reviewsGET /api/reviews/my-reviews- Get my reviewsGET /api/reviews/:id- Get review detailsPATCH /api/reviews/:id- Update reviewDELETE /api/reviews/:id- Delete review
POST /api/favorites/:propertyId- Add to favoritesDELETE /api/favorites/:propertyId- Remove from favoritesPOST /api/favorites/toggle/:propertyId- Toggle favoriteGET /api/favorites- Get my favoritesGET /api/favorites/check/:propertyId- Check if favoritedGET /api/favorites/count/:propertyId- Get favorite count
# Use REST Client extension in VS Code
# Open apps/api-gateway/test/complete-test.httpmodel User {
id String @id @default(cuid())
email String @unique
password String
name String
role Role @default(GUEST)
avatar String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Property {
id String @id @default(cuid())
title String
description String
price Float
propertyType PropertyType
maxGuests Int
bedrooms Int
bathrooms Int
city String
country String
images String // JSON array
status PropertyStatus @default(DRAFT)
hostId String
host User @relation(fields: [hostId])
}
model Booking {
id String @id @default(cuid())
propertyId String
guestId String
checkIn DateTime
checkOut DateTime
guests Int
totalPrice Float
status BookingStatus @default(PENDING)
}
model Payment {
id String @id @default(cuid())
bookingId String @unique
amount Float
stripePaymentIntentId String
status PaymentStatus @default(PENDING)
}
model Review {
id String @id @default(cuid())
bookingId String @unique
propertyId String
userId String
rating Int
comment String?
}
model Favorite {
id String @id @default(cuid())
userId String
propertyId String
@@unique([userId, propertyId])
}Built with shadcn/ui:
- Button, Input, Card, Dialog
- Dropdown Menu, Avatar, Badge
- Calendar, Select, Form
- Toast notifications
- Skeleton loaders
- And more...
cd apps/api-gateway
pnpm run build
# Deploy to Railway or Rendercd apps/web
pnpm run build
# Deploy to VercelMIT License - feel free to use this project for learning purposes.
Gherson
- GitHub: [@YOUR_USERNAME]
- LinkedIn: [Your LinkedIn]
- Inspired by Airbnb
- Built for learning and portfolio purposes
- Not affiliated with Airbnb Inc.
For questions or collaboration: your.email@example.com
β If you found this project helpful, please give it a star!