How alanjsfleming/greenarrowsdashboard works
Project Type and Purpose
• This is a full-stack, real-time telemetry dashboard used for monitoring and analyzing sensor data from a car.
• The data originates at the eChook board (via a mobile app) and travels to dweet.io, from where it is fetched and processed.
• The system displays calculated metrics (like gear estimation, battery status, lap data) on a dashboard built with React, while using Firebase (hosting, functions, realtime database, or Firestore rules) as the backend.
Main Components
a. Frontend (Client-Side Web UI):
• Built in React (located in the “src” directory).
• Contains pages (e.g., HomePage, Login, Settings, etc.), components (e.g., Telemetry, LapSummary, DataVisualisation, Dashboard), layouts, contexts (for auth, settings, telemetry), and hooks.
• Manages local storage of settings and the dynamic display of telemetry data.
b. Backend (Firebase Components):
• Firebase Functions (code under “functions”): Custom backend logic (written in TypeScript, includes linting via .eslintrc.js) that might handle data processing, authentication coordination, or API endpoints.
• Firebase Configuration (firebase.json, .firebaserc, firestore.rules, and related index files) indicating hosting, security, and database configurations.
c. Database:
• The project uses Firebase’s Realtime Database (or Firestore as a backup) to store user data, car configurations, telemetry records, lap summaries, and settings.
• The README describes a database schema with a “users” node – where each user’s document contains their settings and associated car documents.
d. External Services:
• dweet.io: Serves as the telemetry data source; the JavaScript Fetch API retrieves JSON data from dweet.
• eChook Board: Although not part of the project code, it is the origin of sensor data.
Depicting Relationships and Data Flow
• Flow from external sensors (eChook board) → mobile phone (sending data via the eChook app) → dweet.io → the client application or Firebase Functions (which may merge new data with existing data).
• Firebase Hosting component that serves the static assets from the “public” folder.
Design Patterns and Technologies
• The project’s structure (separating “src” for UI and “functions” for server-side logic) indicates a clear separation of concerns consistent with modern full-stack practices.
• The usage of React contexts, hooks, and modular “features” folders reflects a component-based architecture.
• Firebase functions, database rules, and hosting configurations embody a serverless backend design.
• That the telemetry calculations are performed both client-side (through various utility modules and feature components) as well as possibly on the server through Firebase Functions.