Skip to content

tekteku/RentCars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— MyCars - Revolutionary Car Rental Platform

MyCars Logo Node.js React MongoDB Express.js

The Future of Car Rental - AI-Powered, Social, and Eco-Conscious

Features β€’ Installation β€’ Documentation β€’ API


🌟 What Makes This Revolutionary?

MyCars isn't just another car rental platform - it's a complete reimagination of how car rental should work in the modern era. We've implemented 10 revolutionary features that don't exist in any other rental service:

πŸ€– AI Recommendations πŸ† 5-Tier Loyalty πŸ—ΊοΈ AI Trip Planner
πŸ‘₯ Social Bookings πŸ”§ IoT Monitoring 🌍 Carbon Tracking
πŸ’° Dynamic Pricing πŸ“Έ Virtual Inspection 🎧 24/7 AI Support

✨ Revolutionary Features

1. πŸ€– AI-Powered Car Recommendations

  • Personalized suggestions based on your preferences and history
  • Smart scoring algorithm (0-100% match)
  • Trip type awareness (Business, Leisure, Family, Adventure)
  • Budget-conscious recommendations
  • Learn and improve with each booking

2. πŸ† 5-Tier Loyalty & Rewards Program

  • Bronze β†’ Silver β†’ Gold β†’ Platinum β†’ Diamond
  • Earn 1 point per € spent
  • Redeemable rewards catalog
  • Referral program with bonus points
  • Subscription plans (save up to 25%)
  • Achievement badges & gamification

3. πŸ—ΊοΈ AI-Powered Trip Planner

  • Smart route generation
  • Real-time weather forecasts
  • Carbon footprint calculation
  • Budget estimation (fuel, tolls, parking, food)
  • EV charging station recommendations
  • Scenic route options

4. πŸ‘₯ Social Car Sharing & Group Bookings

  • Split payments among friends
  • Group chat for coordination
  • Carpooling integration
  • Custom cost splitting
  • Booking rules (smoking, pets, music)

5. πŸ”§ Real-time Car Health Monitoring (IoT)

  • GPS location tracking
  • Fuel/battery level monitoring
  • Tire pressure alerts
  • Engine diagnostics
  • Maintenance scheduling
  • Health score (0-100%)

6. πŸ“Έ Virtual Car Inspection System

  • Photo-based pre/post rental inspection
  • AI damage detection
  • Condition rating
  • Dispute resolution with evidence
  • Historical records

7. 🌍 Carbon Footprint Tracking

  • Real-time COβ‚‚ emission calculation
  • Comparison with public transport
  • Eco-friendly car recommendations
  • Carbon offset purchase option
  • Environmental rewards

8. πŸ’° Dynamic Smart Pricing

  • Real-time price adjustments
  • Demand-based pricing
  • Weather multipliers
  • Seasonal variations
  • Loyalty member discounts

9. 🎧 24/7 AI-Powered Support

  • Instant AI chatbot responses
  • Intelligent ticket routing
  • Priority support for members
  • Automated suggestions
  • Real-time tracking

10. 🧠 User Preference Learning

  • Automatic preference tracking
  • No manual setup required
  • Learns from each booking
  • Budget pattern analysis
  • Eco-consciousness scoring

πŸš€ Quick Start

Prerequisites

Node.js v14+ β€’ MongoDB β€’ npm/yarn

Installation

# Clone the repository
git clone <repository-url>
cd RentCars-main

# Backend Setup
cd MyCarsT-Backend-master/MyCarsT-Backend-master
npm install
# Create .env file (see INSTALLATION_GUIDE.md)
npm start

# Frontend Setup (new terminal)
cd MyCar-FrontEnd-main/MyCar-FrontEnd-main
npm install
npm start

Access the Application

For detailed setup instructions, see INSTALLATION_GUIDE.md


πŸ—οΈ Tech Stack

Backend

  • Runtime: Node.js
  • Framework: Express.js
  • Database: MongoDB + Mongoose
  • Payment: Stripe
  • Authentication: JWT (ready)

Frontend

  • Framework: React.js v17
  • UI Library: Ant Design
  • State Management: Redux + Thunk
  • Routing: React Router v5
  • HTTP Client: Axios
  • AOS for scroll animations
  • Stripe Checkout for payments

Backend

  • Node.js v22.21.1
  • Express 4.17.1
  • MongoDB with Mongoose 6.0.13
  • Stripe API for payments
  • CORS enabled
  • dotenv for environment variables

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v22.21.1 or higher)
  • MongoDB (v8.2.2 or higher)
  • npm or yarn
  • Git

πŸš€ Quick Start

1. Clone the Repository

git clone https://github.com/tekteku/RentCars.git
cd RentCars

2. Backend Setup

# Navigate to backend directory
cd MyCarsT-Backend-master/MyCarsT-Backend-master

# Install dependencies
npm install

# Create .env file
echo MONGODB_URI=mongodb://localhost:27017/Cars > .env
echo PORT=5000 >> .env
echo STRIPE_SECRET_KEY=your_stripe_secret_key >> .env

# Seed the database with sample cars
node seedCars.js

# Start the backend server
npm start

The backend will run on http://localhost:5000

3. Frontend Setup

# Open a new terminal and navigate to frontend directory
cd MyCar-FrontEnd-main/MyCar-FrontEnd-main

