A full-featured rental marketplace built with Next.js, featuring product listings, rental requests, payments via Stripe, and comprehensive notifications.
- Node.js (v18 or higher)
- PostgreSQL database
- Gmail account (for email notifications)
- Clone the repository and install dependencies:
npm install- Set up your environment variables in
.env:
# Database
DATABASE_URL="your-postgresql-connection-string"
# JWT Secret
JWT_SECRET="your-secret-key"
# Email Configuration (Using Gmail - setup app password)
EMAIL_USER="your-email@gmail.com"
EMAIL_PASSWORD="your-app-password"
# Stripe API Keys
STRIPE_SECRET_KEY="your-stripe-secret-key"
STRIPE_PUBLISHABLE_KEY="your-stripe-publishable-key"
STRIPE_WEBHOOK_SECRET="your-stripe-webhook-secret"- Set up the database:
npm run prisma:migrate
npm run db:seed- Start the development server:
npm run devOpen http://localhost:3000 with your browser to see the result.
Using Gmail:
- Enable 2-factor authentication on your Gmail account
- Generate an app password: https://support.google.com/accounts/answer/185833
- Add the app password to your
.envfile asEMAIL_PASSWORD
Email Notifications:
- New rental requests (to product owners)
- Request approvals/rejections (to customers)
- Payment confirmations (to both parties)
- Return confirmations (to customers)
src/app/- Next.js App Router pages and API routessrc/components/- Reusable UI componentssrc/lib/- Utility functions and servicesprisma/- Database schema and migrations
- User authentication and authorization
- Product listings with image galleries
- Rental request management
- Stripe payment integration
- In-app notifications
- Email notifications
- Dashboard analytics
- Invoice generation and management
Uses Prisma ORM with PostgreSQL. Key models:
- User (customers and product owners)
- Product (rental items)
- RentalRequest (rental bookings)
- Payment (Stripe transactions)
- Notification (in-app alerts)
- Invoice (billing documents)
- Authentication:
/api/auth/login,/api/auth/signup - Products:
/api/products - Rental Requests:
/api/rental-requests - Payments:
/api/payments - Notifications:
/api/notifications - Dashboard:
/api/dashboard/*
The easiest way to deploy is using the Vercel Platform.
Update the following for production:
NEXT_PUBLIC_APP_URL- Your production domainDATABASE_URL- Production database connection- Email credentials (consider using SendGrid or similar for production)
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!