How jemish-jikadara/chessmaster-mern works
ChessMaster is a React chess app backed by an Express/MongoDB JSON API and Socket.IO multiplayer server. Players can register and manage profiles, play locally against a person or Stockfish, find online matches, manage friends, and review games and ratings. The graph follows the documented UI-to-service workflow and the sampled controller, hook, and server behavior; unsampled page and route details are represented only where the README or source index supports them.
Main entry points: axios.js HTTP Client · settingsController.js Settings Service · gameController.js Game Controller · server.js Express & Socket Server
Components 30
React Client
- App Router
Frontend/chess-master-react/src/App.jsx - Auth Context
Frontend/chess-master-react/src/context/AuthContext.jsx - HTTP Client
Frontend/chess-master-react/src/api/axios.js - Home & Matchmaking
Frontend/chess-master-react/src/pages/Home.jsx - Friends
Frontend/chess-master-react/src/pages/Friends.jsx - Profile & Settings
Frontend/chess-master-react/src/pages/Profile.jsx - Leaderboard
Frontend/chess-master-react/src/pages/Leaderboard.jsx - Game Replay
Frontend/chess-master-react/src/pages/Replay.jsx
Chess Play
- Local Play
Frontend/chess-master-react/src/pages/Play.jsx - Online Play
Frontend/chess-master-react/src/pages/OnlinePlay.jsx - Chess Board
Frontend/chess-master-react/src/components/ChessBoard.jsx - Local Game Hook
Frontend/chess-master-react/src/hooks/useChessGame.js - Online Game Hook
Frontend/chess-master-react/src/hooks/useOnlineGame.js - Chess Engine
Frontend/chess-master-react/src/lib/chessjs.js - Socket Client
Frontend/chess-master-react/src/lib/socket.js
API Services
- Express & Socket Server
Backend/chess-master/server.js - Auth Routes
Backend/chess-master/src/routes/authRoutes.js - Auth Controller
Backend/chess-master/src/controllers/authController.js - Game Routes
Backend/chess-master/src/routes/gameRoutes.js - Game Controller
Backend/chess-master/src/controllers/gameController.js - Friend Service
Backend/chess-master/src/controllers/friendController.js - Settings Service
Backend/chess-master/src/controllers/settingsController.js - Rating Updates
Backend/chess-master/src/utils/rating.js
Persistence
- User Records
Backend/chess-master/src/models/User.js - Friend Records
Backend/chess-master/src/models/Friend.js - Game Records
Backend/chess-master/src/models/Game.js - Move Records
Backend/chess-master/src/models/GameMove.js - Ratings
Backend/chess-master/src/models/Rating.js - Statistics
Backend/chess-master/src/models/Statistic.js
Other components
- Player
Connections 39
- Player → App Router: uses
Frontend/chess-master-react/src/App.jsx - App Router → Auth Context: provides auth
Frontend/chess-master-react/src/App.jsx - Auth Context → HTTP Client: sends requests
Frontend/chess-master-react/src/context/AuthContext.jsx - Home & Matchmaking → HTTP Client: loads data
Frontend/chess-master-react/src/pages/Home.jsx - Friends → HTTP Client: uses API
README.md - Profile & Settings → HTTP Client: loads profile
Frontend/chess-master-react/src/pages/Profile.jsx - Leaderboard → HTTP Client: loads games
README.md - Game Replay → HTTP Client: loads replay
README.md - Local Play → Local Game Hook: uses game hook
Frontend/chess-master-react/src/pages/Play.jsx - Local Play → Chess Board: renders board
Frontend/chess-master-react/src/pages/Play.jsx - Local Game Hook → Chess Engine: uses rules
Frontend/chess-master-react/src/hooks/useChessGame.js - Online Play → Online Game Hook: uses game hook
Frontend/chess-master-react/src/pages/OnlinePlay.jsx - Online Play → Chess Board: renders board
Frontend/chess-master-react/src/pages/OnlinePlay.jsx - Online Game Hook → Chess Engine: uses rules
Frontend/chess-master-react/src/hooks/useOnlineGame.js - Online Game Hook → Socket Client: gets socket
Frontend/chess-master-react/src/hooks/useOnlineGame.js - Online Game Hook → HTTP Client: saves game
Frontend/chess-master-react/src/hooks/useOnlineGame.js - HTTP Client → Express & Socket Server: HTTP API
README.md - Home & Matchmaking → Express & Socket Server: matchmaking socket
README.md - Socket Client → Express & Socket Server: Socket.IO
README.md - Express & Socket Server → Auth Routes: mounts routes
Backend/chess-master/server.js - Express & Socket Server → Game Routes: mounts routes
Backend/chess-master/server.js - Auth Routes → Auth Controller: dispatches
Backend/chess-master/src/routes/authRoutes.js - Game Routes → Game Controller: dispatches
Backend/chess-master/src/routes/gameRoutes.js - Auth Controller → User Records: reads and writes
Backend/chess-master/src/controllers/authController.js - Friend Service → User Records: searches users
Backend/chess-master/src/controllers/friendController.js - Friend Service → Friend Records: manages friendships
Backend/chess-master/src/controllers/friendController.js - Game Controller → Game Records: stores games
Backend/chess-master/src/controllers/gameController.js - Game Controller → Move Records: stores moves
Backend/chess-master/src/controllers/gameController.js - Game Controller → Rating Updates: updates ratings
Backend/chess-master/src/controllers/gameController.js - Game Controller → Ratings: reads ratings
Backend/chess-master/src/controllers/gameController.js - Rating Updates → Ratings: updates ratings
Backend/chess-master/src/utils/rating.js - Rating Updates → Statistics: updates statistics
Backend/chess-master/src/utils/rating.js - Rating Updates → User Records: updates user
Backend/chess-master/src/utils/rating.js - Settings Service → User Records: updates settings
Backend/chess-master/src/controllers/settingsController.js - Settings Service → Friend Records: deletes relations
Backend/chess-master/src/controllers/settingsController.js - Settings Service → Game Records: deletes games
Backend/chess-master/src/controllers/settingsController.js - Settings Service → Move Records: deletes moves
Backend/chess-master/src/controllers/settingsController.js - Settings Service → Ratings: deletes ratings
Backend/chess-master/src/controllers/settingsController.js - Settings Service → Statistics: deletes statistics
Backend/chess-master/src/controllers/settingsController.js