プロジェクト
概要
Full-stack vacation-rental marketplace built with Next.js 13 and Prisma: search listings by category, map area and date range, save favorites, book and manage reservations, and list your own properties with image uploads.
デザイン・メディアできること
- Authentication with NextAuth (JWT strategy)
- GitHub and Google OAuth login
- Credential-based email/password registration and login
- Create, view, and delete property listings
計測したスター増加
- 24時間
- +1
- 7日間
- 履歴を収集中
- 15日間
- 履歴を収集中
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルAirbnb Clone with Next.js
An Airbnb clone for vacation rentals, built with Next.js 13, TypeScript, Tailwind CSS, Prisma, MongoDB and NextAuth. Filter listings by location, date range, guests and rooms, explore them on an interactive Leaflet map, reserve stays on a calendar, upload your own properties, and track trips and favorites.
Table of Contents
- Table of Contents
- Features
- Tech Stack
- Getting Started
- Environment Variables
- Project Structure
- Demo
- API Reference
- Contributing
- License
Features
- Authentication with NextAuth (JWT strategy)
- GitHub and Google OAuth login
- Credential-based email/password registration and login
- Create, view, and delete property listings
- Image upload via Cloudinary
- Property search with filters (location, date range, guests, rooms, bathrooms)
- Interactive map with React Leaflet
- Reservation system with date range calendar
- Add and remove listings from favorites
- View trips, reservations, properties, and favorite listings
- Responsive design with Tailwind CSS
- Database with Prisma and MongoDB
- State management with Zustand
- Deployed on Vercel
Tech Stack
- Next.js 13
- TypeScript
- Tailwind CSS
- React
- NextAuth.js
- Prisma
- MongoDB
- Axios
- Zustand
- React Hook Form
- React Leaflet
- Cloudinary
- React Date Range
- date-fns
- React Hot Toast
- Vercel
Getting Started
Prerequisites
- Node.js 18+
- npm
- A MongoDB Atlas account (for database)
- GitHub and Google OAuth credentials (for authentication)
- A Cloudinary account (for image uploads)
Installation
git clone https://github.com/wrujel/airbnb-clone.git
cd airbnb-clone
npm install
Running locally
npm run dev
Open http://localhost:3000 with your browser to see the result.
Build
npm run build
Environment Variables
To run this project, you will need to add the following environment variables to your .env file.
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
MongoDB connection string | Yes |
NEXTAUTH_SECRET |
Secret for NextAuth.js session encryption | Yes |
GITHUB_CLIENT_ID |
GitHub OAuth app client ID | Yes |
GITHUB_CLIENT_SECRET |
GitHub OAuth app client secret | Yes |
GOOGLE_CLIENT_ID |
Google OAuth client ID | Yes |
GOOGLE_CLIENT_SECRET |
Google OAuth client secret | Yes |
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME |
Cloudinary cloud name for image uploads | Yes |
Project Structure
/
├── app/
│ ├── actions/ # Server actions (getCurrentUser, getListings, etc.)
│ ├── api/ # API routes
│ │ ├── favorites/ # Add/remove favorites
│ │ ├── listings/ # Create/delete listings
│ │ ├── register/ # User registration
│ │ └── reservations/ # Create/delete reservations
│ ├── components/ # React components
│ │ ├── Inputs/ # Form input components
│ │ ├── listings/ # Listing display components
│ │ ├── modals/ # Modal dialogs
│ │ └── navbar/ # Navigation components
│ ├── favorites/ # Favorites page
│ ├── hooks/ # Custom React hooks
│ ├── libs/ # Utility libraries (Prisma client)
│ ├── listings/ # Listing detail page
│ ├── properties/ # Properties management page
│ ├── reservations/ # Reservations management page
│ └── trips/ # Trips page
├── pages/
│ └── api/auth/ # NextAuth configuration
├── prisma/
│ └── schema.prisma # Database schema
├── public/
│ └── images/ # Static images
├── package.json
├── tailwind.config.js
└── tsconfig.json
Demo
You can check out the demo:
API Reference
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
POST |
/api/register |
Register a new user | No |
POST |
/api/listings |
Create a new listing | Yes |
DELETE |
/api/listings/:listingId |
Delete a listing | Yes |
POST |
/api/reservations |
Create a reservation | Yes |
DELETE |
/api/reservations/:reservationId |
Cancel a reservation | Yes |
POST |
/api/favorites/:listingId |
Add listing to favorites | Yes |
DELETE |
/api/favorites/:listingId |
Remove listing from favorites | Yes |
Contributing
Contributions are welcome! If you have suggestions or find bugs, please open an issue or submit a pull request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License.
関連プロジェクトを探す
読み込み中…