← Portfolio/Case StudyLIVE IN PRODUCTION

eLogistics — EV Fleet Telematics

A production Laravel 10 telematics platform for a 37-vehicle Tata Xpres-T EV fleet. It ingests live vehicle data from the Tata CVP API every minute, tracks charging sessions, fires real-time alerts, and serves a mobile app for admins and vendors — architected, built, and operated solo, end to end, for an EV fleet operator.

Laravel 10PHPMySQLQueue WorkersLaravel SchedulerSanctum AuthTata CVP APIApache / FASTPANELSupervisor
~70%

fewer DB queries per sync cycle — from ~1,500+ down to ~440 per 100 vehicles

99% → normal

MySQL CPU saturation eliminated under production load

1.16M+

rows of telemetry served with purpose-built covering indexes

every 60s

live ingestion across a 37-vehicle EV fleet, zero-downtime

The engineering story

MySQL was pinned at 99% CPU.
Here's what was actually wrong.

Under load the database was saturating at 99% CPU. It wasn't one bug — it was a compounding set of them. Diagnosing and fixing each took the per-cycle query load from ~1,500+ (spiking to ~4,500 with stacked processes) down to ~440 queries per 100 vehicles.

01

Stacked sync processes (root cause)

Slow API days let one minute's sync start before the previous finished, stacking processes on top of each other. A race condition in that overlap had generated 400k+ duplicate telemetry rows. Added overlap-guarding so a cycle can never begin while the previous one is still running.

02

N+1 alert-cooldown lookups

The alerting engine ran 8–9 separate cooldown queries per vehicle per minute. Replaced the whole set with a single batched GROUP BY query per chunk of vehicles.

03

Per-vehicle ignition existence checks

A 'recent ignition' existence check ran once per vehicle. Collapsed into one batched DISTINCT query across the chunk.

04

Missing covering indexes

Distance-analytics and GPS-playback queries were hitting the heap on a 1M+ row table. Added covering indexes so those hot paths are served entirely from the index.

05

Silent auth-token expiry

A cached static API token persisted across queue jobs. Once it expired, every sync silently wrote nothing — no error, no data. Scoped the token per job and made 401s throw and retry, turning a silent failure into a loud, recoverable one.

06

UTC / IST timezone drift

A UTC vs. IST mismatch silently widened a 2-hour alert window into a 7.5-hour one. Normalized timezone handling across the alert-window math.

Architecture

How the system is wired.

Scheduler

dispatches every 60s (ms-fast)

Queue

chunks of 10 vehicles

Workers

parallel API pull + DB write

Telemetry

1.16M+ rows, covering indexes

Alerts + API

cooldowns · Sanctum · reports

01

Minute-by-minute sync pipeline

A scheduler dispatches queue jobs, each processing a chunk of 10 vehicles in parallel across multiple workers. The dispatch step completes in milliseconds — all API calls and DB writes happen inside the workers, never on the scheduler tick.

02

1.16M-row telemetry store

Purpose-built covering indexes for distance analytics and GPS-trail playback, so read-heavy dashboards never touch the heap.

03

Real-time alerting engine

Per-type cooldowns for speed, geofence violation, HV-battery critical, hub/depot compliance, service-due, km-limit, seatbelt, and hard-braking events.

04

Careful signal parsing

Decoded against the Tata CVP data dictionary — handling inverted booleans and 'unknown' sentinel values that would otherwise poison analytics.

05

30+ endpoint mobile REST API

Sanctum token auth with role-based data scoping — admins and vendors see strictly their own slice of the fleet.

06

Automated email reporting

Scheduled daily, weekly, and monthly reports generated and delivered without manual intervention.

Screens

Dashboard & mobile.

eLogistics web dashboard — fleet KPIs, daily distance, fleet status, battery SoC and charging sessions
Fleet dashboard — live KPIs, 7-day distance, fleet status, battery SoC & charging sessions.
eLogistics mobile app home screen — fleet summary, daily distance and charging charts
Mobile app — admin home with fleet summary and live charts.

Need a system that holds up under load?

Real-time ingestion, heavy analytics, production Laravel — the kind of work above is exactly what we do.