PolyTrack is a high-performance, real-time microtransit telemetry ecosystem. It provides a robust pipeline for tracking vehicle and device locations with sub-second latency, combining physical hardware tracking (Arduino/SIM7000A) with a high-fidelity web-based dashboard and AI-driven insights.
[!NOTE]
**Live Site:**https://main.d3717ef36oy0d4.amplifyapp.com/dashboard/
Video DEMOs:
Untitled.design.3.1.mp4
Polytrack-DEMO.1.mp4
untitled_BaI4fAZH.mp4
- Sub-Second Latency: Real-time position updates using WebSockets (FastAPI + React).
- Hybrid Tracking: Support for both physical IoT hardware (SIM7000A) and browser-based simulators.
- Spatial Intelligence: Built on PostGIS for native geographical math (distance, routing, geofencing).
- Resilient Ingestion: Store-and-forward caching logic ensures no data is lost during cellular dropouts.
- AI-Powered Insights: Integrated chat assistant (AWS Bedrock / Ollama) for fleet data analysis.
- Smooth Interpolation: Custom "Dead Reckoning" logic in the frontend for fluid marker movement.
graph TD
subgraph "Edge / Hardware"
A[Arduino Uno + SIM7000A] -- "Raw TCP (HTTP/1.1)" --> B
S[Web Simulator] -- "HTTPS / JSON" --> B
end
subgraph "Cloud Infrastructure (AWS EC2)"
B[Caddy Reverse Proxy] -- "Port 80/443" --> C[FastAPI Backend]
C -- "SQL / Spatial" --> D[(PostGIS DB)]
C -- "Pub/Sub" --> E[MQTT Broker]
C -- "Real-time Push" --> F[WebSocket Gateway]
C -- "Inference" --> G[AI Engine / Bedrock]
end
subgraph "Client Dashboard"
F -- "Live Stream" --> H[React Dashboard]
H -- "Route Mapping" --> I[Leaflet / OSRM]
end
The project uses a custom-built telemetry node optimized for low-power, long-range cellular tracking.
- Microcontroller: Arduino Uno (or compatible)
- Cellular Shield: SIM7000A (LTE-M / NB-IoT)
- Antenna: QGP GPS Antenna + LTE Blade Antenna
- Connectivity: SIM card with APN configured (default:
wireless.dish.com)
Hardware code is located in /hardware/PolyTrackNode.
- Communication: Uses AT commands over
SoftwareSerial(Pins 10 TX, 11 RX). - Protocol: To bypass SSL overhead on the Arduino, the node uses raw TCP sockets to construct HTTP/1.1 POST requests directly to the server's IP.
PolyTrack is designed for production-grade reliability on AWS.
- Host: AWS EC2
g4dn.xlarge(Selected for NVIDIA T4 GPU acceleration for local AI). - DNS: Managed via DuckDNS for dynamic IP resolution.
- Proxy: Caddy handles SSL termination for the web dashboard while allowing raw HTTP traffic on Port 80 for legacy hardware nodes.
We use Docker Compose to orchestrate the microservices:
- FastAPI: The core logic engine.
- PostGIS: Geographic database.
- Mosquitto: MQTT broker for message queuing.
- Ollama: Local LLM runner (GPU-accelerated).
- Caddy: The gateway.
# Production Deployment
cd .deploy
docker compose -f docker-compose.prod.yml up -d- Docker & Docker Compose
- Node.js (v18+)
- Copy
.env.exampleto.env. - Start services:
docker compose up -d --build
- Run migrations:
docker compose exec api alembic upgrade head
- Navigate to
/frontend. - Install & Run:
npm install npm run dev
| Layer | Technology |
|---|---|
| Backend | FastAPI, Python 3.11 |
| Database | PostgreSQL + PostGIS |
| Real-time | WebSockets, MQTT |
| Frontend | React, React-Router, Tailwind CSS |
| Mapping | Leaflet, OSRM, Nominatim |
| Hardware | C++, Arduino, SIMCom AT Commands |
| AI | Amazon Bedrock / Ollama (Phi-3) |
This project is licensed under the MIT License - see the LICENSE file for details.