A web-based version of the classic board game Othello, featuring three different game modes, AI opponents, and real-time multiplayer gameplay using WebSockets. Users can register to track their game history and performance statistics.
- Three Game Modes:
- Human vs AI: Play against one of three AI opponents.
- Human vs Human: Play with another player on the same device.
- Play with Your Friend: Connect with a friend on a different device using a unique room ID.
- AI Opponents:
- Minimax with Alpha-Beta Pruning
- Monte Carlo Tree Search (MCTS)
- Random Moves
- Real-Time Multiplayer:
- Players can create or join a game room using WebSockets.
- If a player disconnects, the game waits for them to reconnect.
- User Registration & Statistics:
- Users can register and track their game history.
- View total games played, win/loss records, and AI opponent stats.
- Monthly game activity visualized with a bar chart.
- View the last five games with detailed mode and results.
- Database & Hosting:
- Uses MongoDB to store game and user data.
- Frontend is deployed on Vercel.
- Backend runs on Google Cloud Run.
- Node.js
- Express.js
- MongoDB
- Socket.io
- React (with Vite)
- ShadCN (UI components)
- Recharts (data visualization)
Play against one of three AI strategies:
- Minimax with Alpha-Beta Pruning: Uses a depth-limited search to make optimal moves.
- Monte Carlo Tree Search (MCTS): Uses simulations to evaluate move strength.
- Random Moves: Selects moves randomly.
Two players take turns playing on the same screen.
- One player creates a game room and shares the room ID.
- The second player joins using the room ID.
- WebSocket communication keeps the game in sync.
- If a player disconnects, the game waits for reconnection before continuing.
cd backend
npm installMONGO_URL=
JWT_SECRET=
SESSION_SECRET=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_CALLBACK_URL=cd ../frontend
npm installVITE_API_URL=
VITE_SOCKET_URL=cd backend
npm startcd frontend
npm run dev