🏎️ GR Race Guardian - Project Summary Inspiration As a motorsport enthusiast, I've always been fascinated by how Formula 1, WEC, and IndyCar teams use data to make split-second strategic decisions. Professional race engineers have access to sophisticated analytics platforms that process telemetry, predict tire degradation, and optimize pit strategies in real-time. I wanted to bring this level of professional-grade analysis to grassroots racing, club motorsport teams, and racing enthusiasts who don't have access to million-dollar software.
The inspiration came from watching races and thinking: "What if every racer could have their own digital race engineer?" Someone who could analyze their driving, predict race outcomes, and provide strategic insights just like the pros. That's when GR Race Guardian was born.
What It Does GR Race Guardian is a professional motorsport analytics platform that transforms raw race data into actionable intelligence. It provides: Core Capabilities Real-Time Race Analysis
Live WebSocket updates every second Real-time lap times, positions, and sector splits Live telemetry visualization with speed, throttle, and brake data Comprehensive driver statistics dashboard
AI-Powered Race Engineering (7 Modes)
Engineering Mode: Professional race engineer insights with technical analysis Strategy Mode: Real-time tactical recommendations for pit stops and overtakes Coach Mode: Driver improvement analysis and coaching feedback Fan Mode: Exciting race storytelling for enthusiasts Summary Mode: Race recap and highlights Compare Mode: Side-by-side driver comparison Pit Decision Mode: AI-powered pit stop recommendations with confidence scoring
Machine Learning Predictions
Lap time prediction using XGBoost models Tire degradation modeling with exponential curve fitting Race pace optimization Monte Carlo race simulation (100-500 outcomes) Overtake probability calculations Traffic density analysis
Track Replay System
Interactive OpenStreetMap-based track visualization Animated car icons moving along actual GPS coordinates Lap-by-lap race progression with overtake detection Position tracking and gap analysis Support for 7 professional race tracks (Barber, COTA, Indianapolis, Road America, Sebring, Sonoma, VIR)
Digital Twin Technology
Driver Twin: Mathematical models of each driver's behavior (pace, consistency, aggression, sector strengths, fatigue) Race Twin: Monte Carlo simulation engine predicting race outcomes with probabilities
How I Built It Architecture I designed a three-tier microservices architecture for scalability and performance:
Frontend (Next.js/React) ↕ WebSocket + REST Node.js Bridge (Express/Socket.IO) ↕ HTTP API Python ML Engine (FastAPI) Backend Development Python ML Engine (FastAPI)
Built the core machine learning models using XGBoost and scikit-learn Implemented tire degradation modeling using SciPy curve fitting Created a Monte Carlo race simulator using NumPy for vectorized operations Developed the Digital Driver Twin generator analyzing pace, consistency, and aggression Integrated SHAP for model explainability Built CSV parsing system handling race results, lap times, and telemetry data
Node.js Bridge (Express)
Created REST API and WebSocket server using Express and Socket.IO Integrated Google Gemini 2.0 Flash AI with function calling capabilities Implemented BullMQ job queue for heavy computation tasks Built authentication system using JWT and bcryptjs Added rate limiting and security middleware
Frontend Development Next.js Application
Built responsive dashboards using React 18 and Next.js 14 App Router Implemented real-time updates using Socket.io-client Created beautiful data visualizations with Recharts, Plotly.js, D3.js, and Visx Built 3D car animations using Three.js and React Three Fiber Developed interactive track maps using Leaflet and React-Leaflet with OpenStreetMap Designed sleek UI with Tailwind CSS and smooth animations with Framer Motion Implemented state management using Zustand
Track Replay System
Parsed GPS coordinates for 7 professional race tracks Created race replay builder that reconstructs lap-by-lap race progression from CSV data Implemented overtake detection, pit stop identification, and anomaly detection algorithms Built smooth car animations using requestAnimationFrame and time-based interpolation Integrated CSV upload functionality using Papaparse
DevOps & Infrastructure
Containerized services using Docker and Docker Compose Created automated startup scripts for Windows and Linux Implemented structured logging and error handling Set up deployment guides for Vercel, Railway, and Render
Challenges I Ran Into Real-Time Data Synchronization Getting the Python ML engine, Node.js bridge, and React frontend to communicate seamlessly in real-time was challenging. I had to carefully design the WebSocket message protocol and handle race conditions when multiple updates arrived simultaneously. Solution: Implemented a message queue system using BullMQ and added debouncing logic to prevent overwhelming clients. Accurate GPS Track Mapping Mapping actual race track GPS coordinates to SVG/Canvas rendering was incredibly difficult. Getting the scale, rotation, and projection correct for 7 different tracks required extensive trial and error. Solution: Created a coordinate normalization system that converts lat/lng to pixel coordinates with proper scaling and bounds detection. Smooth Car Animation Making cars move smoothly along the track at the correct speed based on actual lap times was tricky. Using simple CSS animations resulted in jerky movement. Solution: Implemented custom JavaScript animation using requestAnimationFrame with time-based interpolation between GPS waypoints, creating fluid 60 FPS animations. Monte Carlo Simulation Performance Running 500 race simulations in real-time was computationally expensive and caused lag. Solution: Optimized using NumPy vectorized operations instead of Python loops, reducing simulation time from 30 seconds to under 2 seconds. AI Context Management The AI agent needed access to driver twins, race twins, and pit decision data, but passing everything in the prompt exceeded token limits. Solution: Implemented function calling (tool calling) with Gemini 2.0 Flash, allowing the AI to fetch data on-demand rather than receiving everything upfront. CSV Parsing Inconsistencies Different race data sources had different CSV formats, column names, and encoding issues. Solution: Built a flexible CSV parser with automatic column detection, encoding handling, and validation checks. Accomplishments That I'm Proud Of
Full-Stack Mastery: Successfully integrated Python ML, Node.js backends, and React frontend into a cohesive real-time system Advanced AI Integration: Implemented Gemini 2.0 Flash with function calling, enabling the AI to autonomously fetch data and run simulations Professional-Grade Analytics: Created the same level of analysis used by Formula 1 teams (Digital Twins, Monte Carlo simulation, multi-factor pit decisions) Beautiful Track Visualizations: Built stunning animated race replays with real GPS coordinates for 7 professional tracks Real-Time Performance: Achieved sub-2-second Monte Carlo simulations and smooth 60 FPS car animations 98% Feature Complete: Implemented all planned features from the development roadmap Production-Ready Architecture: Built scalable microservices with proper error handling, logging, and auto-recovery Comprehensive Documentation: Created detailed markdown docs covering architecture, API references, deployment guides, and user instructions
What I Learned Technical Skills
Advanced React Patterns: Mastered React hooks, custom hooks, context, and performance optimization techniques WebSocket Architecture: Learned how to design real-time bidirectional communication systems at scale Machine Learning in Production: Understood the challenges of deploying ML models in real-time applications Microservices Communication: Gained experience in inter-service communication using REST, WebSockets, and gRPC GPU-Accelerated Computing: Learned NumPy vectorization and performance optimization techniques AI Function Calling: Mastered Gemini's function calling capabilities for autonomous AI agents
Domain Knowledge
Motorsport Analytics: Deep-dived into how professional racing teams analyze data Racing Strategy: Learned about tire degradation, pit windows, undercut/overcut strategies Telemetry Analysis: Understood how speed, throttle, and brake data correlate with performance GPS Coordinate Systems: Learned lat/lng to pixel conversion, map projections, and coordinate transformations
Software Engineering
System Design: Learned to design complex multi-tier architectures Error Handling: Implemented robust error recovery and graceful degradation Testing Strategies: Developed end-to-end testing approaches for real-time systems Documentation: Created comprehensive technical documentation for developers and users
What's Next for GR Race Guardian Immediate Enhancements
Video Sync: Integrate with onboard camera footage to sync race replay with actual video Weather Integration: Add real-time weather data to predict rain impacts on strategy Mobile App: Build native iOS/Android apps for trackside use Live Mode: Support live timing data feeds from race events
Advanced Features
Deep Learning Models: Implement LSTM/Transformer models for more accurate predictions VR/3D Visualization: Create immersive 3D track walkthroughs and VR race replays Multi-Team Collaboration: Add team accounts with shared data and insights Historical Database: Build comprehensive racing statistics database across seasons Championship Tracker: Track points, standings, and championship scenarios
Machine Learning Enhancements
Predictive Maintenance: Predict mechanical failures based on telemetry patterns Setup Optimization: ML-based vehicle setup recommendations A/B Testing: Simulate different strategy scenarios side-by-side Temperature Modeling: Factor track and tire temperature into predictions
Platform Growth
Cloud Deployment: Deploy on AWS/GCP with auto-scaling IoT Integration: Connect directly to car telemetry systems and OBD-II ports Global Track Database: Expand to 100+ race tracks worldwide Commercial Version: Enterprise version for professional racing teams
Built With Python, Node.js, JavaScript, TypeScript, Next.js, React, Tailwind CSS, Framer Motion, Recharts, Plotly.js, D3.js, Three.js, Leaflet, OpenStreetMap, Socket.io, Express, FastAPI, XGBoost, scikit-learn, pandas, NumPy, SciPy, SHAP, Google Gemini AI, BullMQ, Redis, JWT, Docker, Vercel, Railway, AWS, and 100+ other technologies.
GR Race Guardian - Your Digital Race Engineer 🏎️✨
Built With
- aim
- amazon-web-services
- anthropic-claude
- autoprefixer
- aws-ec2
- aws-lambda
- axios
- bcryptjs
- body-parser
- bullmq
- can-bus
- cors
- css3
- csv
- d3.js
- date-fns
- digitalocean
- docker
- docker-compose
- dotenv
- dvc
- eslint
- express-rate-limit
- express.js
- fastapi
- fia
- framer-motion
- gemini
- git
- github
- github-actions
- google-generative-ai
- gradient-boosting
- grpc
- grpcio
- grpcio-tools
- html5
- ioredis
- javascript
- joblib
- json
- jsonwebtoken
- jwt
- leaflet.js
- lightgbm
- machine-learning
- matplotlib
- monte-carlo-simulation
- motec
- next.js
- node.js
- nodemon
- npm
- numpy
- openai-gpt
- openstreetmap
- pandas
- papaparse
- pip
- plotly.js
- postcss
- postgresql
- protocol-buffers
- pydantic
- python
- race-chrono
- railway
- react
- react-leaflet
- react-plotly.js
- react-three-drei
- react-three-fiber
- recharts
- redis
- render
- rest-api
- scikit-learn
- scipy
- seaborn
- shap
- simpy
- socket.io
- socket.io-client
- sqlite
- statsmodels
- tailwind-css
- three.js
- timing
- typescript
- uvicorn
- vercel
- visx
- websocket-protocol
- websockets
- ws
- xgboost
- zustand
Log in or sign up for Devpost to join the conversation.