How mohcinch/smart-gps works
VTrack is an IoT vehicle-tracking and safety platform. Its main flow is a vehicle tracker sending authenticated VTP frames to the TCP gateway, which persists data and fans live updates to Redis; background workers process trips, geofences, behavior and alerts, while users access tracking and management through the REST and WebSocket APIs. The repository also includes self-hosted map tiles and supporting product services. README capabilities inform unsampled subsystem nodes; the supplied tree has no Flutter application source, so app internals are not mapped.
Main entry points: worker Worker jobs · httpapi REST API · server.go VTP gateway · engine.go Trip engine
Components 22
Device ingest
- VTP gateway
server/internal/ingest/server.go - VTP protocol
server/internal/vtp - Device keys
server/internal/devkeys - Ingest outbox
server/internal/outbox/outbox.go
Fleet processing
- Worker jobs
server/internal/worker - Trip engine
server/internal/trips/engine.go - Geofence engine
server/internal/geofence/engine.go - Driving behavior
server/internal/behaviour/behaviour.go - Alerts and theft
server/internal/alerts - Reports and billing
server/internal/reports - Notification delivery
server/internal/notify - Anti-theft safeguards
server/internal/antitheft/antitheft.go
User services
- REST API
server/internal/httpapi - Authentication
server/internal/auth - Commands and OTA
server/internal/commands - WebSocket feed
server/internal/ws - Map tile service
server/internal/tiles/server.go
Platform services
- PostgreSQL
- Redis
Other components
- Vehicle tracker
- Vehicle owner
- Flutter app
Connections 27
- Vehicle tracker → VTP gateway: sends frames
- VTP gateway → VTP protocol: decodes frames
- VTP gateway → Device keys: authenticates device
- VTP gateway → PostgreSQL: persists data
- VTP gateway → Redis: fans out live data
- VTP gateway → Ingest outbox: queues processing
- Worker jobs → Ingest outbox: processes queued data
- Worker jobs → PostgreSQL: reads and writes
- Worker jobs → Redis: coordinates jobs
- Worker jobs → Trip engine: updates trips
- Worker jobs → Geofence engine: evaluates positions
- Trip engine → Driving behavior: scores trips
- Worker jobs → Alerts and theft: processes alerts
- Worker jobs → Anti-theft safeguards: checks theft signals
- Worker jobs → Reports and billing: runs report jobs
- Worker jobs → Notification delivery: delivers notices
- Vehicle owner → Flutter app: uses
- Flutter app → REST API: requests tracking
- REST API → Authentication: authenticates requests
- REST API → PostgreSQL: reads and writes
- REST API → Redis: uses shared state
- REST API → Commands and OTA: creates device commands
- REST API → Reports and billing: starts report exports
- REST API → Notification delivery: sends account notices
- Flutter app → WebSocket feed: subscribes to updates
- WebSocket feed → Redis: receives live events
- Flutter app → Map tile service: requests map tiles