Skip to content
All work

02Sports Analytics Platform · Personal Project · 2026

Beach HandStats

Beach handball statistics, built for the sand.

Beach HandStats capture console during the first period, Arena 4–3 Playa Norte, offline with one pending change: player and goalkeeper lists, a beach court with numbered zones, a goal divided into nine areas, and buttons for one-point and two-point goals.
Live capture keeps working offline: the console shows pending changes and syncs them when the connection returns.

01Overview

Overview

Beach HandStats is a Progressive Web App for recording beach handball matches and analyzing their statistics on tablet, phone and desktop. It is an independent product from HandStats, with its own repository, database and deployment, built around the beach version of the game.

It covers a club's full workflow: teams, rosters and opponents; match preparation; live capture under the IHF 2026 rules; season statistics and PDF reports; and a player portal, plays and practices.

Type
Personal Project
Year
2026
Platform
Progressive Web App
Focus
Beach rules, offline-first

02The Challenge

The Challenge

Beach handball has its own scoring. Spectacular goals — spins, in-flights, and goals by the specialist or the goalkeeper — are worth two points, each period is won separately, a tied period is decided by golden goal, and split periods go to a shoot-out. A statistics tool for indoor handball models none of this.

Sanctions also work differently: a suspended player leaves the team one player short until the next change of possession, and a second suspension leads to disqualification.

Matches are played outdoors, often far from a reliable connection, and the same club may work from more than one device.

03The Solution

The Solution

The rules live in a pure, tested domain layer: scoring, periods, golden goal, shoot-out, sanctions and change of possession are implemented and covered by unit tests, so the interface only records what happened.

Capture is offline-first. Matches, events and pending changes are stored in IndexedDB, a custom service worker lets the app open without a connection, and a sync queue sends every change with an id and a revision so nothing is duplicated. Conflicts between devices are shown for review instead of being overwritten.

Around the match, the app supports roster and opponent management, post-match corrections with a revision history, season statistics and PDF exports, a player portal, and plays and practices.

04Product Workflow

Product Workflow

The product follows a match from start to finish: prepare the call-up, capture the game under beach rules, keep working offline and sync safely, analyze the season, and plan plays and practices.

Match Preparation

The whole roster is called up by default and the four starters are marked. Goalkeeper–specialist pairs and attack–defense substitution pairs are set before the game, and the match can run with a 10-and-10 clock or with the scoreboard only.

Match preparation for Beach Demo against Rival Demo: a call-up of nine players with four starters marked, goalkeeper–specialist and attack–defense pairs, and the match duration options.
Call-up, starters, substitution pairs and match duration (demo data).

Live Match

Each shot is recorded by court zone and goal area, with one-point goals and two-point goals for spins, in-flights and specialist goals. The console tracks each period separately, decides tied periods by golden goal and runs the shoot-out with its own scoring.

Turnovers, defense, sanctions, cards and substitutions have their own controls, the last action can be undone, and the same console adapts to a phone.

Shoot-out screen after periods split 1–1: Arena wins the shoot-out 5–4, with buttons for one- and two-point goals, saves and misses.
Shoot-out: each attempt scores one or two points, kept separate from the periods.
The capture console on a phone, with players, goalkeepers, the court, the goal grid and the goal buttons stacked vertically.
The same console on a phone.

Offline & Sync

Matches can be created, prepared and captured without a connection. Pending changes sync automatically when the connection returns, and rejected events never count on the local scoreboard.

When another device changed the same data, the sync screen shows the conflict and lets the user keep their version or the server's.

Sync screen showing a roster change marked as a conflict, with the options to keep the local change or use the server's version.
When another device changed the same data, the user decides which version to keep.

Analytics

Statistics accumulate by team, match, season, opponent and competition, with general, player, goalkeeper, zone and evolution views and totals for periods, golden goals and shoot-outs.

Shots are broken down by court zone and goal area, and the same figures can be exported to PDF.

Accumulated statistics for Arena with filters for team, match, season, opponent and competition, PDF export options, totals for matches, periods, golden goals and shoot-outs, and scorer and goalkeeper summaries.
Season statistics with filters, beach-specific totals and PDF export.
Shot zones for a demo match: efficiency by court zone and goal area, with a player list to filter the shots.
Shots by court zone and goal area, filterable by player (demo data).

Training & Tactics

Plays are drawn on half or full court with players, specialists, goalkeepers and opponents, pivot formations and step-by-step movements, and can be watched animated.

Practices include exercises, attendance and history, and a player portal gives each player access to their own information.

Play editor on a half court: players, a pivot, a specialist and a goalkeeper on a beach court, with options to add players and opponents, choose the pivot formation and watch the play animated.
Play editor for beach formations, with half or full court and animated playback.

05Technical Architecture

Technical Architecture

An installable Next.js client with a local-first data layer in IndexedDB, synchronized with Supabase through an idempotent queue. The rules live in a pure domain layer shared by the console and the statistics.

  1. Capture console
  2. IndexedDB · Dexie
  3. Idempotent sync queue
  4. Supabase · PostgreSQL
  5. Statistics & PDF
  • Client application

    Installable PWA for tablet, phone and desktop.

    • Next.js 16 App Router and React 19
    • Custom service worker for offline start
    • Updates that wait for pending changes
  • Domain rules

    IHF 2026 beach handball rules as pure, tested code.

    • Scoring, periods, golden goal and shoot-out
    • Sanctions and change of possession
    • Court and goal zones
  • Offline & synchronization

    Local-first storage with safe, repeatable sync.

    • Matches and events in IndexedDB (Dexie)
    • Ids and revisions: no duplicates
    • Conflict review between devices
  • Backend & quality

    Supabase with row-level security and tests at every level.

    • PostgreSQL, Auth and RLS policies
    • Vitest unit tests
    • Playwright end-to-end and pgTAP database tests

06Technology Stack

Technology Stack

Frontend
Next.js 16React 19TypeScriptTailwind CSS 4
Offline
Dexie (IndexedDB)Service workerPWA
Backend & Data
SupabasePostgreSQLRow-level security
Reports
jsPDF
Testing
VitestPlaywrightpgTAP

07Technical Challenges & What I Learned

Technical Challenges & What I Learned

  1. Encoding a rulebook

    Turning the IHF 2026 beach rules into a pure, tested domain layer kept the console simple and the statistics consistent.

  2. Idempotent synchronization

    Every change carries an id and a revision, so retries after a lost connection never duplicate events, and rejected events never count on the local scoreboard.

  3. Conflicts as a user decision

    When two devices edit the same data, the app shows the conflict instead of silently picking a winner.

  4. Updating a PWA without losing data

    A new version waits until pending changes are uploaded before reloading, and the service worker never touches the local database.