Skip to content

* Vanilla Java Script chess: play with your friends, create multiplayer room, play with Stockfish, Login/Register, ELO system and puzzles.

Notifications You must be signed in to change notification settings

rodolfoinfantini/chess

Repository files navigation

Chess!

Vanilla JS Chess with Stockfish and MULTIPLAYER!

Click here to Play it!
Made with vanilla JavaScript, using socket.io, Node JS, MySQL and Stockfish.js.

Summary

  1. Demo
  2. Run locally
  3. Rules
  4. Draw
  5. Game modes
  6. Multiplayer
  7. Puzzles
  8. Settings
  9. Login and Register

Demo:

Watch the video

Run locally:

  • You can run it without Docker using node 16 (It MUST be 16) providing the environment variables in the .env file. But it is easier to run with the Dockerfile and docker compose:
  1. Install Docker and Docker Compose.

  2. Build the docker image:

docker build . -t chess
  1. (IMPORTANT) Create the db folder:
mkdir db/data
  1. Change the docker-compose.yml file:
  • Lines 23 and 24 to use a valid outlook email and password.
EMAIL_USER: user@outlook.com #it must be an outlook email
EMAIL_PASS: password #the outlook email password
  1. Run the container:

    1. Keep attached:
    docker compose up
    
    1. Run in background:
    docker compose up -d
    
  2. Stop the container:

docker compose down
  1. Now, if you want to update the running container just do (no need to execute the last steps anymore):
npm run deploy
  • It will stop the container, rebuild the image and start the container again.

Rules:

  • Pieces movement
  • Check and checkmate
  • En passant
  • Castling
  • Pawn promotion

Draw:

  • By repetition
  • Fifty move
  • Stalemate

Checkmate Screenshot

Game modes:

  • Play over the board
  • Play against the Stockfish Engine
  • Stockfish against itself
  • Create a MULTIPLAYER room to play with your friends! Game mode Screenshot

Multiplayer:

  • Create and Join Multiplayer Games:

Create Game Screenshot Join Game Screenshot

Puzzles:

  • 300,000 puzzles
  • Filter by rating and theme Puzzle Screenshot

Settings:

  • Configure piece animation speed
  • Set the visibility of the moves indicators
  • Select between 26 board themes
  • Select between 22 pieces skins Settings Screenshot

Login and Register:

Login Screenshot Register Screenshot