How ai-chess-training/llm-chesscoach works
LLM-ChessCoach accepts chess games for Stockfish and LLM-assisted feedback, and also offers authenticated mobile API workflows for live play, analysis, and purchase-backed game access. The graph separates API orchestration, chess analysis, identity and entitlements, and session state. Relationships reflect the README and shown imports/calls; some API wiring is supported only by the API module’s source-index references, and unsampled details are not expanded.
Main entry points: api_server.py REST and SSE API · live_sessions.py Live game sessions · auth_service.py Backend authentication · app_store.py StoreKit verification
Components 22
API workflows
- REST and SSE API
api_server.py - API models
schemas.py
Chess analysis
- Batch PGN analysis
analysis_pipeline.py - Game analysis
analyze_games.py - Lichess importer
export_lichess_games.py - Stockfish analyzer
stockfish_engine.py - Move feedback logic
move_analysis.py - LLM and rule coach
llm_coach.py
Identity and access
- Apple identity verification
apple_auth.py - Backend authentication
auth_service.py - JWT utilities
token_utils.py - StoreKit verification
app_store.py - User and game balances
entitlements.py
Session and configuration
- Live game sessions
live_sessions.py - Environment loading
env_loader.py - Runtime configuration
config.py
Legacy interface
- Legacy Streamlit UI
legacy/chess_coach_app.py - Legacy React UI
legacy/react-ui/app.js
Other components
- Player / mobile client
- OpenAI-compatible service
- Apple identity / App Store
- Redis session store
Connections 24
- Player / mobile client → REST and SSE API: sends requests
README.md - REST and SSE API → Apple identity verification: verifies identity
api_server.py - Apple identity verification → Apple identity / App Store: verifies token
README.md - REST and SSE API → Backend authentication: authenticates requests
api_server.py - Backend authentication → User and game balances: loads user
auth_service.py - Backend authentication → JWT utilities: signs and checks
auth_service.py - REST and SSE API → StoreKit verification: verifies purchase
README.md - StoreKit verification → Apple identity / App Store: verifies transaction
README.md - StoreKit verification → JWT utilities: uses token helpers
app_store.py - REST and SSE API → User and game balances: checks game balance
api_server.py - REST and SSE API → Live game sessions: creates and updates
README.md - Live game sessions → Redis session store: persists sessions
README.md - Live game sessions → Stockfish analyzer: analyzes positions
live_sessions.py - Live game sessions → LLM and rule coach: requests feedback
live_sessions.py - Batch PGN analysis → Stockfish analyzer: analyzes positions
analysis_pipeline.py - Batch PGN analysis → LLM and rule coach: requests feedback
analysis_pipeline.py - LLM and rule coach → OpenAI-compatible service: requests coaching
llm_coach.py - Lichess importer → Apple identity / App Store: fetches Lichess games
export_lichess_games.py - Lichess importer → Game analysis: starts analysis
export_lichess_games.py - Game analysis → Stockfish analyzer: runs analysis
analyze_games.py - REST and SSE API → Batch PGN analysis: analyzes submitted PGN
README.md - REST and SSE API → API models: uses response models
api_server.py - Legacy Streamlit UI → Lichess importer: uses importer
legacy/chess_coach_app.py - Environment loading → Runtime configuration: configures runtime