Skip to content

Ashborn-047/silverwall

Repository files navigation

SilverWall 🏎️

Important

UNDER MAINTENANCE: SilverWall is currently undergoing a major architectural pivot. We are migrating from the legacy Python/Supabase stack to a Full TypeScript + SpacetimeDB architecture to resolve 2026 season parity issues and enhance real-time performance.

Note

MIGRATION STATUS: The backend telemetry engine, Track Geometry, Season Races, and Championship Standings have been successfully migrated to SpacetimeDB and fully integrated into the frontend. The migration is complete and available for review on the feat/spacetime-standings-migration branch before being merged into main.

πŸš€ Next-Gen Architecture (SpacetimeDB)

graph TD
    A[OpenF1 API] -->|Telemetry & Standings| I[TS Ingestor Worker]
    I -->|Low Latency Push| S[(SpacetimeDB Core)]
    C[Clerk Auth] -->|Authenticate SDK| F[React Frontend]
    S <-->|Direct Multiplexed Sync| F
    S <-->|Slash Commands| B[Discord Bot Service]
    U[Discord User] <-->|Interactions| B
Loading

Engineering-Grade F1 Telemetry Dashboard

SilverWall is transitioning to a SpacetimeDB-powered reactive engine. It provides ultra-low latency F1 telemetry, session tracking, and historical data with zero polling overhead.


SilverWall Autonomous Supabase React FastAPI TypeScript


⚑ Autonomous Features

🧠 Year-Agnostic Intelligence

The backend dynamically identifies the "Active Season" based on Supabase data. As soon as you seed a new season, the entire app transitionsβ€”no code changes required.

🏁 Automated Data Lifecycle

  • Dynamic Results: The /api/results endpoint is 100% database-drivenβ€”no more hardcoded placeholders.
  • Standings Sync: Automated pipelines fetch official positions and update championship standings.
  • Track Learning: Autonomously captures and saves new circuit geometry during live sessions.

πŸ’“ Sentinel Monitoring & Interaction

SilverWall features a dual-layer Discord integration:

  1. Automation (Webhooks):

    • silverwall_automation.yml triggers every 3 days.
    • Posts a rich, automated report to your designated channel.
    • Includes health status, leaderboard, and next race countdown.
  2. Interaction (Slash Commands):

    • /status: Check system health & next race.
    • /standings [year]: Get live or historical championship standings.
    • /results: Get detailed podium results of the last completed race.
    • /champions: See world champions of the latest completed season.
    • /next: Get countdown and location for the upcoming Grand Prix.

πŸ“ Project Structure

silverwall/
β”œβ”€β”€ πŸ“‚ backend/                     # FastAPI Python Backend
β”‚   β”œβ”€β”€ main.py                     # FastAPI app entry point with CORS
β”‚   β”œβ”€β”€ database.py                 # Supabase client initialization
β”‚   β”œβ”€β”€ models.py                   # Pydantic models for API responses
β”‚   β”œβ”€β”€ requirements.txt            # Python dependencies
β”‚   β”œβ”€β”€ vercel.json                 # Vercel serverless deployment config
β”‚   β”œβ”€β”€ Procfile                    # Railway/Heroku deployment
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ routes/                  # API Endpoint Handlers
β”‚   β”‚   β”œβ”€β”€ status.py               # /api/status - Race status & countdown
β”‚   β”‚   β”œβ”€β”€ standings.py            # /api/standings/* & /api/champions
β”‚   β”‚   β”œβ”€β”€ track.py                # /api/track/{circuit} - SVG geometry
β”‚   β”‚   β”œβ”€β”€ results.py              # /api/results & /api/season/races
β”‚   β”‚   β”œβ”€β”€ discord.py              # /api/discord/interactions - Bot handlers
β”‚   β”‚   β”œβ”€β”€ commentary.py           # /api/commentary - AI race commentary
β”‚   β”‚   └── radio.py                # /api/radio - Team radio messages
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ migrations/              # Supabase SQL Migrations (Consolidated)
β”‚   β”‚   β”œβ”€β”€ 001_create_tables.sql   # Core schema (seasons, races, standings)
β”‚   β”‚   β”œβ”€β”€ 002_historical_2024.sql # Complete 2024 season data
β”‚   β”‚   β”œβ”€β”€ 003_historical_2025.sql # Complete 2025 season data
β”‚   β”‚   β”œβ”€β”€ 004_seed_2026_season.sql # 2026 season opener kickoff
β”‚   β”‚   └── 005_seed_tracks.sql     # Bootstrap track geometry maps
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ pipeline/                # Automation Scripts
β”‚   β”‚   β”œβ”€β”€ seed_tracks.py          # Seed track geometry to Supabase
β”‚   β”‚   β”œβ”€β”€ ingest_results.py       # Fetch & store race results from OpenF1
β”‚   β”‚   β”œβ”€β”€ health_keepalive.py     # Supabase keepalive + Discord alerts
β”‚   β”‚   β”œβ”€β”€ register_commands.py    # Register Discord Slash Commands
β”‚   β”‚   └── fake_monza_timeline.py  # Test timeline generator
β”‚   β”‚
β”‚   β”œβ”€β”€ πŸ“‚ websocket/               # WebSocket Handlers
β”‚   β”‚   └── telemetry_ws.py         # Real-time telemetry streaming
β”‚   β”‚
β”‚   β”œβ”€β”€ openf1_fetcher.py           # OpenF1 API client
β”‚   └── gemini_fetcher.py           # Gemini AI integration for commentary
β”‚
β”œβ”€β”€ πŸ“‚ Silverwall UIUX design system/  # React Frontend (Vite + TypeScript)
β”‚   β”œβ”€β”€ index.html                  # HTML entry point
β”‚   β”œβ”€β”€ vite.config.ts              # Vite configuration
β”‚   β”œβ”€β”€ tailwind.config.js          # Tailwind CSS configuration
β”‚   β”œβ”€β”€ package.json                # NPM dependencies
β”‚   β”‚
β”‚   └── πŸ“‚ src/
β”‚       β”œβ”€β”€ main.tsx                # React entry point
β”‚       β”œβ”€β”€ App.tsx                 # Router configuration
β”‚       β”‚
β”‚       β”œβ”€β”€ πŸ“‚ pages/               # Route Pages
β”‚       β”‚   β”œβ”€β”€ Landing.tsx         # Home page with race card & countdown
β”‚       β”‚   β”œβ”€β”€ TelemetryLive.tsx   # Live telemetry pit-wall dashboard
β”‚       β”‚   └── DesignSystem.tsx    # Component library showcase
β”‚       β”‚
β”‚       β”œβ”€β”€ πŸ“‚ components/          # Reusable UI Components
β”‚       β”‚   β”œβ”€β”€ ResultsModal.tsx    # Season results modal (standings, races)
β”‚       β”‚   β”œβ”€β”€ CountdownOverlay.tsx # Race countdown overlay
β”‚       β”‚   β”œβ”€β”€ SeasonCountdown.tsx # Off-season countdown display
β”‚       β”‚   └── CommentaryPanel.tsx # AI-generated race commentary
β”‚       β”‚
β”‚       β”œβ”€β”€ πŸ“‚ hooks/               # Custom React Hooks
β”‚       β”‚   β”œβ”€β”€ useRaceStatus.ts    # Fetches race status from /api/status
β”‚       β”‚   β”œβ”€β”€ useChampions.ts     # Fetches champions from /api/champions
β”‚       β”‚   β”œβ”€β”€ useStandings.ts     # Fetches standings from /api/standings
β”‚       β”‚   β”œβ”€β”€ useTrack.ts         # Fetches track SVG from /api/track
β”‚       β”‚   └── useTelemetry.ts     # WebSocket telemetry hook
β”‚       β”‚
β”‚       └── πŸ“‚ styles/              # Global Styles
β”‚           └── index.css           # Tailwind imports & custom styles
β”‚
β”œβ”€β”€ πŸ“‚ .github/
β”‚   └── πŸ“‚ workflows/
β”‚       β”œβ”€β”€ deploy-pages.yml        # Frontend deployment
β”‚       └── silverwall_automation.yml # Automated health check task
β”‚
β”œβ”€β”€ πŸ“‚ docs/                        # Documentation
β”‚   β”œβ”€β”€ API.md                      # API endpoint documentation
β”‚   └── ARCHITECTURE.md             # System architecture details
β”‚
β”œβ”€β”€ README.md                       # This file
β”œβ”€β”€ CHANGELOG.md                    # Version history
β”œβ”€β”€ DEPLOYMENT.md                   # Deployment instructions
β”œβ”€β”€ Dockerfile                      # Container deployment
└── railway.json                    # Railway deployment config

