How moinul924/chess_project works
This is a Spring Boot chess web app with a Java chess engine, human and engine play, matchmaking, and account features. A player interacts with the browser client, which communicates with game and account endpoints; the game controller coordinates sessions, moves, matchmaking, and recorded results. The engine handles legal positions and move selection, including the README-documented opening book, minimax search, and alpha-beta pruning. The README also documents FEN setup, undo, and board flipping. Some browser-to-server wiring and unsampled subsystems are not directly visible in the excerpts.
Main entry points: GameController.java Game endpoints · Board.java Board state and rules · gameController.js Game UI controller · AccountService.java Account and settings
Components 22
Browser client
- Game UI controller
src/main/resources/static/js/gameController.js - Board rendering
src/main/resources/static/js/boardRender.js - Move input
src/main/resources/static/js/drag.js - Game API client
src/main/resources/static/js/api.js - Authentication UI
src/main/resources/static/js/auth.js - Account API client
src/main/resources/static/js/accountApi.js
Game runtime
- Game endpoints
src/main/java/com/chess/GameController.java - Game session
src/main/java/com/chess/GameSession.java - Matchmaking queue
src/main/java/com/chess/MatchmakingQueue.java
Chess rules and engine
- Board state and rules
src/main/java/com/chess/Board.java - Piece move rules
src/main/java/com/chess/chessPiece - Move execution
src/main/java/com/chess/chessMove/Move.java - Engine search and evaluation
src/main/java/com/chess/Engine.java - FEN setup
src/main/java/com/chess/FEN.java
Accounts and records
- Account endpoints
src/main/java/com/chess/account/AccountController.java - Account and settings
src/main/java/com/chess/account/AccountService.java - Game records
src/main/java/com/chess/account/GameRecordService.java
Persistence
- Account storage
src/main/java/com/chess/account/AccountRepository.java - Profile storage
src/main/java/com/chess/account/PlayerProfileRepository.java - Settings storage
src/main/java/com/chess/account/UserSettingsRepository.java - Record storage
src/main/java/com/chess/account/GameRecordRepository.java
Other components
- Player
Connections 24
- Player → Game UI controller: plays through
- Game UI controller → Board rendering: renders with
src/main/resources/static/js/gameController.js - Game UI controller → Move input: uses input
src/main/resources/static/js/gameController.js - Game UI controller → Game API client: calls
src/main/resources/static/js/gameController.js - Game UI controller → Game endpoints: sends game requests
- Authentication UI → Account API client: uses
src/main/resources/static/js/auth.js - Account API client → Account endpoints: sends account requests
- Game endpoints → Game session: uses
src/main/java/com/chess/GameController.java - Game endpoints → Matchmaking queue: dispatches matchmaking
src/main/java/com/chess/GameController.java - Game endpoints → Board state and rules: manages moves
src/main/java/com/chess/GameController.java - Game endpoints → Account and settings: uses accounts
src/main/java/com/chess/GameController.java - Game endpoints → Game records: records results
src/main/java/com/chess/GameController.java - Game session → Board state and rules: maintains position
src/main/java/com/chess/GameSession.java - Game session → Engine search and evaluation: requests engine moves
src/main/java/com/chess/GameSession.java - Board state and rules → Piece move rules: requests legal moves
src/main/java/com/chess/Board.java - Piece move rules → Move execution: creates moves
src/main/java/com/chess/chessPiece/Pawn.java - Move execution → Board state and rules: updates position
src/main/java/com/chess/chessMove/Move.java - Engine search and evaluation → Board state and rules: searches positions
src/main/java/com/chess/Engine.java - FEN setup → Board state and rules: initializes position
src/main/java/com/chess/Board.java - Account endpoints → Account and settings: delegates account actions
src/main/java/com/chess/account/AccountController.java - Account and settings → Account storage: reads and writes
src/main/java/com/chess/account/AccountService.java - Account and settings → Profile storage: writes profiles
src/main/java/com/chess/account/AccountService.java - Account and settings → Settings storage: reads and writes settings
src/main/java/com/chess/account/AccountService.java - Game records → Record storage: persists records
src/main/java/com/chess/account/GameRecordService.java