Skip to content

Latest commit

 

History

History
242 lines (194 loc) · 6.67 KB

File metadata and controls

242 lines (194 loc) · 6.67 KB

# EV Fleet Operations Console

A comprehensive full-stack application for managing electric vehicle fleets, built with Spring Boot 3.5.x and React 19.x.

🚗 Features

Core Functionality

  • EV Management: CRUD operations for electric vehicles with battery monitoring
  • Charger Management: Track charging station status and availability
  • Driver Management: Manage driver profiles and assignments
  • Real-time Telemetry: IoT data ingestion for vehicle status updates
  • Fleet Dashboard: Live monitoring with status cards and analytics

Dashboard Features

  • Fleet Health Overview: Real-time status of all vehicles and chargers
  • At-Risk Vehicle Alerts: Low battery vehicles with upcoming trips
  • Today's Trip Schedule: Current day trip planning and status
  • Battery Monitoring: Visual battery level indicators with color coding
  • Location Tracking: GPS coordinates for vehicle positioning

🏗️ Architecture

Backend (Spring Boot 3.5.x)

  • Java 21 with modern Spring features
  • PostgreSQL database with JPA/Hibernate
  • REST APIs for all CRUD operations
  • Telemetry ingestion endpoint for IoT data
  • MapStruct for entity-DTO mapping
  • Comprehensive testing with JUnit 5 and MockMVC

Frontend (React 19.x + TypeScript 5.7.x)

  • Modern React with hooks and functional components
  • TypeScript for type safety
  • Tailwind CSS for styling
  • React Router for navigation
  • Axios for API communication
  • Lucide React for icons
  • Responsive design for mobile and desktop

Infrastructure

  • Docker Compose for local development
  • PostgreSQL 15 database
  • Nginx reverse proxy for frontend
  • Telemetry simulator for realistic IoT data

🚀 Quick Start

Prerequisites

  • Docker and Docker Compose
  • Java 21 (for local development)
  • Node.js 18+ (for local development)

Using Docker Compose (Recommended)

  1. Clone the repository

    git clone <repository-url>
    cd EVision-Fleet-Console
  2. Start all services

    docker-compose up -d
  3. Access the application

  4. Initialize sample data (optional) The telemetry simulator will automatically create sample EVs and start sending data.

Local Development

Backend Setup

cd backend
./mvnw spring-boot:run

Frontend Setup

cd frontend
npm install
npm start

Telemetry Simulator

cd telemetry-simulator
npm install
npm start

📊 API Endpoints

EV Management

  • GET /api/evs - List all EVs
  • GET /api/evs/{id} - Get EV by ID
  • POST /api/evs - Create new EV
  • PUT /api/evs/{id} - Update EV
  • DELETE /api/evs/{id} - Delete EV

Charger Management

  • GET /api/chargers - List all chargers
  • POST /api/chargers - Create new charger
  • PUT /api/chargers/{id} - Update charger
  • DELETE /api/chargers/{id} - Delete charger

Driver Management

  • GET /api/drivers - List all drivers
  • POST /api/drivers - Create new driver
  • PUT /api/drivers/{id} - Update driver
  • DELETE /api/drivers/{id} - Delete driver

Telemetry

  • POST /api/telemetry - Submit telemetry data

Dashboard

  • GET /api/dashboard/summary - Fleet summary statistics
  • GET /api/dashboard/at-risk - At-risk vehicles
  • GET /api/dashboard/trips/today - Today's trips

🔧 Configuration

Environment Variables

Backend

  • SPRING_DATASOURCE_URL - Database URL
  • SPRING_DATASOURCE_USERNAME - Database username
  • SPRING_DATASOURCE_PASSWORD - Database password

Frontend

  • REACT_APP_API_URL - Backend API URL

Telemetry Simulator

  • API_URL - Backend API URL
  • INTERVAL - Telemetry send interval (ms)
  • EV_COUNT - Number of EVs to simulate

🧪 Testing

Backend Tests

cd backend
./mvnw test

Integration Tests

cd backend
./mvnw test -Dtest=*IntegrationTest

Frontend Tests

cd frontend
npm test

📁 Project Structure

EVision-Fleet-Console/
├── backend/                 # Spring Boot application
│   ├── src/main/java/
│   │   └── com/evops/fleetconsole/
│   │       ├── controller/  # REST controllers
│   │       ├── service/     # Business logic
│   │       ├── entity/      # JPA entities
│   │       ├── repository/  # Data repositories
│   │       ├── dto/         # Data transfer objects
│   │       └── mapper/      # MapStruct mappers
│   └── src/test/           # Unit and integration tests
├── frontend/               # React application
│   ├── src/
│   │   ├── components/     # Reusable components
│   │   ├── pages/          # Page components
│   │   ├── api/            # API client
│   │   └── types/          # TypeScript types
│   └── public/
├── telemetry-simulator/    # IoT data simulator
└── docker-compose.yml     # Container orchestration

🔄 Telemetry Data Format

{
  "evId": "uuid",
  "batteryPercent": 85,
  "state": "DRIVING",
  "odometerKm": 12543.7,
  "latitude": 12.9715987,
  "longitude": 77.5945627,
  "timestamp": "2025-12-10T10:23:00Z"
}

🎯 Key Features Implemented

Complete CRUD Operations for EVs, Chargers, and Drivers ✅ Real-time Telemetry Ingestion with automatic EV status updates ✅ Interactive Dashboard with live fleet monitoring ✅ At-risk Vehicle Detection for low battery alerts ✅ Responsive UI with modern design ✅ Docker Containerization for easy deployment ✅ Comprehensive Testing with unit and integration tests ✅ Realistic IoT Simulation with intelligent state transitions ✅ Database Schema optimized for fleet operations ✅ RESTful API Design following best practices

🛠️ Technology Stack

  • Backend: Java 21, Spring Boot 3.5.x, Spring Data JPA, PostgreSQL
  • Frontend: React 19.x, TypeScript 5.7.x, Tailwind CSS, Vite
  • Testing: JUnit 5, MockMVC, Jest, React Testing Library
  • DevOps: Docker, Docker Compose, Nginx
  • Tools: MapStruct, Axios, Lucide React, React Router

📈 Future Enhancements

  • Real-time WebSocket updates for live dashboard
  • Advanced analytics and reporting
  • Route optimization for trip planning
  • Mobile app for drivers
  • Integration with real IoT devices
  • Machine learning for predictive maintenance
  • Multi-tenant support for fleet operators

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.