Skip to content

jaiyan-th/Car-Rent-Main

Repository files navigation

🚗 BookForDrive - Premium Car Rental Platform

BookForDrive Next.js NestJS TypeScript Prisma

Experience luxury and convenience with our modern, full-stack car rental solution

FeaturesTech StackInstallationDocumentationLicense


🌟 Overview

BookForDrive is a production-ready, full-stack car rental platform built with modern web technologies. Designed for scalability, performance, and exceptional user experience, it provides everything needed to run a professional car rental business online.

✨ Why BookForDrive?

  • 🎯 Modern Architecture - Built with Next.js 14 App Router and NestJS
  • 🔐 Secure Authentication - JWT-based auth with refresh tokens and OAuth support
  • 📱 Responsive Design - Beautiful UI that works seamlessly on all devices
  • High Performance - Optimized for speed with server-side rendering
  • 🎨 Premium UI/UX - Crafted with Tailwind CSS and shadcn/ui components
  • 🔄 Real-time Updates - Live booking status and notifications
  • 📊 Analytics Dashboard - Comprehensive insights for business decisions

🚀 Features

For Customers

  • 🔍 Advanced Search - Filter by location, date, car type, and price
  • 🚘 Premium Fleet - Browse luxury and economy vehicles with detailed specs
  • 📅 Easy Booking - Intuitive booking flow with real-time availability
  • 🚚 Delivery Service - Optional car delivery to your location
  • Reviews & Ratings - Share experiences and read verified reviews
  • 💳 Secure Payments - Multiple payment methods with Stripe integration
  • 📱 User Dashboard - Manage bookings, reviews, and preferences
  • 🔔 Notifications - Stay updated on booking status and promotions

For Administrators

  • 📊 Analytics Dashboard - Revenue, bookings, and user metrics
  • 🚗 Fleet Management - Add, edit, and manage vehicle inventory
  • 📍 Location Management - Configure pickup/delivery locations
  • 👥 User Management - Manage customers and permissions
  • 💰 Booking Management - Track and update booking status
  • 📝 Review Moderation - Approve and manage customer reviews
  • 📈 Reports - Generate detailed business reports

Technical Features

  • 🔐 JWT Authentication - Secure token-based authentication
  • 🔄 OAuth Integration - Google and Facebook login support
  • 📧 Email Notifications - Automated booking confirmations
  • 🗄️ Database ORM - Type-safe queries with Prisma
  • 🎨 Dark Mode - System-aware theme switching
  • 📱 PWA Support - Install as a mobile app
  • 🔍 SEO Optimized - Server-side rendering for better rankings
  • 🧪 Type Safety - Full TypeScript coverage

🛠️ Tech Stack

Frontend

  • Framework: Next.js 14 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS
  • UI Components: shadcn/ui, Radix UI
  • State Management: Zustand
  • Data Fetching: TanStack Query (React Query)
  • Forms: React Hook Form + Zod
  • Animations: Framer Motion
  • Icons: Lucide React

Backend

  • Framework: NestJS 10
  • Language: TypeScript
  • Database: SQLite (Prisma ORM)
  • Authentication: Passport.js (JWT, OAuth)
  • Validation: class-validator
  • API Documentation: Swagger/OpenAPI
  • Security: Helmet, CORS, Rate Limiting

DevOps & Tools

  • Version Control: Git
  • Package Manager: npm
  • Code Quality: ESLint, Prettier
  • API Testing: Swagger UI
  • Development: Hot Module Replacement

📦 Installation

Prerequisites

  • Node.js 18+ and npm
  • Git

Quick Start

  1. Clone the repository
git clone https://github.com/jaiyan-th/Car-Rent-Main.git
cd Car-Rent-Main
  1. Backend Setup
cd backend
npm install
cp .env.example .env
# Edit .env with your configuration
npx prisma migrate dev
npx prisma db seed
npm run start:dev
  1. Frontend Setup
cd frontend
npm install
cp .env.example .env.local
# Edit .env.local with your configuration
npm run dev
  1. Access the Application

Automated Setup (Windows)

setup.bat

Automated Setup (Linux/Mac)

chmod +x setup.sh
./setup.sh

📚 Documentation

Project Structure

