Squad Graph Explorer is a comprehensive web application that builds and visualizes a social graph of all 2026 World Cup players connected by their shared club history. It reveals hidden connections between players from rival national teams who were teammates at club level.
For: Football analysts, journalists, fans, and data enthusiasts interested in discovering the hidden web of connections between World Cup players.
players.json dataset (1,248 players, 1,578 clubs, 11,035 edges) with local fallback. Validates against gaps.json coverage gaps. Commits local copy for offline reliability.(club_id, season) tuples, creates edges between all pairs in each group. Uses Wikidata QIDs for joins, never club names. PSG 2023-24 sanity check passes (Vitinha, Nuno Mendes, GonΓ§alo Ramos included; JoΓ£o Neves excluded).GET /api/teammates?club_id={id}&season={season} returns all players who were teammatesGET /api/connection?player1_id={id}&player2_id={id} finds shortest path using BFSGET /api/strongest-connections ranks club-seasons by player countGET /api/graph returns full graph for visualization
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Vercel Deployment β
βββββββββββββββββββ¬ββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ€
β Frontend (React) β Backend (FastAPI) β Data (players.json + gaps.json) β
β - React 18 β - FastAPI 0.136 β - Loaded at startup β
β - TypeScript β - Python 3.12 β - In-memory cache β
β - react-force- β - Pydantic 2.13 β - Pre-computed indexes β
β graph β - requests 2.34 β β
β - D3.js 7.9 β - httpx 0.28 β β
β - Tailwind CSS β - uvicorn 0.49 β β
βββββββββββ¬ββββββββββ΄ββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββ
β β
β FastAPI (localhost:8000) β
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Browser β β In-Memory β
β (Vercel Edge) β β Graph β
βββββββββββββββββββ βββββββββββββββββββ
| Component | Technology | Purpose & Justification |
|---|---|---|
| Backend | FastAPI (Python 3.12) | Lightweight, async-ready, auto-generated OpenAPI docs, perfect for exposing query endpoints |
| Graph Processing | Pure Python (collections, itertools) | No external dependencies needed; implements reference algorithm exactly as specified |
| Frontend | React 18 + TypeScript + Vite | Fast iteration, strong typing, modern build tooling with HMR |
| Visualization | react-force-graph + D3.js | High-performance WebGL canvas rendering with force-directed layout and custom canvas objects |
| Styling | Tailwind CSS | Utility-first for rapid, consistent UI development |
| HTTP Client | axios | Promise-based HTTP client with interceptors for error handling |
| Deployment | Vercel | Free tier, automatic CI/CD from GitHub, global CDN, serverless functions for backend |
| Package Manager | pnpm | Fast, efficient dependency management with strict versioning |
players.json and gaps.json from CDN (with local fallback), builds graph and pre-computes indexesπ https://arena-the-squad-graph-mistral.vercel.app
The application is fully deployed and accessible. No installation or setup required!
# Clone the repository git clone https://github.com/layerx-labs/arena-the-squad-graph-mistral.git cd arena-the-squad-graph-mistral # Install frontend dependencies cd frontend pnpm install # Install backend dependencies cd ../backend pip install -r requirements.txt
# Terminal 1: Start backend cd backend uvicorn main:app --reload --port 8000 # Terminal 2: Start frontend cd frontend pnpm dev
The app will be available at http://localhost:3000 (frontend) and http://localhost:8000 (backend API).
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/teammates?club_id={id}&season={season} | Get teammates for club and season (CORE) |
| GET | /api/connection?player1_id={id}&player2_id={id} | Find degrees of separation between players |
| GET | /api/strongest-connections?min_players={n}&limit={n} | Get strongest club connections by player count |
| GET | /api/graph | Get complete graph data for visualization |
| GET | /api/players | List all players with filtering |
| GET | /api/clubs | List all clubs with filtering |
| GET | /api/players/{player_id} | Get detailed player information |
| GET | /api/clubs/{club_id} | Get detailed club information |
π Full API Documentation: Access interactive docs at /docs (Swagger UI) or /redoc (ReDoc) when the backend is running.
players.json, gaps.json)/backend/data/ for offline reliabilitygroup by (club_id, season) -> create edges between all pairsclub_id (Wikidata QID) for all joins, never club nameclub_season_to_players indexcd backend python -m pytest tests/ -v
# Install Vercel CLI npm install -g vercel # Deploy vercel
The application is configured with vercel.json for automatic deployment with:
/api/* β backend, /* β frontendNo environment variables required! The app uses:
| Criterion | Weight | How We Satisfy |
|---|---|---|
| Data Accuracy & Coverage | 20% | β Exact dataset from CDN, local copy committed, validation of 1,248 players / 1,578 clubs / 11,035 edges, gaps.json coverage tracking |
| Graph Correctness | 20% | β Reference algorithm implementation, club_id joins, PSG sanity check passes, edge count validated, 17 unit tests |
| Query & Visualization Usefulness | 20% | β REST API with 8+ endpoints, interactive D3.js visualization, multiple query interfaces, comprehensive filtering |
| Code Quality | 20% | β Type hints (Python + TypeScript), clean architecture, 17 passing tests, comprehensive documentation, modular structure |
| Write-up Clarity | 20% | β Comprehensive README, architecture diagrams, usage examples, API docs, rubric mapping, screenshots |
MIT License - Feel free to use, modify, and distribute.
Special thanks to:
Built for the AI Agent Hackathon - The Squad Graph
Connecting the world through football, one shared club history at a time.