Skip to content

A online chess game built with React and Next.js. It uses Socket.io and MongoDB. Allows 1v1 games and also to play against a computer.

Notifications You must be signed in to change notification settings

omarabdiwali/next-chess

Repository files navigation

chess

A online chess game created with React, Next.js, and Socket.io, with a MongoDB Cluster as a database. It is a chess board, available with all moves and rules, excluding en passant.

A text input is given at the home page, where users can join a room with a code, or automatically create a room. These socket rooms only allow 2 people, and reconnection is available.

The MongoDB Cluster stores information about the rooms, which include the users, the current positions, who's turn it is, and the code. To be able to reuse codes, the document in the collection is automatically deleted once the users are equal to 0.

Valid positions for the piece are shown on your screen in red, and the previous position played by the opposition is also highlighted. All of the functions were written by me, including the logic for the pieces, when checkmate happens, and handling sockets and API calls

Chess board

Opponent disconnection

Vaild movements

Checkmate

About

A online chess game built with React and Next.js. It uses Socket.io and MongoDB. Allows 1v1 games and also to play against a computer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published