A modern, feature-rich vacation rental platform built with Next.js, integrating dynamic user interfaces, authentication, and seamless deployment on Vercel.
Explore the app live: Next BnB
Next BnB is an engaging and interactive project designed to help developers build proficiency in web development using Next.js 14. This platform serves as a fully functional vacation rental application, showcasing key concepts in front-end and back-end development.
This project teaches:
- Building a responsive and dynamic user interface with TailwindCSS and Shadcn/UI.
- Developing structured and maintainable backend logic with Next.js Server Actions, Prisma ORM, and Supabase.
- Understanding the differences between server and client components, fetching data, managing states, and handling nested layouts.
- Implementing robust user authentication and account management with Clerk.
- Adding interactivity through CRUD operations and ensuring data validation with the Zod library.
- Uploading and managing images with Supabase storage.
- Deploying a production-ready application using Vercel.
This hands-on project provides practical challenges and solutions, empowering you to create sophisticated web applications confidently.
- Dynamic Categories: Explore listings by categories like cabins, airstreams, tents, and more.
- Shadcn Components: Beautiful and reusable components powered by Shadcn/UI.
- Dark Mode: A fully integrated theme toggle for improved user experience.
- Authentication: Secure and seamless login via Clerk.
- Reviews: View and interact with user reviews for listings.
- PostgreSQL Database: Reliable and fast database integration using Prisma and Supabase.
To get a local copy up and running, follow these steps:
- Node.js and npm installed
- A PostgreSQL database
- Supabase, Clerk, and Stripe accounts for API keys
-
Clone the repo:
git clone https://github.com/simoncheam/next-bnb.git cd next-bnb
-
Install dependencies:
npm install
-
Set up environment variables: You need two separate environment files for proper configuration:
# Clerk (Authentication) NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY= CLERK_SECRET_KEY= NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=/profile/create NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=/profile/create # Website URL NEXT_PUBLIC_WEBSITE_URL=https://next-bnb.vercel.app
# Prisma and Database DATABASE_URL= DIRECT_URL= # Supabase SUPABASE_URL= SUPABASE_KEY= # Stripe NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY= STRIPE_SECRET_KEY=
Note: Ensure these files are created in the root directory of your project and not committed to version control (add them to
.gitignore
). -
Initialize Prisma:
npx prisma migrate dev
-
Start the development server:
npm run dev
-
Open your browser at
http://localhost:3000
.
- Explore Listings: Browse vacation rentals by category and location.
- Dark Mode Toggle: Switch themes effortlessly using the dark mode toggle in the navbar.
- Authentication: Log in securely with Clerk.
Simon Cheam - LinkedIn
- Special thanks to John Smilga for project inspiration and guidance.
- Shadcn/UI for providing an amazing UI component library.
- Clerk for simplifying authentication integration.
- Prisma and Supabase for excellent database solutions.