Fleet Management System
Python-based Fleet Management System with real-time automotive telematics: OBD-II diagnostics, GPS tracking, CAN bus decoding, DTC analysis, driver behavior monitoring, fuel analytics & live dashboard. Built with FastAPI + SQLAlchemy.
Install / Use
npx skills add santoshiimind/fleet-management-systemInstalls into whichever agent you are using.
README
🚗 Fleet Management System — Automotive Telematics
A comprehensive Python-based fleet management platform with real-time vehicle telematics, designed for the automotive sector.
Built with: Python 3.10+ · FastAPI · SQLAlchemy · OBD-II · CAN Bus · GPS/GNSS
📸 Live Dashboard Preview

Real-time fleet dashboard showing vehicle tracking, engine telemetry, fuel levels, and active alerts.
🗺️ Live Fleet Map

Interactive Leaflet.js map with real-time vehicle positions, status-coded markers, search, and filtering.
📌 About
This system provides end-to-end fleet management for automotive companies, logistics operators, and transportation businesses. It connects directly to vehicles via OBD-II, CAN bus, and GPS to collect real-time telemetry data, enabling fleet operators to:
- Monitor every vehicle in real-time — location, speed, engine health, fuel levels
- Detect and diagnose faults instantly — 600+ Diagnostic Trouble Codes with severity analysis
- Improve driver safety — automatic detection of harsh braking, speeding, aggressive driving
- Reduce operational costs — fuel consumption analytics, predictive maintenance scheduling
- Ensure compliance — geofence monitoring, trip logging, driver behavior scoring
The platform is designed following automotive industry standards (SAE J1979, ISO 11898, NMEA 0183) and is compatible with any vehicle manufactured after 1996 (OBD-II mandatory).
🎯 Use Cases
1. 🚚 Logistics & Delivery Fleet
Track delivery vehicles across cities in real-time. Monitor route adherence, delivery times, and fuel consumption. Get alerts when vehicles deviate from geofenced zones or when drivers speed.
Key features used: GPS Tracking, Geofencing, Trip Logging, Fuel Analytics
2. 🏢 Corporate Fleet Management
Manage a company's vehicle fleet — from sales team cars to executive vehicles. Track maintenance schedules, ensure vehicles are serviced on time, and monitor driver behavior for insurance compliance.
Key features used: Maintenance Scheduling, Driver Safety Scores, Vehicle CRUD, Alerts
3. 🚕 Taxi & Ride-Hailing Operations
Monitor cab fleets in real-time. Track idle time, trip distances, fuel efficiency per driver, and identify underperforming vehicles. Automate maintenance alerts based on mileage and engine diagnostics.
Key features used: Trip Tracking, Fuel Analytics, OBD-II Diagnostics, Driver Scoring
4. 🏗️ Construction & Heavy Equipment
Track construction vehicles and heavy machinery across job sites. Monitor engine hours, overheating, and excessive idling. Schedule preventive maintenance to avoid costly breakdowns.
Key features used: Engine Health Monitoring, Idle Alerts, Maintenance Records, CAN Bus Data
5. 🚐 Public Transportation
Monitor buses, shuttles, and municipal vehicles. Ensure route compliance, track real-time passenger vehicle locations, and maintain vehicle health across a large fleet.
Key features used: GPS Tracking, Geofencing, Fleet Dashboard, Alert Engine
6. 🔧 Vehicle Diagnostics Workshop
Use the DTC Analyzer as a diagnostic tool. Connect to customer vehicles via OBD-II, read fault codes, get severity assessments, and generate repair recommendations with cost estimates.
Key features used: OBD-II Reader, DTC Analyzer, Maintenance Suggestions
7. 📊 Insurance Telematics (UBI)
Implement Usage-Based Insurance by collecting driving behavior data — speed patterns, braking habits, acceleration profiles. Generate driver safety scores for premium calculations.
Key features used: Driver Behavior Monitoring, Safety Scores, Trip Analytics, Telemetry History
8. 🔋 EV Fleet Management
Monitor electric vehicle fleets with battery level tracking (via fuel_level), charging patterns, and range estimation. Track energy consumption efficiency across the fleet.
Key features used: Battery Monitoring, Fuel/Energy Analytics, Vehicle Status Tracking
🏗️ Architecture
┌─────────────────────────────────────────────────────────────┐
│ Web Dashboard (Jinja2) │
├─────────────────────────────────────────────────────────────┤
│ FastAPI REST API │
├──────────┬──────────┬───────────┬──────────┬───────────────┤
│ Vehicle │ Fleet │ Telematics│ Alert │ Diagnostics │
│ Manager │ Manager │ Engine │ Engine │ (DTC) │
├──────────┴──────────┴───────────┴──────────┴───────────────┤
│ SQLAlchemy ORM + SQLite/PostgreSQL │
├─────────────────────────────────────────────────────────────┤
│ OBD-II │ GPS │ CAN Bus │ MQTT │ Simulator │
│ Reader │ Tracker │ Decoder │ (opt) │ (testing) │
└─────────────────────────────────────────────────────────────┘
📁 Project Structure
FLEETMANAGMENT/
├── main.py # Application entry point
├── cli.py # CLI tool (fleet-management command)
├── pyproject.toml # Python package configuration
├── Dockerfile # Multi-stage production Docker image
├── docker-compose.yml # One-command deployment
├── gunicorn_config.py # Production ASGI server config
├── simulator.py # Telemetry data simulator
├── requirements.txt # Python dependencies
├── .env.production # Production environment template
│
├── .github/workflows/ # CI/CD Pipelines
│ ├── ci-cd.yml # Auto test, build, publish
│ └── release.yml # Manual release trigger
│
├── config/
│ └── settings.py # Centralized configuration
│
├── models/ # Database models (SQLAlchemy)
│ ├── database.py # DB engine & session
│ ├── vehicle.py # Vehicle model (VIN, make, model, status)
│ ├── telemetry.py # Time-series telemetry data
│ ├── driver.py # Driver profiles & safety scores
│ ├── alert.py # Alert records (speeding, DTC, etc.)
│ ├── trip.py # Trip tracking (start/end, distance)
│ ├── maintenance.py # Maintenance records & scheduling
│ └── geofence.py # Virtual geographic boundaries
│
├── telematics/ # Vehicle communication modules
│ ├── obd_reader.py # OBD-II protocol (SAE J1979)
│ ├── gps_tracker.py # GPS/GNSS via NMEA 0183
│ ├── can_decoder.py # CAN bus frame decoding
│ ├── dtc_analyzer.py # Diagnostic Trouble Code analysis
│ └── alert_engine.py # Real-time alert evaluation
│
├── services/
│ └── tracking_service.py # Vehicle tracking orchestrator
│
├── api/ # FastAPI REST endpoints
│ ├── vehicles.py # Vehicle CRUD
│ ├── telemetry.py # Telemetry ingest & query
│ ├── alerts.py # Alert management
│ └── dashboard.py # Web dashboard
│
├── templates/
│ ├── dashboard.html # Fleet dashboard UI
│ └── fleet_map.html # Leaflet.js live fleet map
│
└── data/ # SQLite database (auto-created)
🚀 Quick Start
Choose your preferred deployment method:
Option A: Docker (Recommended for Production)
# Clone the repo
git clone https://github.com/santoshiimind/fleet-management-system.git
cd fleet-management-system
# Start production server
docker compose up -d
# Seed sample data
docker compose exec fleet-api python cli.py seed
# Start with simulator (demo mode)
docker compose --profile demo up -d
Option B: pip Install from PyPI
# Install as a Python package (live on PyPI!)
pip install fleet-management-system
# Seed sample data & start server
fleet-management seed
fleet-management run
# Or run in development mode with hot-reload
fleet-management run --dev
Option C: From Source
cd FLEETMANAGMENT
pip install -r requirements.txt
python main.py --seed
Open the Dashboard
- Dashboard: http://localhost:8000/
- API Docs: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
Run the Simulator (separate terminal)
python simulator.py
🐳 Docker Deployment
Production
# Build and start
docker compose up -d --build
# View logs
docker compose logs -f fleet-api
# Check health
docker compose ps
# Stop
docker compose down
Environment Configuration
Copy .env.production to .env and customize:
cp .env.production .env
Key settings:
| Variable | Default | Description |
|----------|---------|-------------|
| API_PORT | 8000 | Server port |
| API_SECRET_KEY | — | Change in production! |
| `GUNICO
Related Skills
python-debugpy
385.5kDebug Python with pdb, breakpoint(), post-mortem inspection, and debugpy remote attach.
skill-creator
385.5kCreate, edit, audit, tidy, validate, or restructure AgentSkills and SKILL.md files.
claude-opus-4-5-migration
140.7kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
automl-hyperparameter-optimization
40.5kAutoML and hyperparameter optimization rules for Python ML projects using Ray Tune, Optuna, PyCaret, and time-series AutoML libraries
