Overview
The Tracking Backend is a FastAPI-based service that provides real-time vehicle, trailer, and driver tracking for the Hemut Transportation Management System (TMS).Key Capabilities
- Real-time Location Tracking: Poll and stream vehicle, trailer, and driver locations via Server-Sent Events (SSE)
- Movement Management: Sync and query shipment movements from McLeod TMS
- Driver Management: Track driver locations, HOS (Hours of Service), and profiles
- Tractor Operations: Manage tractor-to-vehicle mappings and fault codes
- AI Chat Interface: Natural language queries powered by Google Gemini
Base URL
Authentication
Most endpoints require authentication via API keys passed in headers. Contact your administrator for API credentials.Data Flow Architecture
The backend integrates with multiple external systems:| System | Purpose |
|---|---|
| Terminal API | ELD provider aggregation (Motive, Samsara, Geotab) for vehicle/trailer/driver locations |
| McLeod TMS API | Movement and driver data synchronization |
| Motive API | Fault code retrieval for tractors |
| Mapbox API | ETA calculations with traffic data |
| Google Gemini | AI-powered natural language chat |
Response Format
All endpoints return JSON responses. Successful responses typically include:Real-time Updates (SSE)
For real-time data, use the SSE (Server-Sent Events) endpoints:/stream/locations- Vehicle locations/api/drivers/stream- Driver updates/api/trailers/stream- Trailer locations

