How srikanthnagudu2909/chess works
This repository implements a browser-based multiplayer chess app: users enter through the web UI, authenticate or play as guests, find or join rooms, and play realtime games with clocks and chat. The backend handles HTTP authentication and leaderboard requests alongside Socket.IO room and game events; game results update user statistics. The excerpts show the main route, auth, and realtime paths, but omit portions of socket event handling and most page implementations, so uncertain wiring is left out.
Main entry points: App.jsx App routes · index.js HTTP and socket server · user.model.js User records · auth.rotues.js Auth routes
Components 21
Web app
- App routes
frontend/src/App.jsx - Lobby
frontend/src/pages/Lobby.jsx - Game room UI
frontend/src/pages/Room.jsx - Login and signup
frontend/src/pages/Login.jsx - Profile
frontend/src/pages/Profile.jsx - Leaderboard view
frontend/src/pages/Leaderboard.jsx - Guest entry
frontend/src/pages/Guest.jsx
Identity
- Auth state
frontend/src/slices/authSlice.js - HTTP client
frontend/src/api/client.js - Auth routes
backend/routes/auth.rotues.js - Auth controller
backend/controller/auth.controller.js - HTTP auth guard
backend/middleware/verifyAuth.js
Realtime chess
- Socket client
frontend/src/socket.js - Room and game state
backend/index.js
Backend services
- HTTP and socket server
backend/index.js - User records
backend/models/user.model.js - Leaderboard route
backend/routes/leaderboard.routes.js - Leaderboard query
backend/controller/leaderboard.controller.js - Avatar upload endpoint
backend/index.js
Other components
- Player
- MongoDB
Connections 28
- Player → App routes: uses
- App routes → Auth state: checks session
- App routes → Lobby: routes to
- App routes → Game room UI: routes to
- App routes → Login and signup: routes to
- App routes → Profile: routes to
- App routes → Leaderboard view: routes to
- App routes → Guest entry: routes to
- Auth state → HTTP client: requests
- Login and signup → Auth state: dispatches
- Leaderboard view → HTTP client: requests
- Game room UI → Socket client: emits events
- Socket client → HTTP and socket server: Socket.IO events
- HTTP and socket server → Socket client: broadcasts events
- HTTP client → HTTP and socket server: HTTP requests
- HTTP and socket server → Auth routes: mounts routes
- Auth routes → Auth controller: dispatches
- Auth routes → HTTP auth guard: guards fetch
- HTTP auth guard → User records: loads user
- Auth controller → User records: reads and writes
- HTTP and socket server → Leaderboard route: mounts routes
- Leaderboard route → Leaderboard query: dispatches
- Leaderboard query → User records: queries rankings
- HTTP and socket server → Room and game state: handles events
- Room and game state → User records: updates player stats
- HTTP and socket server → MongoDB: connects
- User records → MongoDB: persists records
- HTTP and socket server → Avatar upload endpoint: serves upload