How michael-harris-dr/fantasy_hockey works
This is a browser-based fantasy hockey player lookup and projection app backed by a FastAPI service. A user searches by surname; the browser requests player data, computes remaining-season projections from player stats and team games played, and displays current and projected stats. The backend validates API keys, resolves names against local NHL roster snapshots, enriches matches with NHL season statistics, and also serves team games played. Source also supports refreshing roster snapshots. The tree and sampled source show no persistent database beyond JSON files; frontend projection and rendering share index.js.
Main entry points: fan.py Hockey operations · index.js Search interface · endpoints.py FastAPI routes · helpy.py Player data helpers
Components 11
Browser app
- Search interface
index.js - Stat projections
index.js - Stats table
index.js
API service
- FastAPI routes
backend/endpoints.py - API key check
backend/security.py - Hockey operations
backend/fan.py - Player data helpers
backend/helpy.py
Roster data
- Team catalog
db/NHL_TEAMS.json - Roster snapshots
db/team_rosters
NHL integration
- NHL API
Other components
- Fantasy user
Connections 18
- Fantasy user → Search interface: searches
- Search interface → FastAPI routes: requests players
- Search interface → FastAPI routes: requests teams
- FastAPI routes → API key check: checks key
- FastAPI routes → Hockey operations: dispatches lookup
- FastAPI routes → Hockey operations: dispatches teams
- Hockey operations → Player data helpers: resolves players
- Player data helpers → Team catalog: reads teams
- Player data helpers → Roster snapshots: reads rosters
- Player data helpers → NHL API: fetches player stats
- Hockey operations → NHL API: fetches standings
- Hockey operations → Team catalog: reads teams
- Hockey operations → NHL API: fetches rosters
- Hockey operations → Roster snapshots: writes snapshots
- FastAPI routes → Search interface: returns JSON
- Search interface → Stat projections: projects stats
- Stat projections → Stats table: renders stats
- Search interface → Stats table: renders current stats