These instructions assume you have python, virtualenvwrapper and node installed. Flask and webpack will be installed in the course of these instructions. The Poker Simulator project is used as an imported package. Whilst it is still in development, you probably want to keep it as an accessible project folder rather than getting it through pip install
. Clone it from Poker Simulator and keep it updated through regular calls to git pull
.
-
Navigate to the Poker App directory
cd /path/to/poker_app
-
Create a new virtual environment
mkvirtualenv poker --python=python3
-
If your virtual environment is not immediately activated, enter it with
workon poker
-
Install required python packages
pip install -r requirements.txt
-
Add the directory containing your Poker Simulator package to the virtual environment path
add2virtualenv /path/to/packages
where the Poker Simulator package is located at
/path/to/packages/poker_simulator
-
Install the required node modules
npm install
-
Compile the javascript
webpack
Two scripts have been provided to provide easy execution:
pokerapp-debug.sh
pokerapp.sh
On Linux / BSD systems, simply executing these in a console should work. On windows, use:
sh pokerapp.sh
Once this is running, open a web browser, and head to localhost:5000
.
Use pokerapp-debug.sh
to run a development server that will reload whenever there is a change to the python webserver code. To have the javascript compile as you edit it, open another terminal and run
webpack --watch
Use pokerapp.sh
to run a webserver visible to other devices. You will still be able to run webpack watcher for live javascript editing as this does not affect the python server.
Some browsers, e.g. Chrome on mobile, will attempt to cache the js file on page load and will therefore not register any changes you make. To get around this, use Chrome's incognito mode. You will still need to close the browser window and reopen it if any code changes but at least you won't need to clear your cache every time.
-
Use
ctrl+c
to kill the webserver and webpack watcher in each of their terminal windows -
Exit the virtual environment
deactivate