How vgebrev/leagr works
Leagr is a multi-league web app for organizing social five-a-side football. Organisers and players use league pages to manage signups, draw teams, schedule and record matches, then view standings, rankings, awards, and recaps; Fantasy League adds a stats-scored weekly squad game. The graph follows the documented UI/API/domain split and sampled server calls. The README describes JSON-file storage and optional Mailgun/OpenAI integrations; unsampled routes and feature internals are represented only at their existing enclosing directories.
Main entry points: routes League pages · data.js League JSON data · playerManager.js Player management · rankings.js Rankings and ELO
Components 23
League experience
- League pages
src/routes - Reusable UI
src/components - Client services
src/lib/client/services
API boundary
- Feature API routes
src/routes/api - Player API
src/routes/api/players/+server.js - Team API
src/routes/api/teams/+server.js - Games API
src/routes/api/games/+server.js - Discipline API
src/routes/api/discipline/+server.js
League operations
- Player management
src/lib/server/playerManager.js - Team generation
src/lib/server/teamGenerator.js - Discipline rules
src/lib/server/discipline.js - Match scheduling
src/lib/server/gameScheduler.js - Knockout tournaments
src/lib/server/knockoutManager.js
Competition insights
- Rankings and ELO
src/lib/server/rankings.js - League standings
src/lib/server/standings.js - Fantasy League
src/lib/server/fantasyManager.js - News and momentum
src/lib/server/newsFeed.js - Year recap
src/lib/server/yearRecapManager.js
State and integrations
- League JSON data
src/lib/server/data.js - League access
src/lib/server/league.js - Recovery email
src/lib/server/email.js - OpenAI image service
src/lib/server/openaiImageClient.js
Other components
- Organiser or player
Connections 29
- Organiser or player → League pages: uses
- League pages → Reusable UI: renders
- League pages → Client services: requests data
- Client services → Feature API routes: calls
- Feature API routes → League access: validates league
- Player API → Player management: manages players
- Player API → Discipline rules: evaluates signup
- Team API → Player management: loads players
- Team API → Team generation: generates teams
- Team API → OpenAI image service: requests logos
- Games API → Match scheduling: builds schedule
- Discipline API → Discipline rules: reads records
- Player management → League JSON data: loads state
- Player management → Rankings and ELO: loads rankings
- Discipline rules → League JSON data: reads and writes
- Match scheduling → League JSON data: reads and writes
- Rankings and ELO → League JSON data: loads history
- League standings → League JSON data: reads results
- Fantasy League → League JSON data: reads session data
- News and momentum → League standings: loads standings
- News and momentum → Rankings and ELO: loads rankings
- Year recap → League JSON data: loads season data
- League access → Recovery email: sends recovery
- League pages → Knockout tournaments: features bracket
- League pages → Fantasy League: features fantasy
- League pages → Rankings and ELO: shows rankings
- League pages → League standings: shows table
- League pages → News and momentum: shows feed
- League pages → Year recap: shows recap