End-to-End System Architecture
📌 What is this for? (Quick Summary for New Interns)​
In Simple Words:
This page shows the big picture of how all the pieces connect.
If someone asks: "How does the speed number on my laptop screen actually get there from the vehicle?" — this page explains that journey:
- Physical sensors on the vehicle measure speed, battery voltage, and temperatures.
- A Raspberry Pi on the vehicle collects these numbers and sends them over cellular or Wi-Fi to AWS cloud servers.
- Cloud databases store the numbers.
- Your web browser requests the latest numbers every second and displays them on dials and in an interactive 3D simulation.
1. Multi-Tier Architecture Diagram​
graph TB
subgraph Trackside["1. Physical Vehicle on Track"]
Sensors["CAN Sensor Nodes\n• Speed & Accel\n• Battery Temperatures (4 cells)\n• Inverter 3-Phase Temperatures\n• LIM Temperature\n• Main Contactor Status"]
CAM["Dual IP Cameras\n• CAM 1: Forward Track\n• CAM 2: Rear Cabin / Dock"]
RPi["Raspberry Pi 5 Gateway / EC2 Testbed\n• go_server (:20006)\n• emulator (600m Run)\n• stream_service (RTSP Forwarder)"]
end
subgraph Transport["2. Wireless Transport"]
MQTT_Line["AWS IoT Core MQTT (tutr/telemetry)"]
Influx_Line["HTTPS Line Protocol (influxdb.tutr.tech)"]
RTSP_Line["RTSP TCP Streams (:8554/cam1, :8554/cam2)"]
end
subgraph Cloud["3. AWS Cloud Servers (ap-south-1 Mumbai)"]
MediaMTX["MediaMTX Live Video Server\n• RTSP Listener: :8554\n• WebRTC Engine: :8889\n• HLS Muxer: :8888"]
InfluxCloud["InfluxDB Cloud\n• Bucket: telemetry\n• Metric Retention: 30 days"]
IoTCore["AWS IoT Core Broker\n• Topic: tutr/control\n• Topic: tutr/telemetry"]
Cognito["AWS Cognito Login\n• Pool: ap-south-1_IXNCZVwj4\n• Client: 5eup0104notrn3fn4415u3fq3b"]
APIGateway["AWS API Gateway v2 HTTP API\n• ID: npig3gpgck\n• Route: POST /api\n• JWT Authorizer: CognitoAuth"]
Lambda["PodDashboardRouter (Node.js 20)\n• Influx Flux Query Pipeline\n• DynamoDB Session Bouncer\n• AWS IoT Control Publisher"]
Dynamo["DynamoDB Tables\n• PodOperations (Audit Logs)\n• ActiveSessions (Single-Login Tracker)"]
end
subgraph Clients["4. Operator Web Dashboards"]
Dash2D["2D Operations Dashboard (dashboard.tutr.tech)\n• React 19 + Lucide + Tailwind\n• Closed-loop Contactor Verification\n• Emergency Radio Voice Alarms"]
Twin3D["3D Simulation Dashboard (ThreeJsForDemoPurpose)\n• React Three Fiber + 600m Track Model\n• Smooth 60 FPS Motion\n• WebRTC Glassmorphic CAM 1 PiP"]
end
Sensors -->|Binary CAN Frames 0x16..0x21| RPi
CAM -->|RTSP 554| RPi
RPi --> MQTT_Line --> IoTCore
RPi --> Influx_Line --> InfluxCloud
RPi --> RTSP_Line --> MediaMTX
MediaMTX -->|WebRTC :8889| Dash2D
MediaMTX -->|WebRTC :8889| Twin3D
Cognito -->|ID Token (JWT)| Dash2D
Cognito -->|ID Token (JWT)| Twin3D
Dash2D <-->|POST /api with Bearer Token| APIGateway
Twin3D <-->|POST /api with Bearer Token| APIGateway
APIGateway --> Lambda
Lambda <--> InfluxCloud
Lambda <--> Dynamo
Lambda --> IoTCore
2. The 3 Data Pipelines Explained​
2.1 Sensor Numbers Pipeline (Every 1 Second)​
- Sensors broadcast: Sensors on the vehicle broadcast their measurements 10 times a second over the vehicle's internal CAN network wires.
- Raspberry Pi ingests: A program called
go_serverreads these raw bytes on port20006, converts them into normal numbers (like 364 Volts or 45 km/h), and uploads them. - Cloud stores: The numbers are saved in InfluxDB Cloud (a time-series database designed for sensor charts).
- Dashboard displays: The web dashboard asks our AWS API Gateway for the newest numbers once a second, updating the gauges and the 3D position.
2.2 Operator Control Pipeline (Instant Action)​
- Operator clicks a button: The operator clicks Enable Battery or Launch Pod.
- Permission check: The dashboard verifies that the logged-in user is an Admin or Engineer (managers have view-only rights).
- AWS IoT command: A lightweight command is sent through AWS IoT Core down to the vehicle within 200 milliseconds.
- Physical switch engages: The vehicle's main battery switch closes, turning on 364V power.
- Voltage confirmation: The dashboard waits to physically see the battery voltage read above 48 Volts before enabling the Launch button.
2.3 Live Camera Pipeline (Under 1 Second Delay)​
- Two IP cameras on the vehicle point forward down the track (CAM 1) and backwards into the dock (CAM 2).
- The
stream_serviceprogram optimizes the video feed so that keyframes are sent every second with zero buffering delays. - MediaMTX converts the stream to WebRTC so web browsers can play it immediately with zero plugins.
3. Network Ports & Firewall Rules​
| Service | Protocol | Port | Who Connects | What It Is Used For |
|---|---|---|---|---|
| Go Gateway Server | TCP | 20006 | Vehicle sensors / Simulator | Ingestion of raw CAN sensor packets |
| Emulator Web UI | HTTP | 5001 | Engineers | Local test control panel to start simulated runs |
| MediaMTX RTSP | TCP | 8554 | Pod Camera Forwarder | Ingestion of video from the vehicle |
| MediaMTX WebRTC | HTTP/HTTPS | 8889 | Web Browsers | Ultra-fast video playback in your browser |
| MediaMTX Media | UDP | 8189 | Web Browsers | Video data packets |
| AWS API Gateway | HTTPS | 443 | Web Browsers | Main backend REST API (POST /api) |
| InfluxDB Cloud | HTTPS | 443 | Gateway & Lambda | Storing and querying historical sensor numbers |