# Install dependencies
npm install

# Create .env file
echo REACT_APP_PUBLIC_URL=http://localhost:5000 > .env

# Start the frontend server
npm start

The frontend will run on http://localhost:3000

4. Start MongoDB

# Windows (PowerShell)
mongod --dbpath "C:\data\db"

# macOS/Linux
mongod --dbpath /data/db

πŸ“ Project Structure

RentCars/
β”œβ”€β”€ MyCar-FrontEnd-main/
β”‚   └── MyCar-FrontEnd-main/
β”‚       β”œβ”€β”€ public/
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ components/     # Reusable components
β”‚       β”‚   β”œβ”€β”€ pages/          # Page components
β”‚       β”‚   β”œβ”€β”€ redux/          # Redux store, actions, reducers
β”‚       β”‚   β”œβ”€β”€ services/       # API services
β”‚       β”‚   β”œβ”€β”€ App.js
β”‚       β”‚   └── index.css       # Global styles
β”‚       β”œβ”€β”€ package.json
β”‚       └── .env
β”‚
└── MyCarsT-Backend-master/
    └── MyCarsT-Backend-master/
        β”œβ”€β”€ models/             # Mongoose models
        β”œβ”€β”€ routes/             # API routes
        β”œβ”€β”€ db.js               # Database configuration
        β”œβ”€β”€ server.js           # Express server
        β”œβ”€β”€ seedCars.js         # Database seeding script
        β”œβ”€β”€ package.json
        └── .env

πŸ”‘ Environment Variables

Backend (.env)

MONGODB_URI=mongodb://localhost:27017/Cars
PORT=5000
STRIPE_SECRET_KEY=your_stripe_secret_key_here

Frontend (.env)

REACT_APP_PUBLIC_URL=http://localhost:5000
NODE_OPTIONS=--openssl-legacy-provider

🎯 API Endpoints

Cars

  • GET /api/cars/getallcars - Get all cars
  • POST /api/cars/addcar - Add new car (Admin)
  • PUT /api/cars/editcar - Edit car (Admin)
  • DELETE /api/cars/deletecar - Delete car (Admin)

Bookings

  • POST /api/bookings/bookcar - Book a car
  • GET /api/bookings/getallbookings - Get all bookings
  • GET /api/bookings/getuserbookings - Get user's bookings

Users

  • POST /api/users/register - Register new user
  • POST /api/users/login - User login

πŸ‘€ User Roles

Regular User

  • Browse available cars
  • Search and filter cars
  • Book cars for specific dates
  • View booking history
  • Make payments via Stripe

Admin

  • All user capabilities
  • Add new cars
  • Edit existing cars
  • Delete cars
  • View all bookings
  • Manage user accounts

πŸ’Ύ Database Schema

Car Model

{
  name: String,
  image: String,
  capacity: Number,
  fuelType: String,
  bookedTimeSlots: Array,
  rentPerHour: Number
}

User Model

{
  username: String,
  password: String (hashed),
  role: String (default: "user")
}

Booking Model

{
  car: ObjectId (ref: Car),
  user: ObjectId (ref: User),
  bookedTimeSlots: Object,
  totalHours: Number,
  totalAmount: Number,
  transactionId: String
}

🎨 UI Features

  • Glassmorphism Effects - Frosted glass design with backdrop blur
  • Gradient Backgrounds - Ocean blue to teal color scheme
  • Smooth Animations - Float, pulse, shimmer, and ripple effects
  • Responsive Cards - Hover effects and lift animations
  • Modern Typography - Poppins and Inter fonts
  • Loading States - Skeleton loaders and spinners
  • Form Validation - Real-time input validation
  • Toast Notifications - Success and error messages

πŸ§ͺ Testing

To test the payment system, use Stripe's test card:

  • Card Number: 4242 4242 4242 4242
  • Expiry: Any future date
  • CVC: Any 3 digits
  • ZIP: Any 5 digits

πŸ“¦ Sample Data

The seedCars.js script populates the database with 12 premium cars:

  • Tesla Model S
  • BMW M5
  • Mercedes C-Class
  • Audi A6
  • Porsche 911
  • Range Rover Sport
  • Lamborghini Huracan
  • Toyota Camry
  • Ford Mustang
  • Honda Civic
  • Jeep Wrangler
  • Ferrari 488

πŸ› Troubleshooting

Backend won't start

  • Ensure MongoDB is running
  • Check if port 5000 is available
  • Verify .env file exists with correct values

Frontend won't start

  • Clear npm cache: npm cache clean --force
  • Delete node_modules and reinstall: rm -rf node_modules && npm install
  • Check if port 3000 is available

MongoDB connection issues

  • Verify MongoDB service is running
  • Check MongoDB URI in .env
  • Ensure database directory exists

OpenSSL error

  • Add NODE_OPTIONS=--openssl-legacy-provider to .env
  • Or downgrade to Node.js v16

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a new 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

πŸ‘¨β€πŸ’» Author

Taher

πŸ™ Acknowledgments

  • Ant Design for the UI components
  • Stripe for payment processing
  • Unsplash for car images
  • MongoDB for the database solution

πŸ“§ Support

For support, email your-email@example.com or open an issue in the GitHub repository.


Made with ❀️ by Taher

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published