A full-stack web application designed for visualizing and analyzing Scuderia Ferrari's F1 telemetry data.
Built with Next.js and Tailwind CSS on the frontend, and a Python FastAPI backend powered by the FastF1 library, this project provides a high-performance, real-time replay of telemetry data straight from the official F1 timing systems.

- 🏎️ Telemetry Replay: Pixel-perfect replay of a driver's fastest lap using 60fps HTML Canvas animations.
- 📍 Track Reconstruction: Mathematically reconstructs the circuit layout dynamically using raw X/Y telemetry coordinates.
- 🌈 Live Speed Gradients: Visualizes the racing line painted with a continuous gradient translating velocity directly into colour (slow=red, fast=green).
- 📊 Live Data Dash: Real-time numerical display panel for Speed, Throttle, Brake intensity, and active Gear synchronized perfectly with the playback marker.
- ⚙️ Complete Session Selector: Access data from 25+ Grand Prix events spanning the 2022 to 2024 seasons for Charles Leclerc, Carlos Sainz, Lewis Hamilton, and Oliver Bearman.
- ⚡ Supercharged Caching: Utilises dual-layer caching—in-memory
@lru_cacheand FastF1's disk-based SQLite cache—ensuring massive gigabyte data payloads are sliced and delivered to the UI in milliseconds after the first load.
- Framework: Next.js 15 (App Directory)
- UI & Styling: Tailwind CSS 4
- Visuals: Native HTML
<canvas>,react-icons - Architecture: Decoupled component design
The backend requires Python 3.10+ and provisions the FastF1 session data pipelines.
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Run the API server
uvicorn app.main:app --reload --port 8000cd frontend
npm install
# Run the UI server
npm run devThe application will be available at http://localhost:3000.
Note: Navigate to the /telemetry route for the dedicated dashboard workspace.
Ferrari/
├── backend/
│ ├── app/
│ │ ├── main.py # FastAPI entry point & CORS
│ │ ├── routes/
│ │ │ └── telemetry.py # Next.js endpoint definition
│ │ └── services/
│ │ └── fastf1_service.py # Core pandas logic & FastF1 integration
│ └── requirements.txt
│
└── frontend/
├── src/app/
│ ├── page.js # Main landing page
│ ├── telemetry/
│ │ └── page.js # 🏎️ Dashboard Route Layout
│ └── components/
│ └── TrackMap.jsx # 🧠 HTML Canvas rendering engine
├── tailwind.config.ts
└── package.json
The track is never loaded from an image or a preset shape. Instead, when a driver is selected:
- FastF1 fetches thousands of
[X, Y, Speed]vectors from the FIA server. - The
useMemohook normalises the coordinates around a geometric centre-point(midX, midY). - It scales the track recursively to fit within an
800x800canvas whilst preserving the X:Y aspect ratio perfectly. - The canvas context draws linear gradients between every single adjacent point acting as tangent lines, naturally reconstructing a smooth, continuous track map.
- First-time loading of a specific Grand Prix can take 5–15 seconds while FastF1 downloads the multi-gigabyte
.ergarchive from the FIA. Ensuing requests for the same race are cached on disk and resolve near-instantly. - Due to the high payload caching strategy, it's recommended to add
backend/app/cache/to your.gitignoreto avoid pushing gigabytes of SQLite data to GitHub.