Skip to content

Example end-to-end vehicle tracking demo using Docker: - Mosquitto (MQTT) for telemetry ingestion - Redis for storage and pub/sub - Node.js backend (Express + Socket.IO) - Nginx-served frontend that shows vehicles live

Notifications You must be signed in to change notification settings

muhammetaydinn/vehicle-tracking-redis-mqtt-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vehicle Tracking (Dockerized)

Example end-to-end vehicle tracking demo using Docker:

  • Mosquitto (MQTT) for telemetry ingestion
  • Redis for storage and pub/sub
  • Node.js backend (Express + Socket.IO)
  • Nginx-served frontend that shows vehicles live

Quick start

  1. Start services
docker compose up -d --build
  1. Open the UI
http://localhost:3001
  1. Publish sample telemetry
docker exec vehicle-tracking-mosquitto-1 \
  mosquitto_pub -t "vehicle/001/location" \
  -m '{"lat":41.0082,"lng":28.9784,"speed":45,"battery":85}'

Live random publisher (optional)

Continuously publish random telemetry for a few vehicles:

python3 - <<'PY'
import json, random, subprocess, time
vehicles = [f"{i:03}" for i in range(1,7)]
while True:
  ts = int(time.time()*1000)
  for vid in vehicles:
    payload = json.dumps({
      "lat": 41.0 + random.uniform(-0.01, 0.01),
      "lng": 28.97 + random.uniform(-0.01, 0.01),
      "speed": random.randint(10, 90),
      "battery": random.randint(30, 100),
      "timestamp": ts
    })
    subprocess.run([
      "docker","exec","vehicle-tracking-mosquitto-1","mosquitto_pub",
      "-t", f"vehicle/{vid}/location","-m", payload
    ], check=True)
  time.sleep(1)
PY

Endpoints and ports

Notes

  • Backend logs will show messages like: Vehicle 001: <lat>, <lng>.
  • Frontend automatically updates via Socket.IO on telemetry.

About

Example end-to-end vehicle tracking demo using Docker: - Mosquitto (MQTT) for telemetry ingestion - Redis for storage and pub/sub - Node.js backend (Express + Socket.IO) - Nginx-served frontend that shows vehicles live

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published