← Back to Projects

Drafty

FPL Draft League Analytics

ReactNext.jsD3.jsTailwind CSSPythonDuckDBGitHub Actions

Overview

Drafty is a live analytics dashboard for my Fantasy Premier League draft league, built to understand league performance and the decisions behind it. It tracks season standings, bracket results, transfers, and bench decisions, with automatic updates each gameweek. Season metadata comes from the FPL Draft API rather than a hardcoded year.

Originally built with Streamlit, the frontend was rebuilt as a Next.js static site with D3.js visualisations and a Deep Ocean theme.

Drafty Dashboard

How It Works

The app is split into two parts: a Python data pipeline and a React frontend.

Data pipeline — A three-stage Python pipeline fetches raw data from the FPL Draft API, cleans and normalises it into DuckDB tables, then runs SQL transforms to produce analytics tables (bracket standings, bench efficiency, transfer blunders, cumulative points). DuckDB was chosen over a traditional database for its columnar storage and ability to run analytical queries efficiently — no hosted database needed, just a single .db file.

Frontend — A Next.js static export renders the data using D3.js charts and Tailwind CSS. The site loads CSV and JSON exports at runtime and is deployed on Vercel.

Automation — A GitHub Actions cron job runs every Tuesday at midnight UTC, re-fetches all gameweek data from the API, commits the updated database and CSVs, and triggers a Vercel redeploy.

Dashboard

The league overview prioritises season standings and the latest weekly changes. Bracket results, earned awards, and prize rules share a dedicated competition page, with configurable gameweek ranges and payouts.

An interactive season journey replays the standings week by week, with playback controls, manager highlights, lead-change milestones, and commentary derived from scoring lineups and transfer returns. A local admin tool configures the league, brackets, and prizes and runs the data pipeline before publishing updated exports.

Transfer Analysis

Transfer History

The transfers page shows all-time best and worst transfers ranked by net points gained or lost. A per-gameweek dropdown lets you drill into the specific transfers made each week — useful for post-gameweek banter about who picked up (or dropped) the wrong player.

Bench Efficiency

Bench Points Analysis

The bench analysis page quantifies points lost by benching higher-scoring players. A D3 bar chart shows total bench points per manager, while a position breakdown table lets you filter by GKP, DEF, MID, or FWD to see where each manager is leaving the most points on the bench.

Tech Stack

  • Frontend: React 19, Next.js 16, D3.js 7, Tailwind CSS v4, TypeScript
  • Pipeline: Python 3.11, DuckDB, Pandas, Loguru
  • Deployment: Vercel (static export), GitHub Actions (weekly cron)