Skip to content

jaiyan-th/Car-Rent-Main

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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

Features β€’ Tech Stack β€’ Installation β€’ Documentation β€’ License


🌟 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 Bug β€’ Request Feature

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages