Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EV Car Monitoring System — Full-Stack Fleet Management & Prediction Platform

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.


🏗️ Architecture

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)

🌟 Key Features

Admin Portal

  • 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.

Driver Portal

  • 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.

🔐 Credentials & Demo Accounts

Admin Login

  • Email: admin@ev.com
  • Password: admin123

Driver Login

  • Emails: driver1@ev.com through driver50@ev.com
  • Password: driver123

🛠️ Installation & Setup Guide

Prerequisites

  • Node.js (v18+)
  • Python (3.10+)
  • MySQL Server (8.0+) (optional: embedded fallback database included)

1. Install Dependencies & Seed Database

# Install Python packages
python -m pip install -r ml-service/requirements.txt

# Generate synthetic dataset and seed database
npm run seed

2. Train Machine Learning Model

npm run train-ml

3. Start Services

Open 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:frontend

📡 REST API Endpoint Reference

Authentication

  • POST /api/auth/login — Authenticate user and receive JWT.
  • POST /api/auth/register — Register a new driver.
  • GET /api/auth/me — Retrieve current user profile.

Vehicles

  • 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).

Admin Dashboard & Analytics (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.

Driver Features (Driver only)

  • 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.

Machine Learning Prediction

  • POST /api/prediction/fare — Proxy request to Python FastAPI ML service for fare and range estimation.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages