PromptWars: Championship Edition | Next-Gen Race Control System
An AI-powered, real-time digital twin for F1 Grand Prix crowd management and fan zone logistics. Features team-based theme injection, interactive circuit topology, scenario-driven AI commands, and live telemetry analytics.
STRATX COMMAND is a competition-grade race control dashboard built for managing 10,000+ competitive entries at PromptWars. It combines:
- Live Crowd Intelligence: Real-time gate throughput monitoring and grandstand occupancy tracking
- Scenario-Driven AI: Gemini-powered commands triggered by Safety Car, Rain, Red Flags, and VSC events
- Team Theme Engine: Dynamic CSS variable injection for 6 F1 teams with custom color palettes and fonts
- Interactive Circuit Maps: SVG-based lap visualization for Silverstone, Monaco, Monza, and Spa
- Persistent Data Layer: Supabase integration for session history, AI decision trails, and scenario replay
-
Team Theme System (
src/theme/teamThemes.js)- 6 F1 teams with unique color schemes (Red Bull, Ferrari, Mercedes, McLaren, Alpine, Aston Martin)
- CSS custom property injection via
applyTheme()for seamless UI transitions - Orbitron font for championship-grade headings
-
Global Race Context (
src/context/RaceContext.jsx)- Centralized state for selected team, circuit, gate telemetry, grandstand data
- Automatic data refresh every 3 seconds from Supabase
- Context hooks for all child components
-
Supabase Database Schema
session_config: Team and circuit selection persistencegate_telemetry: Live scan rates and bottleneck detectiongrandstand_occupancy: Occupancy percentages with capacity flagsscenario_events: Triggered scenarios with crowd multipliersai_commands: Audit trail of all AI-generated commandssimulator_queue: F1 25 simulator queue telemetry with wait times
-
AI Service Layer (
src/services/aiService.js)- Gemini 1.5 Flash integration for scenario analysis
- JSON command generation with fields:
alert_type,gate_target,color_override,radio_message,redirect_recommendation - Throughput analysis and bottleneck recommendations
- Graceful fallback for API errors
| Component | Purpose |
|---|---|
TeamSelector |
Full-screen onboarding: team + circuit selection |
CircuitMap |
Interactive SVG with real-time gate status + sector highlighting |
ScenarioControl |
4-button panel: Safety Car, Rain, Red Flag, VSC triggers |
GateThroughput |
Bar charts + live capacity bars for all gates |
GrandstandOccupancy |
Occupancy sliders + capacity flags + "covered zone" indicators |
SimulatorLeaderboard |
Queue position rankings with animated wait times |
AIRadioPanel |
"Sync AI Brain" button + real-time command display + confidence score |
SystemLogs |
Auto-scrolling terminal log of all radio transmissions |
When a Safety Car is triggered:
- Crowd multiplier increases to 1.4x
- Food and Merch zones see simulated +40% surge
- AI generates strategic redirections
- Gates are flagged if scans exceed 30/min
- Gate Throughput: Bar chart + simulated scan rates (5-40/min)
- Grandstand Occupancy: Slider controls for manual demo input
- Simulator Queue: Live leaderboard with queue positions and wait time predictions
- Status Indicators: Color coding (green=normal, amber=busy, red=critical)
Select from 4 F1 circuits with unique SVG layouts:
- Silverstone: Abbey, Luffield, Stowe, Copse, Maggotts, Becketts
- Monaco: Casino, Mirabeau, Portier, Loews, Tabac
- Monza: Main, Ascari, Parabolica, Posti, Curva
- Spa: Eau Rouge, Les Combes, Pouhon, Campus, Radillion
Gates display real-time status with animated bottleneck alerts.
Trigger scenarios to receive Gemini-analyzed JSON responses:
{
"alert_type": "SAFETY_CAR",
"gate_target": "Gate A",
"radio_message": "Redirect excess crowds to Food Court Zone B, activate overflow shuttle routes",
"redirect_recommendation": "Send fans to covered zones"
}All commands are logged to Supabase for post-event analysis.
- Scanline CRT effect: Overlaid on entire dashboard for authentic race control aesthetic
- Carbon texture: Subtle diagonal pattern on all panels
- Glow effects: Dynamic drop-shadow filters with team color propagation
- Smooth animations: Framer Motion stagger-load on app startup (HUD assembly effect)
- Real-time pulsing: Bottleneck gates flash with 0.6s pulse on the SVG map
- Node.js 16+
- Supabase account (already provisioned)
- Google Gemini API key (get from Google AI Studio)
npm installUpdate .env with your Gemini API key:
VITE_SUPABASE_URL=<your-supabase-url>
VITE_SUPABASE_ANON_KEY=<your-supabase-anon-key>
VITE_GEMINI_API_KEY=<your-gemini-api-key>
npm run devOpen http://localhost:5173 and select your team + circuit.
npm run build
npm run previewThis build was engineered to stand out in a 10K-student field by emphasizing:
- Unique Concept: Digital Twin for crowd management (not generic chatbot)
- Visual Fidelity: Championship-grade UI with polished animations
- Interactivity: 6 teams, 4 circuits, 4 scenarios, live simulator rankings
- Data Persistence: Supabase audit trail for scenario replay and analysis
- AI Integration: Gemini-powered strategic recommendations, not just rule-based responses
- Scalability: Modular component architecture ready for additional features
src/
├── components/
│ ├── TeamSelector.jsx (Onboarding splash)
│ ├── CircuitMap.jsx (Interactive SVG)
│ ├── ScenarioControl.jsx (4-button trigger panel)
│ ├── GateThroughput.jsx (Bar charts)
│ ├── GrandstandOccupancy.jsx (Occupancy sliders)
│ ├── SimulatorLeaderboard.jsx (Queue rankings)
│ ├── SystemLogs.jsx (Radio log terminal)
│ ├── AIRadioPanel.jsx (AI command display)
│ ├── TacticalMap.jsx (Legacy - kept for reference)
│ └── TelemetryPanel.jsx (Reusable panel component)
├── context/
│ └── RaceContext.jsx (Global race state)
├── services/
│ ├── supabaseClient.js (DB queries + helpers)
│ └── aiService.js (Gemini API integration)
├── theme/
│ └── teamThemes.js (Team color schemes)
├── App.jsx (Main entry point)
├── main.jsx (React root)
└── index.css (Global styles + animations)
The AI service sends structured prompts and parses JSON responses:
await aiService.generateAICommand(scenarioType, telemetryData)Returns command object that is both displayed in the UI and stored in Supabase for audit trail.
- Lazy-loads telemetry updates every 3 seconds
- Uses Recharts for efficient chart rendering
- Framer Motion animations are GPU-accelerated
- Tailwind CSS purges unused utilities in production build
- Sound cue system for scenario triggers
- Real-time WebSocket integration for multi-user sync
- Mobile companion app for on-site stewards
- Advanced analytics dashboard for post-event metrics
- AR overlay for physical circuit visualization
- Predictive crowd flow based on race position changes
Built with React 18, Tailwind CSS, Framer Motion, Recharts, Supabase, and Gemini 1.5 Flash for PromptWars 2026.