CarHub is a Next.js 14 (App Router) application for discovering and renting cars.
Users can authenticate using Google, explore car listings, book rentals, and securely process payments through Stripe.
The project is written in TypeScript with a responsive design powered by Tailwind CSS and a dark theme.
The backend utilizes Prisma as the ORM with a PostgreSQL database.
- Prerequisites
- Installation
- Set up Prisma
- Running the Development Server
- Building for Production
- Running the Production Server
- Technologies Used
- Live Demo 🚀
Before you begin, ensure you have the following installed and set up:
- Node.js: Install Node.js on your machine.
- PostgreSQL Database: Set up a PostgreSQL database provider (e.g., Aiven).
- Stripe Account: Create an account on Stripe for payment processing.
- Brevo Email Account: Sign up for Brevo to send booking confirmation emails.
- RapidAPI Cars API Account: Obtain an API key from RapidAPI Cars API for car data.
- IMAGIN.studio API Account: Register with IMAGIN.studio API for car images (Note: Free tier availability may vary).
- Clone the repository:
git clone git@github.com:SiegfriedBz/next_app__cars.git
cd next_app__cars
- Install dependencies:
npm install
- Set up environment variables:
Create a .env file in the root directory and add the following environment variables
# NextAuth Configuration
NEXT_PUBLIC_NEXTAUTH_URL=
NEXTAUTH_SECRET=
GOOGLE_CLIENT_ID=
GOOGLE_SECRET_ID=
# Social Links
NEXT_PUBLIC_LINKEDIN_URL=
NEXT_PUBLIC_GITHUB_URL=
# RapidAPI Configuration
NEXT_PUBLIC_RAPID_API_KEY=
NEXT_PUBLIC_RAPID_API_HOST=
# IMAGIN.studio Configuration
NEXT_PUBLIC_IMAGIN_STUDIO_API_KEY=
# Prisma Configuration
DATABASE_URL=
# Stripe Configuration
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
STRIPE_SECRET_KEY=
# Admin Contact Email
NEXT_PUBLIC_MAIL_CONTACT=
# Brevo Email Configuration
NEXT_PUBLIC_BREVO_SENDER_NAME="Car Hub"
NEXT_PUBLIC_BREVO_SENDER_EMAIL=
NEXT_PUBLIC_BREVO_API_KEY=
Initialize Prisma:
npx prisma init
Generate Prisma Client:
npx prisma generate
To start the development server, run:
npm run dev
To build the project for production, run:
npm run build
After building the project, you can start the production server with:
npm start
- Framework: React, Next.js 14 (App Router)
- TypeScript: Provides type safety and improved development experience.
- Styling: Tailwind CSS (responsive design with dark theme support)
- ORM: Prisma
- DB: PostgreSQL
- Authentication: NextAuth.js with Google Provider
- Stripe
Visit the live demo of CarHub deployed on Vercel
PostgreSQL DB hosted on aiven.io