A comprehensive car rental application built with React frontend and Express backend, featuring user authentication, fleet management, booking system, and AI-powered chat support.
- Frontend: React + TypeScript + Vite + Tailwind CSS
- Backend: Express + TypeScript + Prisma + PostgreSQL
- Authentication: JWT with HTTP-only cookies
- Database: PostgreSQL with Prisma ORM
- AI Integration: LangChain for chat functionality
- 🔐 User Authentication: Login, Register, Profile Management
- 🚗 Fleet Management: Browse and manage car inventory
- 📅 Booking System: Create and manage car bookings
- 💬 AI Chat Support: Intelligent customer support
- 📱 Responsive Design: Mobile-first UI/UX
- 🔒 Security: CORS, Helmet, Input validation
- 🎨 Modern UI: Beautiful, accessible interface
- Node.js (v18 or higher)
- PostgreSQL database
- npm or yarn
Option 1: Automated Setup (Recommended)
# Linux/Mac
./setup.sh
# Windows
setup.batOption 2: Manual Setup
# Install all dependencies
npm run install:all
# Set up environment variables
cp .env.example .env
# Edit .env with your database credentials
# Set up database
npx prisma generate
npx prisma db push# Start both frontend and backend
npm run dev:full
# Or start individually
npm run server:dev # Backend only
npm run frontend:dev # Frontend onlynpm run build:fullrental-app/
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # UI components
│ │ ├── pages/ # Page components
│ │ ├── context/ # React contexts
│ │ ├── services/ # API services
│ │ └── types/ # TypeScript types
├── src/ # Backend source
│ ├── routes/ # API routes
│ ├── middleware/ # Express middleware
│ └── langchain/ # AI integration
├── prisma/ # Database schema
└── server.ts # Main server file
POST /api/auth/login- User loginPOST /api/auth/register- User registrationGET /api/auth/logout- User logout
GET /api/fleet/fleet- Get all carsPOST /api/fleet/fleet- Add new car (Admin)
GET /api/bookings/bookings- Get user bookingsPOST /api/bookings/book- Create bookingPOST /api/bookings/cancel- Cancel booking
POST /api/chat/session- Create chat sessionGET /api/chat/session/:id/messages- Get messagesPOST /api/chat/session/:id/message- Send message
npm run dev:full- Start both frontend and backendnpm run server:dev- Start backend onlynpm run frontend:dev- Start frontend onlynpm run build:full- Build for productionnpm run install:all- Install all dependencies
- Frontend: http://localhost:5173
- Backend API: http://localhost:3001
- Health Check: http://localhost:3001/health
- Integration Guide - Detailed integration documentation
- Authorization Guide - Authentication and authorization details
- Fork the repository
- Create a feature branch
- Make your changes
- Test the integration
- Submit a pull request
This project is licensed under the MIT License.