Available for new projects & full-time roles

Let's Talk
FPL Analytica — Real-Time FPL Analytics Platform
Back to Projects

FPL Analytica — Real-Time FPL Analytics Platform

A full-stack statistics and optimization platform for Fantasy Premier League managers, featuring progressive rendering, scheduled ETL pipelines, and repository-pattern tiered caching.

5 of 19 fully live

Live Pages

53 audited

API Endpoints

< 500ms target

Core Latency

152 frontend commits

Commits

Project Overview

FPL Analytica is a data-driven web application designed to solve the informational void in the official Fantasy Premier League (FPL) platform. By combining a React SPA on the frontend, a Python/FastAPI service on the backend, scheduled ETL scraping pipelines, and an Azure SQL Database, the application provides manager identity trends, live gameweek standing updates, and multi-second optimization solves without blocking performance. The platform processes millions of data points from the official FPL API using decoupled pipeline scripts (`fpl_data_harvesting_pipeline.py`) that run on schedules and land CSV files in Azure Blob Storage before loading them into Azure SQL Database. The backend enforces a strict repository pattern via `app/data_access/repository.py` to cache queries (with custom TTLs like 120s for mini-leagues and 900s for chip indices) and isolate expensive season-long computations from low-latency identity reads.

Key Challenges

Balancing slow analytics against fast reads

Optimality and chip-timing calculations are extremely expensive, taking 5 to 30 seconds to complete. Running these queries synchronously would block simple reads and freeze the dashboard.

Decoupling live FPL API rate limits

Querying the official FPL API live on every user request is not viable at scale due to strict rate limits and external API downtime during gameweeks.

Enforcing backend architecture boundaries

In large-scale designs, developers often inadvertently import database layer functions directly into API route handlers, eroding the repository pattern boundary over time.

Handling breaking API spec updates

The backend API contract underwent a major breaking change mid-project (introducing /api/ prefixes and renaming/removing 30+ endpoints), threatening frontend integration.

Solutions Implemented

Tiered progressive loading strategy

Implemented a progressive API design that returns immediate dashboard data (<500ms), fetches live standings in the background, and lazy-loads heavy analytical calculations.

  • Immediate tier (/dashboard/core/{id}) serves manager identity and rank trend
  • Fast background tier (/dashboard/live/{id}) loads live fixtures and top-1000 benchmarks
  • Lazy-load tier (/dashboard/analytics/{id}) streams optimality solvers and chip timing
  • Ensures the dashboard remains interactive immediately while computations run

Scheduled scraping and CSV staging

Built automated ingestion pipelines (*_pipeline.py) that harvest live data on a cron schedule and stage it as CSV files in Azure Blob Storage.

  • Decouples the web application entirely from live third-party API availability
  • Allows heavy optimization algorithms to run against consistent, versioned snapshots of the season
  • Drastically reduces outbound API call frequency, preventing rate limit blocks

Mechanical import verification script

Wrote a custom linting script (check_api_imports.py) that runs in the CI/CD pipeline before every PR merge to verify import paths.

  • Scans backend endpoint files to block direct database function imports
  • Ensures all endpoints only communicate with the repository.py layer
  • Maintains clean layer separation and enables backend storage swapability

Traceability matrix and API spec audits

Authored and maintained API_MAPPING.md and CONTENT_MAPPING.md as living integration matrices, performing systematic audits.

  • Mapped all 53 backend endpoints against the 39 frontend query wrapper functions
  • Instantly highlighted mismatched route parameters, deprecated calls, and dead paths
  • Saved weeks of manual debugging by establishing contract-first verification

Technology Stack

frontend

React 18TypeScriptViteTanStack QueryRedux ToolkitTailwind CSSRecharts@tanstack/react-virtual

backend

Python 3.11FastAPIJWT AuthCORS allowlisting

database

Azure SQL DatabaseAzure Blob StorageIn-Memory TTL Cache

devops

Azure App ServiceAzure Static Web AppsHusky + CommitlintpytestJest + RTL

Development Process

Spec & Matrix Mapping

4 weeks
  • Created page-by-page UI specifications in CONTENT_MAPPING.md
  • Drafted API_MAPPING.md traceability matrix connecting UI to backend contracts
  • Designed the developer onboarding roadmap and environment setup guidelines

Ingestion Pipelines & Repository

6 weeks
  • Wrote scheduled scraper scripts (fpl_data_harvesting_pipeline.py)
  • Set up Azure SQL database schemas and Azure Blob Storage CSV landing path
  • Implemented repository and cache layers with custom TTL timings

Tiered API & Security

8 weeks
  • Built FastAPI progressive endpoints (Immediate, Fast, Lazy) with response isolation
  • Configured JWT authentication headers and CORS origin restrictions
  • Implemented GDPR/privacy consent and deletion endpoints

Frontend Core Pages

6 weeks
  • Initialized Vite + TypeScript client app and integrated TanStack Query and Redux Toolkit
  • Built and styled the 5 core pages: Dashboard, Precision, and Manager/Mini-League/Elite tracking
  • Implemented list virtualization for large player tables using @tanstack/react-virtual

Role & Responsibilities

Frontend & State Architect

Created the Vite SPA setup with Redux Toolkit and TanStack Query caching
Designed the UI layouts using Tailwind CSS and components from the spec
Implemented the progressive loading states and virtualised points list scroll

Backend & Data Engineer

Developed the FastAPI endpoints and the progressive response framework
Implemented the repository pattern and database-import verification lint scripts
Created scheduled ETL scripts scraping and loading data into Azure SQL
Audited and resolved breaking changes in the API spec routes mapping

Key Features

Three-tier progressive dashboard rendering (Immediate, Background, Lazy)
Scheduled scraping pipelines harvesting gameweek, player, and manager data
Strict repository pattern separating API endpoints from database queries
Dynamic TTL-based caching layer tailored by data volatility
Virtualised player points tables for high performance during live gameweeks
Statistical benchmarking comparison against top 1,000 global managers
JWT auth protection with context-header checking on all write paths
GDPR-compliant data deletion and user consent tracking endpoints
Husky & commitlint git hooks for strict conventional commit compliance
Automated architecture validation via custom python import check scripts

Let's Build Something Great Together

Passionate about creating efficient, scalable, and user-centric web solutions using modern technologies