Car-Rent-Main/
├── backend/                 # NestJS backend application
│   ├── src/
│   │   ├── modules/        # Feature modules
│   │   │   ├── auth/       # Authentication & authorization
│   │   │   ├── users/      # User management
│   │   │   ├── cars/       # Vehicle management
│   │   │   ├── bookings/   # Booking system
│   │   │   ├── reviews/    # Review & rating system
│   │   │   ├── payments/   # Payment processing
│   │   │   ├── analytics/  # Analytics & reporting
│   │   │   └── locations/  # Location management
│   │   ├── common/         # Shared utilities
│   │   └── main.ts         # Application entry point
│   ├── prisma/             # Database schema & migrations
│   └── package.json
│
├── frontend/               # Next.js frontend application
│   ├── src/
│   │   ├── app/           # App Router pages
│   │   ├── components/    # React components
│   │   │   ├── layout/    # Layout components
│   │   │   ├── sections/  # Page sections
│   │   │   └── ui/        # UI components
│   │   ├── services/      # API services
│   │   ├── store/         # State management
│   │   ├── types/         # TypeScript types
│   │   └── lib/           # Utilities
│   └── package.json
│
├── docs/                  # Additional documentation
├── CHANGELOG.md          # Version history
├── CONTRIBUTING.md       # Contribution guidelines
├── INSTALLATION.md       # Detailed installation guide
├── TROUBLESHOOTING.md    # Common issues & solutions
└── README.md            # This file

Key Endpoints

Authentication

  • POST /api/v1/auth/register - User registration
  • POST /api/v1/auth/login - User login
  • POST /api/v1/auth/refresh - Refresh access token
  • GET /api/v1/auth/google - Google OAuth login

Cars

  • GET /api/v1/cars - List all cars
  • GET /api/v1/cars/:id - Get car details
  • GET /api/v1/cars/featured - Get featured cars
  • POST /api/v1/cars - Create car (Admin)

Bookings

  • POST /api/v1/bookings - Create booking
  • GET /api/v1/bookings/user/my-bookings - User's bookings
  • PATCH /api/v1/bookings/:id - Update booking
  • GET /api/v1/bookings/admin/all - All bookings (Admin)

Reviews

  • POST /api/v1/reviews - Create review
  • GET /api/v1/reviews/car/:carId - Car reviews
  • GET /api/v1/reviews/user/my-reviews - User's reviews
  • DELETE /api/v1/reviews/:id - Delete review

🎨 Screenshots

Homepage

Modern, responsive homepage with hero section, featured cars, and testimonials.

Car Listing

Advanced filtering and sorting with beautiful card layouts.

Booking Flow

Intuitive multi-step booking process with real-time availability.

User Dashboard

Comprehensive dashboard for managing bookings and reviews.

Admin Panel

Powerful admin interface for managing the entire platform.


🔐 Environment Variables

Backend (.env)

DATABASE_URL="file:./dev.db"
JWT_SECRET="your-secret-key"
JWT_REFRESH_SECRET="your-refresh-secret"
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
FRONTEND_URL="http://localhost:3000"

Frontend (.env.local)

NEXT_PUBLIC_API_URL="http://localhost:3001/api/v1"
NEXT_PUBLIC_APP_NAME="BookForDrive"
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY="your-maps-api-key"

🧪 Testing

Run Backend Tests

cd backend
npm run test
npm run test:e2e

Run Frontend Tests

cd frontend
npm run test

🚀 Deployment

Frontend (Vercel)

cd frontend
vercel deploy --prod

Backend (Railway/Render)

cd backend
# Configure your deployment platform
# Set environment variables
# Deploy

🤝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.


👥 Authors


🙏 Acknowledgments

  • Next.js team for the amazing framework
  • NestJS team for the robust backend framework
  • shadcn for the beautiful UI components
  • All contributors who help improve this project

📞 Support

For support, email support@bookfordrive.com or open an issue on GitHub.


🗺️ Roadmap

  • Mobile app (React Native)
  • Advanced analytics dashboard
  • Multi-language support
  • Payment gateway integration (Stripe, PayPal)
  • Real-time chat support
  • AI-powered car recommendations
  • Loyalty program
  • Fleet tracking with GPS

Made with ❤️ by the BookForDrive Team

⭐ Star us on GitHub — it motivates us a lot!

Report BugRequest Feature

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors