- 📖 Introduction
- 🛠 Tech Stack
- ✨ Features
- 📸 Demonstration
- 🚀 Project Start Guide
- 🪛 Future Enhancements
- 👨💻 Author
- 🔗 Socials
This MERN Chess Game allows two players to connect and play a full game of chess in real-time using Socket.io. The goal is to demonstrate both real-time bi-directional communication using Socket.io and complex game logic like chess move validation, check/checkmate detection, and multiplayer syncing.
PlayChess is a modern, real-time multiplayer chess game built with React, Node.js, and Socket.io. It allows players to compete in online chess matches, track their game history, and analyze their performance.
Frontend:
- React.js
- TailwindCSS
- Axios
- React Router
- Socket.io-client
- zustand
Backend:
- Node.js
- Express.js
- MongoDB (optional for game history or matchmaking)
- Socket.io
- bcryptjs & JWT (for authentication)
- ♟️ Classic two-player chess gameplay
- 🔄 Real-time multiplayer via Socket.io
- ✅ Valid chess move rules + turn management
- 📋 Leaderboard system with ELO ratings
- 🧑 User profiles with bio, avatar, and stats
- 🕓 Game history (wins, losses, draws, opponents)
- 📊 Match analytics (opening, duration, result, mistakes)
- ⚙️ Account settings and preferences
- 🎯 Random matchmaking based on ELO rating
- 🌐 Secure game rooms via room IDs
- 📱 Responsive design with dark mode support
Can Send & Accept friend or game request
- Inbox : Inbox contains all the request from other player, it can be friend request and Game request.
- Message box : Message box contains all the message of actions like accepted a friend request and send a friend request.
- Online friends : Shows all online friends. If friend is online, then only you can send a game request to your friend.
- Search friends : Shows all online friends. If friend is online, then only you can send a game request to your friend.
- Node.js and npm installed
- MongoDB running locally or a cloud DB URI (e.g., MongoDB Atlas)
git clone https://github.com/Dev-omkarCh/PlayChess.git
cd play-chesscd backend
npm i express mongoose cors jsonwebtoken bcryptjs cookie-parser
npm i nodemon -D
npm run servercd frontend
npm create vite@latest .
npm i react-router-dom react-icons axios zustand
npm run devnpm install tailwindcss @tailwindcss/vite
npx tailwindcss init # if not works, create the file: tailwind.config.jsCreate a .env file inside the server/ directory with the following keys:
PORT=4000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret- Spectator Mode: Allow users to watch ongoing games.
- AI Opponent: Add a single-player mode with AI.
- Chat System: Enable in-game chat between players.
- Game Replay: Replay completed games move by move.
- Omkar Chikhale
- [email protected] 📧