Skip to content

Node.js and Socket.io project that allows you play chess with your friends online.

License

Notifications You must be signed in to change notification settings

fratorgano/SocketChess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Current features

  • 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

Try it

If you want to try it on your local machine, you just need to run some simple commands

  1. Either download the repo or clone it (git clone https://github.com/fratorgano/SocketChess/)
  2. Go to the folder you cloned it to
  3. Run the following commands
    1. npm install (Which install all the modules needed but wasm-chess-algorithms)
    2. git clone https://github.com/fratorgano/wasm-chess-algorithms in a separate folder
    3. wasm-pack build --target nodejs --out-dir <path-to-node-modules-folder>/wasm-chess-algorithms in the wasm-chess-algorithms folder to compile the rust code to wasm
    4. npm start (Starts the server on localhost:3001)

Dependencies/Modules Used

Server-side

  • 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

Client-side

License

SocketChess is released under the MIT License.

About

Node.js and Socket.io project that allows you play chess with your friends online.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •