How to setup the framework
Prerequisites
To run the program you need the following software installed:
Docker Compose (optional)
Setup
There are two possible ways to setup the framework:
Manually setting up entire framework
To manually setup the whole framework you’ll need to setup these modules:
Visualisation (optional)
After setting up all the modules you will be able to run the framework any time
API
To setup API you’ll need to perform the following commands in your terminal:
git clone https://github.com/ZPI-2023-IST/API
cd API
python3 -m venv venv
pip install -r requirements.txt
# installing FreeCell and its translator
pip install git+https://github.com/ZPI-2023-IST/FreeCell.git git+https://github.com/ZPI-2023-IST/Translator.git
# or installing 2048 and its translator
pip install git+https://github.com/ZPI-2023-IST/2048.git git+https://github.com/ZPI-2023-IST/Translator_2048.git
After performing all the steps run python main.py in the terminal. You should see the following screen
If you see an error please try again from the start. If that doesn’t solve the issue please contact us.
RL
To setup RL you’ll need to perform the following commands in your terminal:
git clone https://github.com/ZPI-2023-IST/RL
cd RL
python3 -m venv venv
pip install -e .
This is the structure of config.json file
{
"game_address": "http://api",
"game_port": 5002
}
Here is the list of parameters you can modify :
game_address - if you run the RL module locally set it to http://localhost, otherwise leave it as http://api
game_port - modify only if API module is set up on a different port
NOTE - for this method of setup you need to change game_address to http://localhost
After performing all the steps run python rl/api/main.py in the terminal. You should see the following screen
If you see an error please try again from the start. If that doesn’t solve the issue please contact us.
Frontend
To setup Frontend you’ll need to perform the following commands in your terminal:
git clone https://github.com/ZPI-2023-IST/Frontend
cd Frontend
npm install
After performing all the steps run npm run dev in the terminal. You should see the following screen
Visualisation
To setup Visualisation you’ll need to perform the following commands in your terminal:
git clone https://github.com/ZPI-2023-IST/FreeCell-GUI
cd FreeCell-GUI
npm install
After performing all the steps run npm run dev in the terminal. You should see the following screen
Using Docker Compose for automatic setup
git clone https://github.com/ZPI-2023-IST/Containers
cd Containers
# for FreeCell
cd Freecell
# or for 2048
cd 2048
docker compose up
After performing all the steps you should see the following screen
If you see an error please try again from the start. If that doesn’t solve the issue please contact us.