A comprehensive EV Car Monitoring System for monitoring electric vehicles, drivers, battery status, vehicle locations/status, revenue, maintenance, charging, electricity consumption, driver behavior, and ML-based fare/range predictions.
React Frontend (Vite + Tailwind CSS + Recharts)
│
│ REST API (JWT)
▼
Node.js + Express Backend
(Auth, RBAC, REST APIs)
│ │
MySQL 8 Pool │ │ REST API
▼ ▼
MySQL Database Python FastAPI ML Service
(ev_monitoring) (Scikit-Learn Model)
- Fleet Dashboard: 10 live KPI cards (Total Cars, Running, Charging, Garage, Workshop, Available, Drivers, Revenue, Maintenance, Electricity).
- Vehicle Status Distribution: Pie/Donut breakdown of vehicle states.
- Manufacturer Analytics: Count of vehicles across Tata, Hyundai, MG, BYD, and Mahindra.
- Monthly Revenue Analytics: Area chart with month filter selector (
YYYY-MM). - Driver Revenue Rankings: Reports for Highest Revenue Drivers and Low Revenue Drivers with sorting controls.
- Maintenance Analytics: Vehicle service alert statuses (
CRITICAL,SERVICE DUE,SERVICE SOON,GOOD), costs per vehicle/manufacturer. - Electricity & Charging Analytics: kWh consumption per vehicle, charging costs, and recent charging session logs.
- Assigned EV Overview: Real-time battery level progress bar and specs.
- Dynamic Low Battery Alert (<25%): Dynamic warning banner displayed when battery drops below 25%, advising recharge before long trips.
- Driving Habits Analytics: Speed over time and Battery % over time line charts.
- Interactive Telemetry Filters: Filter habit data by From Date, To Date, Start Time, End Time, Min Speed, and Max Speed.
- ML Fare & Range Predictor: Form to estimate remaining driving range (km), driving time (hours), and fare revenue (₹) based on battery level.
- Email:
admin@ev.com - Password:
admin123
- Emails:
driver1@ev.comthroughdriver50@ev.com - Password:
driver123
- Node.js (v18+)
- Python (3.10+)
- MySQL Server (8.0+) (optional: embedded fallback database included)
# Install Python packages
python -m pip install -r ml-service/requirements.txt
# Generate synthetic dataset and seed database
npm run seednpm run train-mlOpen separate terminal windows or run:
# Terminal 1: Python FastAPI ML Service (Port 8000)
npm run start:ml
# Terminal 2: Node.js Express Backend (Port 5000)
npm run start:backend
# Terminal 3: React Vite Frontend (Port 5173)
npm run dev:frontendPOST /api/auth/login— Authenticate user and receive JWT.POST /api/auth/register— Register a new driver.GET /api/auth/me— Retrieve current user profile.
GET /api/vehicles— List all vehicles (query params:status,manufacturer,search).GET /api/vehicles/:id— Get single vehicle details.POST /api/vehicles— Add new vehicle (Admin only).PUT /api/vehicles/:id— Update vehicle (Admin only).DELETE /api/vehicles/:id— Remove vehicle (Admin only).
GET /api/admin/dashboard— KPI cards overview.GET /api/admin/vehicle-status— Status distribution counts.GET /api/admin/revenue— Monthly revenue breakdown & manufacturer earnings.GET /api/admin/drivers— Driver performance & revenue rankings.GET /api/admin/maintenance— Fleet maintenance analytics & service alerts.GET /api/admin/electricity— kWh consumption & charging session logs.
GET /api/driver/dashboard— Driver assigned vehicle, battery %, today's earnings.GET /api/driver/vehicle— Detailed vehicle specifications.GET /api/driver/trips— Trip history and fare logs.GET /api/driver/habits— Filterable driving habit telemetry analytics.
POST /api/prediction/fare— Proxy request to Python FastAPI ML service for fare and range estimation.