← Back to panelCase file · ST-02
Live trucks and honest fuel numbers

VM Track

RoleMobile app + backend · team product
PeriodJul 2023 – now
Stack size10 parts
s to fall back when Redis is quiet

Vehicle tracking for government fleets. I built the Flutter app and the live-tracking backend, then the Teltonika gateway, the decoder and the fuel-event pipeline.

What was broken

Fleet supervisors need to see where trucks are right now, and whether fuel went into the tank or out of it. The GPS units speak binary Teltonika frames, and the fuel sensor is noisy enough to fake a theft.

What I built

  1. 01Flutter app with a live map, trip replay and OTP login, released on the Play Store.
  2. 02Live push from Redis pub/sub to WebSocket, with a database fallback when Redis goes quiet.
  3. 03A TCP gateway that receives Teltonika frames and puts them on Kafka, and a Codec 8 / 8E decoder on the other side.
  4. 04A fuel pipeline in six stages: calibration, spike rejection, smoothing, tilt correction, refill and theft events.
  5. 05A Python fleet simulator: N async vehicles sending CRC-checked Codec 8E packets with realistic noise, so nothing waits on hardware.
Teltonika codecs decoded
fuel-signal stages
fuel-analytics endpoints

How data moves

SCHEMATIC · VM TRACK● SIGNAL
FMB920Codec 8E · TCPKafkaraw framesDecoderdecode · cleanFuel pipelinerefill · theftRedislive stateMobile APIWebSocket · DB fallbackFlutter applive map · replay

What broke, and how it holds now

INCIDENTST-02 · what broke

Redis went quiet and the map froze.

The live map got every position from Redis pub/sub. When Redis stopped publishing, the app kept its socket open and showed nothing new. I put a health monitor on the subscription. When it goes silent, a scheduler reads the latest positions from the database every 3 seconds and pushes them down the same WebSocket. When Redis is back, a cool-off stops the two from double-sending.

Replay · break it yourself
Fleet · live map · 10 trucks● REDIS PUBLISHING
Map fed byRedis
Oldest dot on map0.0 s
Redis silent for0.0 s

Solid dots are the supervisor's map; faint rings are where the trucks really are. Silence Redis with the fallback off and the map freezes while the trucks keep driving. With it on, the monitor notices after 3 seconds and the database keeps the map moving.

What people see

Stack

  • Flutter
  • Riverpod
  • Google Maps
  • Spring Boot
  • WebSocket
  • Redis
  • Kafka
  • PostgreSQL
  • Python
  • Teltonika Codec 8/8E
Next case file · ST-03E-LAB →Lab fees paid once, reports found fast