How haidarmahdi099/online-chess-platform works
ChessPlatform is an online chess product: players authenticate, find or create games, play with authoritative server-side rules and live updates, then use puzzles, ratings, tournaments, profiles, and position analysis. The graph preserves those documented capabilities and distinguishes synchronous APIs from asynchronous event work. Source excerpts show several controller-to-service calls and the Stockfish engine integration; many subsystem internals and cross-service event links are documented only at README level, so those links are dashed where implementation wiring was not sampled.
Main entry points: Program.cs YARP gateway · index.tsx Chess web app · GamesController.cs Game API · GameService.cs Game workflows
Components 25
Web client
- Chess web app
frontend/src/routes/index.tsx - Live game client
frontend/src/lib/game/useLiveGame.ts - 3D board renderer
frontend/src/lib/chess3d/engine.ts
API entry
- YARP gateway
backend/src/Gateway/Gateway/Program.cs
Chess services
- Identity and social
backend/src/Services/Identity/Identity.Api/Auth/AuthController.cs - Game API
backend/src/Services/Game/Game.Api/Controllers/GamesController.cs - Game workflows
backend/src/Services/Game/Game.Application/Games/GameService.cs - Chess game rules
backend/src/Services/Game/Game.Domain/Entities/Game.cs - Realtime hub
backend/src/Services/Realtime/Realtime/Hubs/GameHub.cs - Puzzle solving
backend/src/Services/Puzzle/Puzzle.Api/Controllers/PuzzlesController.cs - Ratings and leaderboard
backend/src/Services/Rating/Rating.Api/Controllers/RatingsController.cs - Rating event consumer
backend/src/Services/Rating/Rating.Infrastructure/Messaging/RatingEventConsumer.cs - Tournament management
backend/src/Services/Tournament/Tournament.Api/Controllers/TournamentsController.cs - Tournament event handler
backend/src/Services/Tournament/Tournament.Infrastructure/Messaging/GameFinishedConsumer.cs - Position analysis API
backend/src/Services/Analysis/Analysis.Api/Controllers/AnalysisController.cs - Stockfish engine
backend/src/Services/Analysis/Analysis.Infrastructure/Engine/StockfishEngine.cs
Messaging and state
- Identity records
backend/src/Services/Identity/Identity.Infrastructure/Data/IdentityDbContext.cs - Game records
backend/src/Services/Game/Game.Infrastructure/Persistence/GameDbContext.cs - Puzzle records
backend/src/Services/Puzzle/Puzzle.Infrastructure/Persistence/PuzzleDbContext.cs - Rating records
backend/src/Services/Rating/Rating.Infrastructure/Persistence/RatingDbContext.cs - Tournament records
backend/src/Services/Tournament/Tournament.Infrastructure/Persistence/TournamentDbContext.cs - Kafka events
- Redis backplane
- PostgreSQL
Other components
- Player
Connections 35
- Player → Chess web app: uses
- Chess web app → YARP gateway: HTTP requests
- Chess web app → YARP gateway: SignalR connection
- Chess web app → Live game client: runs live play
- Chess web app → 3D board renderer: renders board
frontend/src/lib/chess3d/engine.ts - YARP gateway → Identity and social: routes requests
- YARP gateway → Game API: routes requests
backend/src/Gateway/Gateway/Program.cs - YARP gateway → Puzzle solving: routes requests
- YARP gateway → Ratings and leaderboard: routes requests
- YARP gateway → Tournament management: routes requests
- YARP gateway → Position analysis API: routes requests
- Identity and social → Identity records: reads and writes
backend/src/Services/Identity/Identity.Api/Auth/AuthController.cs - Game API → Game workflows: invokes
backend/src/Services/Game/Game.Api/Controllers/GamesController.cs - Game workflows → Chess game rules: validates game state
backend/src/Services/Game/Game.Application/Games/GameService.cs - Game workflows → Game records: persists games
- Live game client → YARP gateway: sends game actions
- YARP gateway → Realtime hub: routes hub
- Realtime hub → Live game client: broadcasts updates
- Puzzle solving → Puzzle records: loads and records
backend/src/Services/Puzzle/Puzzle.Api/Controllers/PuzzlesController.cs - Ratings and leaderboard → Rating records: reads ratings
- Kafka events → Rating event consumer: delivers events
- Rating event consumer → Rating records: updates ratings
- Kafka events → Tournament event handler: delivers events
- Tournament event handler → Tournament records: updates progress
- Tournament management → Tournament records: reads and writes
- Position analysis API → Stockfish engine: evaluates position
- Stockfish engine → Position analysis API: returns evaluation
- Realtime hub → Redis backplane: scales connections
- Game API → Kafka events: publishes game events
- Puzzle solving → Kafka events: publishes attempt events
- PostgreSQL → Identity records: stores data
- PostgreSQL → Game records: stores data
- PostgreSQL → Puzzle records: stores data
- PostgreSQL → Rating records: stores data
- PostgreSQL → Tournament records: stores data