A free-to-play prediction web app for Formula 1 fans who want to compete socially with friends and groups. Users make predictions before race sessions, which are then automatically scored once official timing and telemetry data becomes available via the FastF1 library.
π Live App: https://f1-picks-frontend.vercel.app
π§ API: https://f1picks-backend.fly.dev
- Telemetry-Aware Predictions: Predict race winners, podium finishes, fastest laps, sector times, and pit windows
- Post-Session Auto-Scoring: Transparent scoring using FastF1 data (30-120 minutes post-session)
- Global & League Leaderboards: Compete globally or create private leagues
- Real-time Updates: Live leaderboard updates after scoring completes
- Analytics & Transparency: Hit rate, average margin, and per-prop scoring breakdown
- Social Features: Camera integration for profile photos and QR code league joining
This is a monorepo containing:
- Frontend (
/frontend): Next.js 15 with TypeScript and Tailwind CSS - Backend (
/backend): FastAPI with Python 3.13 - Shared (
/shared): Common utilities, types, and configurations - Worker: Python worker for FastF1 data ingestion (post-session)
- Frontend: Next.js 15, React 19, TypeScript 5, Tailwind CSS, shadcn/ui
- Backend: FastAPI, SQLAlchemy, Alembic, asyncpg, Python 3.13
- Database: PostgreSQL (Supabase)
- Data Source: FastF1 library for F1 telemetry and results
- Authentication: Supabase Auth (email/password, OAuth)
- Deployment: Vercel (frontend), Fly.io (backend), automated via GitHub Actions
- CI/CD: GitHub Actions with Release Please
- Package Management: npm workspaces (frontend), uv (backend)
- Node.js 18+ and npm 9+
- Python 3.13+
- PostgreSQL
- Git
- Docker (optional, for containerized development)
-
Clone the repository
git clone <repository-url> cd F1Picks
-
Install dependencies
# Install all workspace dependencies npm ci --include-workspace-root # Install backend dependencies cd backend pip install -r requirements.txt pip install -r dev-requirements.txt cd ..
-
Environment Setup
# Backend environment cd backend cp .env.example .env # Edit .env with your configuration: # - DATABASE_URL (PostgreSQL connection string) # - SUPABASE_URL and SUPABASE_ANON_KEY # - SECRET_KEY for JWT tokens # Frontend environment cd ../frontend cp .env.example .env # Edit .env with: # - NEXT_PUBLIC_SUPABASE_URL # - NEXT_PUBLIC_SUPABASE_ANON_KEY # - NEXT_PUBLIC_API_URL (backend URL)
-
Database Setup
# Run database migrations cd backend alembic upgrade head # Optional: Seed development data python scripts/seed_dev_data.py
-
Start Development Servers
# Start both frontend and backend npm run dev # Or start individually: npm run dev:frontend # http://localhost:3000 npm run dev:backend # http://localhost:8000
F1Picks/
βββ frontend/ # Next.js frontend application
β βββ src/
β β βββ app/ # App router pages (home, leagues, profile)
β β βββ components/ # React components (ui, layout)
β β βββ contexts/ # React contexts (auth)
β β βββ lib/ # API client, utilities
β βββ public/ # Static assets
β βββ package.json
βββ backend/ # FastAPI backend application
β βββ app/
β β βββ models/ # SQLAlchemy database models
β β βββ repositories/ # Data access layer
β β βββ routers/ # API endpoints (users, leagues, picks, etc.)
β β βββ config.py # Application settings
β β βββ database.py # Database connection
β β βββ main.py # FastAPI app with CORS
β βββ alembic/ # Database migrations
β βββ scripts/ # Utility scripts (seed data, migrations)
β βββ tests/ # Backend tests
β βββ requirements.txt # Python dependencies
β βββ fly.toml # Fly.io deployment config
βββ worker/ # FastF1 data ingestion worker
β βββ app/
β β βββ fastf1_client.py # FastF1 integration
β β βββ scheduler.py # Celery task scheduler
β β βββ database.py # Database connection
β βββ requirements.txt
βββ shared/ # Shared TypeScript types
βββ .github/workflows/ # CI/CD workflows
β βββ ci.yml # PR validation
β βββ deploy.yml # Production deployment
β βββ daily-data-sync.yml # Scheduled data updates
βββ package.json # Root package.json with workspaces
βββ README.md
npm run dev- Start both frontend and backend in development modenpm run build- Build shared package and frontend for productionnpm run lint- Run ESLint on frontendnpm run lint:backend- Run Ruff linting on backendnpm run format:backend- Format backend code with Ruff
- Frontend: ESLint, TypeScript
- Backend: Ruff (linting and formatting)
- CI/CD: Automated testing on PRs, deployment on merge to main
The project uses a multi-workflow GitHub Actions setup:
-
CI Pipeline (
ci.yml) - Runs on PRs tomain- Frontend: Lint, build, and validate
- Backend: Lint with Ruff, test FastAPI startup
- Does NOT deploy
-
Deploy (
deploy.yml) - Runs on merge tomain- Deploys backend to Fly.io using Docker
- Frontend deploys automatically via Vercel GitHub integration
-
Release Please (
release-please.yml) - Automated versioning- Creates release PRs with changelog generation
- Bumps versions across all workspace packages
- Follows Conventional Commits specification
- URL: https://f1-picks-frontend.vercel.app
- Automatic deployment from
mainbranch via Vercel GitHub integration - Environment variables configured in Vercel dashboard:
NEXT_PUBLIC_API_URLNEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEY
- URL: https://f1picks-backend.fly.dev
- Deployed using
fly.tomlconfiguration - Triggered by
deploy.ymlworkflow on merge tomain - Database migrations run automatically on deployment
- Environment variables configured via Fly.io secrets:
DATABASE_URLSUPABASE_URLSUPABASE_SERVICE_ROLE_KEYSECRET_KEY
cd frontend
npm run testcd backend
pytestAll tests run automatically on pull requests via GitHub Actions.
- Schedule Ingestion: Worker fetches F1 schedule from FastF1
- User Predictions: Users make picks before session start times
- Session Execution: F1 sessions run (qualifying, practice, race)
- Data Availability: FastF1 publishes results/telemetry (30-120 min delay)
- Auto-Scoring: Worker ingests data, calculates scores, updates leaderboards
- User Notification: Users see updated scores and leaderboard positions
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes using Conventional Commits
feat:for new featuresfix:for bug fixesdocs:for documentation changeschore:for maintenance tasks
- Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- CI pipeline will automatically run tests and validation
- After merge, Release Please will handle versioning and changelog generation
This project is licensed under the MIT License - see the LICENSE file for details.
- Full-stack application deployed (Frontend on Vercel, Backend on Fly.io)
- Database schema with 8 models (User, League, Event, Pick, Result, Score, etc.)
- Supabase authentication integration
- League management (create, join, view members)
- User profiles and leaderboards
- CI/CD pipeline with automated deployments
- CORS configuration for production
- Database migrations with Alembic
- FastF1 data ingestion worker
- Automated scoring system
- Real-time leaderboard updates
- Advanced telemetry predictions (sector times, pit windows)
- QR code league joining
- Camera integration for profile photos
- Analytics dashboard (hit rate, average margin)
- Seasonal leaderboards and playoffs
- Mobile app (React Native)