This project is a web-based chess game built using WebSocket, Express, and EJS. It allows players to connect in real-time, get paired into rooms, and play against each other. The game handles multiple players and ensures smooth gameplay through efficient room management.
Demo Link: https://chess-com-vhzl.onrender.com
Players can join a room and play against another player in real-time using WebSocket.
The game pairs players in rooms for a 1v1 match.
The game state is maintained even if a player refreshes the page.
The app uses chess.js for validating moves.
Support for spectators to watch ongoing games.
Backend: Express.js for server management and WebSocket for real-time communication.
Frontend: EJS templates for rendering dynamic content.
Chess Logic: Chess.js for game logic, including move validation and piece interaction.
WebSocket: Real-time communication between players.
Clone the repository:
git clone https://github.com/Kartik989-max/chess.com.git
Navigate to the project directory:
cd chess.com
Install the dependencies:
npm install
Start the server:
npm start
Open your browser and go to http://localhost:3000 to play the game.
Open the app in your browser.
Wait to be paired with another player.
Once paired, the chess game will begin automatically.
Make your moves, and the game will handle turn-based play.
If you refresh the page, the game will restore your state in the same room.
Contributions are welcome! Please open an issue or a pull request if you'd like to contribute or fix a bug.
This project is licensed under the MIT License. See the LICENSE file for more details.
Feel free to adjust this based on any additional features or details you want to highlight!