A powerful, modern, and scalable e-commerce rental platform built with cutting-edge web technologies. Designed for seamless multi-role support including Customers, Vendors, and Administrators.
Live Demo β’ Documentation β’ Support
- Customers - Browse, rent, and manage orders
- Vendors - Sell and manage rental inventory
- Administrators - Oversee platform, approve products, and manage users
- Product Catalog - Browse and search rental items
- Smart Pricing - Hourly rental pricing strategy
- Inventory Management - Real-time stock tracking
- Shopping Cart - Add, modify, and manage items
- Secure Checkout - PCI-compliant payments
- Order Tracking - Real-time order status updates
- Delivery Options - COD and Pickup support
- Invoice Generation - Automated invoice creation
- Order History - Complete transaction records
- Product Management - Add, edit, manage rental items
- Order Fulfillment - Track and process customer orders
- Analytics & Reports - Revenue insights and performance metrics
- Customer Communication - Direct vendor-customer interface
- NextAuth Integration - Secure JWT-based authentication
- Password Encryption - bcryptjs hashing
- Role-Based Access Control - Route protection by user role
- GSTIN Tracking - GST compliance for vendors
- Responsive Design - Mobile-first approach
- Smooth Animations - Framer Motion transitions
- Interactive Charts - Recharts analytics
- Image Carousel - Swiper integration
- Node.js 16+
- npm or yarn package manager
- PostgreSQL database (Neon recommended)
- Clone the repository
git clone <repository-url>
cd boiler-plate- Install dependencies
npm install- Environment Configuration
Create a
.env.localfile in the root directory:
# Database
DATABASE_URL="postgresql://user:password@host/database"
# NextAuth
NEXTAUTH_SECRET="your-secret-key"
NEXTAUTH_URL="http://localhost:3000"
# Payment Gateway (if applicable)
NEXT_PUBLIC_PAYMENT_KEY="your-payment-key"- Setup Prisma Database
# Generate Prisma Client
npx prisma generate
# Run migrations
npx prisma migrate dev --name init
# Seed database (optional)
npx prisma db seed- Start Development Server
npm run devOpen http://localhost:3000 to view the application.
boiler-plate/
βββ app/ # Next.js App Router
β βββ api/ # API Routes
β β βββ auth/ # Authentication endpoints
β β βββ products/ # Product management
β β βββ cart/ # Shopping cart
β β βββ checkout/ # Checkout flow
β β βββ payments/ # Payment processing
β β βββ admin/ # Admin operations
β β βββ vendor/ # Vendor endpoints
β βββ admin/ # Admin dashboard
β βββ vendor/ # Vendor portal
β βββ user/ # Customer dashboard
β βββ product/ # Product details
β βββ cart/ # Shopping cart UI
β βββ checkout/ # Checkout page
β βββ components/ # Reusable components
βββ components/ # Shared components
β βββ SessionProvider.js # NextAuth provider
βββ lib/ # Utility functions
β βββ auth.js # Authentication config
β βββ prisma.js # Prisma client
β βββ toast.js # Toast notifications
βββ prisma/ # Database
β βββ schema.prisma # Database schema
βββ public/ # Static assets
The application uses Prisma ORM with PostgreSQL. Key models:
- User - Customer, Vendor, and Admin profiles with roles
- Product - Rental items with hourly pricing and inventory tracking
- Category - Product categorization system
- Order - Complete order lifecycle (Quotation β Sale Order β Invoiced)
- OrderItem - Individual items within orders
- Invoice - Generated invoices for transactions
# Development
npm run dev # Start dev server with hot reload
# Production
npm run build # Build optimized production bundle
npm start # Start production server
# Code Quality
npm run lint # Run ESLint on codebase
# Database
npx prisma studio # Open Prisma Studio GUI
npx prisma migrate dev # Create and apply migrations
npx prisma generate # Generate Prisma ClientPOST /api/auth/signup- Register new userPOST /api/auth/[...nextauth]- NextAuth endpointsGET /api/auth/session- Get current user session
GET /api/products- List all approved productsGET /api/products/[id]- Get product detailsPOST /api/products- Create product (Vendor)PUT /api/products/[id]- Update product (Vendor)GET /api/categories- Get product categories
GET /api/cart- Get shopping cart itemsPOST /api/cart- Add to cartPOST /api/checkout- Create order from cartGET /api/orders- Get user ordersGET /api/payments/create-order- Initiate payment
GET /api/admin/stats- Admin dashboard statisticsGET /api/admin/users- Manage usersGET /api/admin/products/pending- Pending product approvalsPOST /api/admin/products/approve- Approve vendor products
GET /api/vendor/products- Vendor's product listGET /api/vendor/orders- Vendor's customer ordersGET /api/vendor/customers- Vendor's customers listGET /api/vendor/reports- Vendor analytics & reports
- Navbar - Responsive navigation (Customer, Vendor, Admin variants)
- Carousel - Swiper-based image slider for product showcase
- Cart - Shopping cart management and updates
- Product Cards - Reusable product listing displays
- Login - User authentication form
- Signup - User registration with role selection
- Checkout - Multi-step checkout flow
- Dashboard - Analytics and management interfaces
- Vendor Portal - Product and order management
β
Role-Based Access Control (RBAC) - Route and API protection
β
JWT Authentication - Via NextAuth sessions
β
Password Encryption - bcryptjs with salt rounds
β
Protected API Routes - Middleware validation
β
CSRF Protection - NextAuth built-in
β
Environment Variable Management - Sensitive data isolation
β
GSTIN Validation - GST compliance for invoicing
- β‘ Next.js 16 App Router - Server & client components
- πΌοΈ Image Optimization - Automatic compression & lazy loading
- π¦ Code Splitting - Route-based bundle splitting
- π― Tailwind CSS 4 - PurgeCSS for minimal bundle
- π Database Query Optimization - Prisma query selection
- πΎ Caching Strategies - ISR and dynamic routes
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes and commit (
git commit -m 'Add amazing feature') - Push to your branch (
git push origin feature/amazing-feature) - Open a Pull Request with detailed description
# Create feature branch
git checkout -b feature/my-feature
# Make changes and test
npm run dev
# Run linter before commit
npm run lint
# Commit with meaningful message
git commit -m "feat: add new feature"# Verify DATABASE_URL in .env.local
# Check PostgreSQL/Neon credentials
# Restart development server
npm run devnpm install
npx prisma generate
npm run dev- Ensure
NEXTAUTH_SECRETis set in.env.local - Verify
NEXTAUTH_URLmatches your domain - Clear browser cookies and cache
- Restart development server
This project is licensed under the MIT License - see the LICENSE file for details.
- π§ Email: support@rentalhub.dev
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: Discussions
- π Full Documentation: Wiki
- π Tutorials: Video Guides
- π¬ Discord Community: Join Server
# Push to GitHub and connect to Vercel
# Environment variables are configured in Vercel dashboard
# Automatic deployments on every push to main- Railway -
railway up - Render - Connect GitHub repository
- AWS Amplify - Amplify Console deployment
Refer to Next.js Deployment Documentation for detailed instructions.
Give a β if this project helped you!
Made with β€οΈ by the RentalHub Team