How tungpham42/cotuongchamtop works
This repository is a Vietnamese Xiangqi web application. Players can find opponents, play in rooms, and use puzzles, tournaments, chat, and AI analysis; the tree also shows account, content, and administration features. The sampled room controller demonstrates room updates, matchmaking, and broadcasts, while the analysis controller calls the engine and AI service. Other capabilities are represented by their named controllers and services, but their internal wiring was not sampled. The README describes Laravel rather than this product, so product capabilities are inferred from the tree and excerpts.
Main entry points: database.php Application database · RoomController.php Room endpoints · ChessAnalysisController.php Analysis API · LoginController.php Login and identity
Components 28
Web entry
- Room endpoints
app/Http/Controllers/RoomController.php - Game endpoints
app/Http/Controllers/GameController.php - Puzzle endpoints
app/Http/Controllers/PuzzleController.php - Tournament endpoints
app/Http/Controllers/TournamentController.php - Analysis API
app/Http/Controllers/Api/ChessAnalysisController.php
Play and community
- Room services
app/Services/RoomService.php - Tournament services
app/Services/TournamentService.php - Puzzle services
app/Services/PuzzleService.php - Player chat
app/Http/Controllers/ChatController.php - Live room events
app/Events/RoomUpdated.php
Accounts and content
- Login and identity
app/Http/Controllers/Auth/LoginController.php - User endpoints
app/Http/Controllers/UserController.php - Articles
app/Http/Controllers/ArticleController.php - Administration
app/Http/Controllers/AdminController.php - Login rewards
app/Actions/User/AwardLoginKarmaAction.php
Analysis engines
- Xiangqi analysis
app/Services/XiangqiEngineService.php - AI coach
app/Services/GroqChessService.php - Worker pool client
app/Services/XiangqiEngineClient.php - Engine worker
app/Console/Commands/XiangqiEngineWorkerCommand.php - Pikafish process
app/Services/Xiangqi/PikafishProcess.php
Domain data
- Application database
config/database.php - Rooms
app/Models/Room.php - Users
app/Models/User.php - Games
app/Models/Game.php - Puzzles
app/Models/Puzzle.php - Tournaments
app/Models/Tournament.php
Other components
- Players
- Groq AI service
Connections 22
- Players → Room endpoints: request rooms
- Players → Game endpoints: play games
- Players → Puzzle endpoints: solve puzzles
- Players → Tournament endpoints: enter tournaments
- Players → Analysis API: request analysis
- Players → Login and identity: sign in
- Players → Player chat: send messages
- Room endpoints → Rooms: read and save
- Room endpoints → Live room events: broadcast updates
- Login and identity → Users: find or create
- Login and identity → Login rewards: award login
- Analysis API → Xiangqi analysis: analyze position
- Analysis API → AI coach: request coaching
- AI coach → Groq AI service: request AI response
- Xiangqi analysis → Pikafish process: run engine
- Engine worker → Pikafish process: start and manage
- Worker pool client → Engine worker: send socket requests
- Rooms → Application database: persist room state
- Users → Application database: persist accounts
- Games → Application database: persist games
- Puzzles → Application database: persist puzzles
- Tournaments → Application database: persist tournaments