Skip to content

aedobrynin/hydraChess

Repository files navigation

Hydra Chess

Hydra Chess is a Flask application to play chess online Tested on Python 3.7+ (PyPy 7.3.1+) and Redis 5.0.5 Interface

Prerequisites

  1. Create new Python venv and install requirements.
python3 -mvenv dev
source dev/bin/activate
pip3 install -r requirements.txt
  1. Install Redis
sudo apt install redis
  1. Check configs in hydraChess/config.py and update them if needed.

Running

You can run everything using scripts if:

  1. Your env is in "dev" directory
  2. You didn't changed scripts directory name (scripts).

You have 2 possible ways to run everything using scripts:

  1. Run it in 5 separate terminals using scripts/run_all_gnome_terminal.sh
  2. Run it in one tmux window using scripts/run_all_tmux.sh (tmux must be installed)

In tmux everything looks like this: tmux

Tests

The API and login system are covered by tests. You can run them using python3 -m unittest from the project directory. Test network config can be found in hydraChess/config.py.

The gaming part was tested manually and using load testing module.

License

This project is licensed under the GPLv3 License - see the LICENSE file for details.

Used libraries

  • chess.js - Used to check moves and game state on client side.
  • chessboard.js - Client side chess board
  • Celery - Used to run different tasks on server side
  • Flask - Main server side framework
  • rom - Redis object mapper