Small Node.js and Socket.io project that allows you play chess with your friends online.
This project was devolped on Node.js 16.10 but is currently deployed on 14.17.6.
Feel free to contribute!
You can play with it here: chess.fratorgano.me
- Drag and drop to move pieces
- See possible moves when hovering over a piece
- Highlight the king when in check
- Allow only legal moves
- Restart game, switch sides (both players need to agree)
- Show last move
- Automatic white/dark mode
- Play multiplayer with friends
- Play against the computer with various algorithms
- Spectate games
If you want to try it on your local machine, you just need to run some simple commands
- Either download the repo or clone it (git clone https://github.com/fratorgano/SocketChess/)
- Go to the folder you cloned it to
- Run the following commands
npm install(Which install all the modules needed but wasm-chess-algorithms)git clone https://github.com/fratorgano/wasm-chess-algorithmsin a separate folderwasm-pack build --target nodejs --out-dir <path-to-node-modules-folder>/wasm-chess-algorithmsin the wasm-chess-algorithms folder to compile the rust code to wasmnpm start(Starts the server on localhost:3001)
- Node.js - Javascript runtime
- socket.io - Library for realtime communication server-side
- Express - Web Framework
- workerpool - Library to manage workers to allow for non-blocking find-moves calls
- chess.js - Library for chess moves validation/generation
- wasm-chess-algorithms - Library that uses Rust for more performant chess game tree exploration
- socket.io-client - Library for realtime communication client-side
- chess.js - Library for chess moves validation/generation
- chessboard.js - JavaScript chessboard component
SocketChess is released under the MIT License.