πŸ—οΈ Architecture

graph TD
    A[OpenF1 API] -->|Live Telemetry| B[FastAPI Backend]
    S[(Supabase DB)] <-->|Schedules/Standings/Tracks| B
    B -->|REST API| F[React Frontend]
    B -->|WebSocket| F
    G[GitHub Actions] -->|Trigger| H[Health Sentinel]
    H -->|Ping| S
    H -->|Report| D1[Discord Webhook]
    U[Discord User] <-->|Slash Commands| B
    B <-->|Interactions| D2[Discord Bot]
Loading

πŸ—„οΈ Database Schema

Table Description
seasons Year, champion driver/constructor
races Race schedule (date, circuit, status)
race_results P1-P10 results for each race
driver_standings Points, wins, position per driver
constructor_standings Team championship standings
tracks Circuit geometry (SVG path data)

πŸš€ Quick Start

1. Database Setup

SilverWall uses an idempotent "Delete-then-Insert" migration strategy. This means you can run these scripts multiple times to reset your data to a clean state without hitting unique constraint errors.

Run the migrations in the following order in your Supabase SQL Editor:

  1. 001_create_tables.sql: Core schema (tables & constraints).
  2. 002_historical_2024.sql: Full 2024 archive (Standings & Podium Results).
  3. 003_historical_2025.sql: Full 2025 archive (Standings & Official Results).
  4. 004_seed_2026_season.sql: 2026 Season Kickoff (Upcoming events).
  5. 005_seed_tracks.sql: Bootstrap Track Maps (Geometry data).

2. Environment Variables

Create backend/env/.env.supabase:

SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_KEY=your-service-role-key
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/...

Create Silverwall UIUX design system/.env:

VITE_API_URL=http://localhost:8000

3. Run Locally

Backend:

cd backend
pip install -r requirements.txt
python -m uvicorn main:app --reload --port 8000

Frontend:

cd "Silverwall UIUX design system"
npm install
npm run dev -- --port 3000

πŸ”Œ API Endpoints

Endpoint Method Description
/api/status GET Race status, countdown, next event
/api/champions GET Current season champions
/api/standings/drivers/{year} GET Driver championship standings
/api/standings/constructors/{year} GET Constructor standings
/api/season/races/{year} GET Race schedule with podium results
/api/track/{circuit} GET Track SVG geometry
/api/results GET Latest race results
/api/discord/interactions POST Discord Bot slash command gateway

πŸ” GitHub Secrets

Secret Description
SUPABASE_URL Your Supabase Project API URL
SUPABASE_SERVICE_KEY Service Role Key (write access)
DISCORD_WEBHOOK_URL Discord health channel webhook
DISCORD_APP_ID Discord Bot Application ID
DISCORD_PUBLIC_KEY Discord Bot Public Key
DISCORD_BOT_TOKEN Discord Bot Auth Token

πŸš€ Deployment

Platform Config File
Vercel backend/vercel.json
Railway railway.json
Docker Dockerfile

πŸ“… Roadmap

  • Autonomous Season Transitions
  • Dynamic Track Map Learning
  • Automated Standings Ingestion
  • Off-Season Countdown Display
  • Two-Way Discord Interaction Engine
  • AI-Powered Race Strategy Predictions
  • Multi-Driver Multi-View Layout
  • Lap Time Comparison Charts

πŸ› οΈ Tech Stack

Layer Technology
Frontend React 18, TypeScript, Vite, Tailwind CSS
Backend Python, FastAPI, Pydantic
Database Supabase (PostgreSQL)
Real-time WebSocket, OpenF1 API
AI Google Gemini (Commentary)
CI/CD GitHub Actions

πŸ“„ License

MIT License | Built with passion for F1 Engineering.


🏎️ SilverWall β€” Where Data Meets the Track

About

🏎️ Live F1 telemetry dashboard featuring real-time car tracking on circuit maps, leaderboard updates, and driver data visualization. React + FastAPI frontend/backend with OpenF1 API integration. Includes demo mode with simulated race data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors