Telematics Hub
Kafka OBD-II Telematics Pipeline Open-Source for Insurance and Fleet Management
- Status
- WIP
- License
- AGPL-3.0
- Category
- Insurance coverage
- Updated
Project status
Description
Telematics Hub is an open-source platform for ingesting and analyzing telematics data from connected vehicles (OBD-II dongle, integrated telematics OEM, smartphone insurance app), designed for pay-per-use (PAYD/PHYD) insurance use cases and fleet management. The architecture uses event-driven Kafka Streams: devices publish MQTT events (GPS position, speed, acceleration, braking, RPM motor, fuel consumption, OBD-II error codes) to an MQTT gateway broker, which forwards them to structured Kafka topics. Kafka Streams calculates real-time aggregate metrics (driving score, harsh braking events, speeding events, daily distance, eco-driving score) and persists them in TimescaleDB for efficient time-series queries. The data model supports cross-OEM normalization (Tesla, Volkswagen Group, Stellantis, BMW, generic MQTT) via a pluggable adapter. Security is critical for sensitive data (vehicle position = driver position): TLS 1.3 encryption to the MQTT broker, device certificate-based authentication, optional GPS anonymization (configurable geohash precision, snap-to-route for privacy), GDPR consent management (explicit driver consent for sharing data with insurance). The analytics module offers: risk scoring based on driving behavior aggregates, fleet manager reporting (vehicle usage, driving hours, operational costs), real-time alerts (probable collision, eco-driving outside limits, predictive maintenance based on OBD-II codes). Licensed under AGPL-3.0 to protect the platform: any fork offering insurance/fleet services to third parties must open-source modifications. Deploy target: dual-purpose insurance (auto + fleet), MGA/intermediary insurers, fleet manager logistics, software house automotive. The philosophy is 'driver data sovereignty': data is not shared with OEM/dealers without explicit consent, and storage is on-premises for the client.
Key Features
MQTT Gateway + Kafka Pipeline
Broker for MQTT (Mosquitto/EMQX) for device ingestion, forward structured Kafka topics, throughput target 10k events/s per node (from benchmark).
Real-time Analytics with Kafka Streams
Harsh Braking Events, Speeding Events, Eco-Drive Score, Sliding Window: 5 min / 1 h / 24 h, State Store (RocksDB)
Time Series Database
Table for device data, compressed in chunks, configurable retention by event type, continuous aggregates for dashboards.
OBD-II + GPS for multiple OEMs
Plug adapter compatible with Tesla, VW Group, Stellantis, BMW, OBD-II generic, and smartphone insurance app SDK for Android and iOS.
Encryption (TLS 1.3) + Device Authentication
TLS 1.3 against MQTT broker, device certificate-based authentication, certificate pinning, automated rotation via internal PKI.
GDPR Consent Management
Explicit consent leading to data sharing, geohash precision configurable (4-12), optional snap-to-route, right to oblivion for the device.
Risk Scoring and Reporting
Algorithmic risk scoring for car insurance policy, fleet manager dashboard (usage, driving hours, costs), real-time collision and maintenance alerts.
API Integration with Original Equipment Manufacturer (OEM) is Optional
Connector for Tesla API, VW We Connect, Stellantis Connect (requires OEM partner credentials), falls back to generic OBD-II dongle.
Angular + Spring Boot on top of a PostgreSQL database hosted in the cloud via AWS or Google Cloud Platform
- Kafka Streams
- Spring Boot 3.4
- Java 21
- TimescaleDB
- MQTT (Mosquitto/EMQX)
- OBD-II
- Apache Kafka
- Docker Compose
- RocksDB
Use cases
- Auto insurance that offers pay-per-use (PAYD) or pay-how-you-drive (PHYD) policies with data-driven risk scoring.
- Fleet Manager Logistics with 50-500 vehicles to monitor usage, operational costs and eco-driving.
- MGA broker offering innovative insurance solutions to partners.
- Software house for automotive that integrates telematics into its own apps without relying on SaaS providers US
Road Map
- v0.1.0Scheduled
Core: MQTT, Kafka, and TimescaleDB
- MQTT Gateway with Certificate-Based Authentication
- Kafka producer + structured topic
- TimeScaleDB Hypertable and Ingestion Base
- OBD II Generic Script for Testing
- v0.5.0Scheduled
Analytics: Kafka Streams and Risk Scoring
- Kafka Streams performance score + error rate
- Risk scoring algorithm MVP
- Continuous aggregates on TimescaleDB
- Dashboard Fleet and Insurance Overview
- v1.0.0Scheduled
Multi-OEM compliant with GDPR for production deployment
- Tesla Adapter with VW Group and Stellantis
- GDPR Consent and Geohash Anonymization
- Predictive Maintenance from OBD-II Codes
- Documentation for MkDocs and Compliance Guide
Who is it for
Quick start
Start the project locally with four commands, requires Docker and GitHub Desktop is not required but a git client like SourceTree or Visual Studio Code's built-in one will do just fine though.
# Quick start (work-in-progress, repo non ancora pubblicato)
# git clone https://github.com/<tba>/telematics-hub.git
# cd telematics-hub
# docker compose up -d # mosquitto + kafka + timescale + telematics-hub
# # Pubblica evento test con mosquitto_pub o usa simulator scriptContribute to the project
Telematics Hub is open source. Open an issue, propose a pull request or leave a star on GitHub: every contribution, no matter how small, is welcome.
- ⭐ Leave a star if it's useful
- 🐛 Report bugs or suggest features via issue
- 🔧 Send a pull request with fixes or improvements
- 📣 Share the project if you find it interesting