An F1 race prediction and data companion web application — CEN 4090L Capstone Project, FSU Group 5
Live Demo:
- Frontend: https://f1-capstone-project-ujwc.onrender.com
- Backend API: https://racetrack-backend-2ak8.onrender.com
- API Docs: https://racetrack-backend-2ak8.onrender.com/docs
RACETRACK is a Formula 1 companion app that combines machine learning predictions, live standings, race history, and a curated newsroom. Users can simulate upcoming race outcomes, explore championship standings, browse historical race data, and stay current with F1 news — all in a retro 1970s–80s F1 pit crew aesthetic.
| Name | GitHub | Role |
|---|---|---|
| Alexander Hsieh | alex-hsieh |
PM, Data Lead, Frontend |
| Aleksandar Stavreski | as21emAS |
Frontend — Dashboard & Simulator |
| Brooklyn Metzger | BrooklynMetzger |
Frontend — Data Center & Newsroom |
| Olivia Reiter | or22a |
Backend & Database |
| Yulissa Fu | YulissaFu |
Backend & External APIs |
| Julissa Su | js22cu |
ML Engineer |
| Route | Page | Description |
|---|---|---|
/ |
Dashboard | Next race card, hero video, championship standings, live header clock |
/simulator |
Simulator | 3-step race prediction: circuit → conditions → grid → results |
/data-center |
Data Center | Historical race results, driver/team stats, 2010–present |
/newsroom |
Newsroom | Live RSS feed aggregator from multiple F1 sources |
- React 18 + TypeScript + Vite
- Tailwind CSS
- React Router v6
- Port: 5173 (dev)
- FastAPI + Uvicorn
- SQLAlchemy + PostgreSQL 16
- APScheduler (auto-updater — fires 2hr after race end)
- Port: 8000 (dev)
- scikit-learn
RandomForestClassifier - 10-feature input (qualifying, standings, weather, circuit, etc.)
- Serialized as
Backend/app/ml/models/f1_winner_model_v2.pkl - Honest accuracy targets: ~45–50% exact winner, ~70%+ podium prediction
| API | Purpose |
|---|---|
| Jolpica-F1 | Race calendar, standings, results (replaced deprecated Ergast) |
| OpenF1 | Live telemetry (future use) |
| OpenWeatherMap | Race weekend forecast |
| Visual Crossing | Historical weather per circuit |
| rss2json | Newsroom RSS aggregation |
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Health check |
| GET | /api/races |
List all races (paginated) |
| GET | /api/races/next |
Next upcoming race |
| GET | /api/races/{id} |
Race detail |
| GET | /api/standings/drivers/current |
2026 driver standings |
| GET | /api/standings/teams/current |
2026 constructor standings |
| GET | /api/circuits |
All circuits |
| GET | /api/circuits/{id} |
Circuit detail |
| GET | /api/drivers |
All drivers |
| GET | /api/predictions |
Race winner predictions |
| POST | /api/simulator |
Run simulator with custom params |
| GET | /api/weather |
Race location weather |
| GET | /api/news |
RSS news feed |
| GET | /api/admin |
Admin utilities |
PostgreSQL 16. Tables: races, circuits, drivers, teams, race_results, driver_standings, constructor_standings
Seeded on startup via auto_updater.py lifespan hook:
- 2026 race calendar (24 rounds from Jolpica)
- Driver and team rosters
- Completed race results
- APScheduler polls 2hr after each race end for new results
- Python 3.11+
- Node 18+
- PostgreSQL 16
cd Backend
python -m venv venv
# Windows Git Bash:
source venv/Scripts/activate
# Mac/Linux:
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # fill in DATABASE_URL and API keys
alembic upgrade head
uvicorn app.main:app --reload --port 8000Required .env vars:
DATABASE_URL=postgresql://USER:PASS@localhost:5432/f1_predictor
OPENWEATHER_API_KEY=your_key_here
VISUALCROSSING_API_KEY=your_key_here
ALLOWED_ORIGINS=["http://localhost:5173"]
cd Frontend
npm install
cp .env.example .env.local # set VITE_API_BASE_URL
npm run devRequired .env.local vars:
VITE_API_BASE_URL=http://localhost:8000
Both frontend and backend are hosted on Render free tier.
| Service | Platform | URL |
|---|---|---|
| Frontend | Render Static Site | https://f1-capstone-project-ujwc.onrender.com |
| Backend | Render Web Service | https://racetrack-backend-2ak8.onrender.com |
Notes:
- Backend free tier cold-starts after inactivity (~30s first request). Hit
/healthto wake. - Frontend has no cold start (static site).
- React Router client-side routing handled via
Frontend/public/_redirects. - CORS: backend
ALLOWED_ORIGINSmust include frontend URL (no trailing slash).
Render env vars (backend):
DATABASE_URL=postgresql://...
OPENWEATHER_API_KEY=...
VISUALCROSSING_API_KEY=...
ALLOWED_ORIGINS=["http://localhost:5173","https://f1-capstone-project-ujwc.onrender.com"]
The predictor uses a RandomForestClassifier trained on 2010–2025 historical F1 race data.
Input features (10):
- Grid position
- Driver championship points
- Constructor championship points
- Circuit win rate (driver)
- Average finish position (driver, last 5 races)
- Weather — temperature
- Weather — rainfall
- Track type (street / permanent)
- Driver home race flag
- Tire strategy (pit stop count)
Honest accuracy: ~45–50% exact winner prediction, ~70%+ podium (top 3).
Model file: Backend/app/ml/models/f1_winner_model_v2.pkl
Retro 1970s–80s F1 pit crew aesthetic. Canonical spec: FRONTEND_REDESIGN_v4.md + VISUAL_STYLE_GUIDE.md.
| Token | Value |
|---|---|
| Background | #F5F1E8 (cream) |
| Accent | #E8002D (racing red) |
| Body font | Courier New (monospace) |
| Header font | Barlow Condensed 700 |
| Borders | 3–4px black, sharp corners |
| Signature element | Checkered flag (red + white squares) |
- Track time clock — header displays local user time correctly; track-local time is currently hardcoded and does not dynamically update per circuit timezone.
F1-Capstone-Project/
├── Backend/
│ ├── app/
│ │ ├── api/v1/endpoints/ # FastAPI route handlers
│ │ ├── core/ # Config, settings
│ │ ├── external/ # Jolpica + transformer clients
│ │ ├── ml/ # Model loader, predictor, simulator
│ │ ├── models/ # SQLAlchemy ORM models
│ │ ├── schemas/ # Pydantic schemas
│ │ ├── services/ # auto_updater, db_writer
│ │ └── main.py # FastAPI app entry point
│ ├── database/ # DB connection, CRUD, scripts
│ ├── routes/ # Health router
│ ├── scripts/ # Seed / backfill scripts
│ ├── tests/ # Test suite
│ ├── alembic/ # DB migrations
│ └── requirements.txt
├── Frontend/
│ ├── src/
│ │ ├── pages/ # DashboardHome, Simulator, DataCenter, Newsroom
│ │ ├── components/ # Layout, NextRaceCard, shared components
│ │ └── App.tsx
│ ├── public/
│ │ └── _redirects # React Router SPA routing for Render
│ └── package.json
├── FRONTEND_REDESIGN_v4.md # Authoritative UI spec
├── VISUAL_STYLE_GUIDE.md # Design tokens and aesthetic guide
└── README.md
FSU CEN 4090L — Academic use only.