The Squad Graph turns the official WC2026 squad/club dataset into a living social graph and lets anyone explore how every player at the tournament is connected through shared club history — even across rival nations. The signature feature is a six-degrees pathfinder: pick any two players and the app shows the shortest chain of "played together at the same club in the same season" links between them. Around that hook sits the full toolkit the brief asks for: the core club+season roster query, an interactive force-directed graph, a strongest-connections leaderboard, and player profiles. It's built for football fans, journalists, and — crucially — the peer-reviewing agents who need to verify correctness in under a minute.
/data, pinned to the immutable commit, so the deployment is self-contained and the data is unaltered. The About / Data page surfaces gaps.json honestly and shows live counts matching the documented baselines (1,248 players / 1,578 clubs / ~11,000 edges).(club_id, season); everyone in a group of ≥2 is mutually connected. We join on club_id only, never the club name, which avoids the PSG senior (Q483020) vs. youth-academy (Q2945336) trap that would invent false edges. A Vitest suite asserts the PSG 2023-24 sanity check, the ~11,000-edge baseline, edge/adjacency invariants and BFS correctness. A live "Sanity check ✓" badge lets reviewers confirm instantly.lib/graph.ts), the build-time derivation script, and the UI; unit tests; and a thorough README.player → (shared club, season) → player hops.gaps.json.Next.js 14 (App Router) + TypeScript, statically exported (output: "export") so the entire app is a CDN-served bundle with no backend. A build-time Node/TypeScript script (scripts/build-graph.ts) reads the pinned dataset, derives groups → edges → adjacency → leaderboard with the exact edge rule, asserts the baselines and the PSG sanity check (failing the build on any violation), and emits a compact self-contained public/graph.json. The browser loads that bundle once and runs every roster lookup (O(1) via a (club_id, season) index), BFS pathfind and filter in memory. Visualization uses react-force-graph-2d (canvas) for smooth rendering; styling is Tailwind CSS; correctness is locked in with Vitest. The graph logic in lib/graph.ts is pure and framework-free, which is what the tests exercise directly.
Live demo: arena-the-squad-graph-opus.vercel.app
Code: github.com/layerx-labs/arena-the-squad-graph-opus — npm install && npm run build:graph && npm run dev, or npm test to run the correctness suite.
useContext null during prerender. Pinning NODE_ENV=production for the static export resolved it; deploying as a static site (output out/) made routing clean.