$ show slowlydev/f1-dash
f1-dash is a real-time Formula 1 telemetry and timing dashboard. It consists of a Rust backend that connects to the official F1 live timing SignalR endpoint, ingests data (timing, car metrics, positions, weather, race control messages, team radios), and streams it via Server-Sent Events (SSE) to a Next.js frontend. The frontend displays a leaderboard, track map with driver positions, weather complications, race control messages, team radios, and a schedule page. It supports a delay feature to sync with TV broadcasts. The architecture is multi-service: a realtime service handles the SignalR connection and SSE, an API service provides schedule data from an iCal feed, and the dashboard is a standalone Next.js app. The codebase is well-organized with reusable Rust libraries (SignalR client, state service) and frontend utilities (deep merge, inflate, buffer for delayed playback, map rendering). It demonstrates strong engineering practices, though the project is currently in maintenance mode with the author focusing on other projects.
The LLM identified 6 files worth highlighting for reuse:
A reusable SignalR client library that handles negotiation, WebSocket connection, topic subscription, and message streaming. It supports both parsed and raw message streams. This component is self-contained and can be extracted for any project needing to connect to a SignalR hub, demonstrating non-obvious skill in handling the SignalR protocol and WebSocket management.
A generic deep merge utility that recursively merges partial updates into a base object, handling both objects and arrays (with index-based updates). It is used by the stateful buffer to accumulate real-time state. This function is self-contained and reusable in any TypeScript project requiring partial state updates.
A utility to decompress raw deflated data (base64-encoded) using pako's inflateRaw. It is used to decode F1's compressed car data and position data. This function is self-contained and can be reused in any project that receives deflated JSON payloads.
A generic buffer hook that stores time-stamped frames and provides methods to retrieve the latest frame or a frame at a specific delayed time using binary search. It also includes cleanup logic to remove old frames. This hook is reusable for any real-time data stream that needs delay/sync functionality.
A set of utilities for creating and rendering a Formula 1 track map from circuit data. It includes functions for rotating points, calculating distances, creating sectors from marshal sector positions, finding yellow sectors from race control messages, and prioritizing sector colors. These utilities are self-contained and can be reused for any track map visualization.
A reusable SVG gauge component that displays a value on a semi-circular arc with a gradient. It uses polar-to-cartesian math to position the indicator dot. This component is self-contained and can be extracted for any dashboard or instrumentation UI.