Installation Guide

Run on your own computer with Docker

  1. Install Docker

  2. Install Docker Compose

  3. Install Git

  4. Clone this repository and change directory to BAR_API

  5. Build docker images

docker compose build
  1. Run docker containers (-d is detached)

docker compose up -d
  1. Load http://localhost:5000/ in a web browser. Enjoy :)

Run on your own computer without Docker

  1. Install MySQL or Maria DB

  2. Install Redis

  3. Install Python or Pypy. Note: Python 2 is not supported.

  4. Install Git

  5. (Optional) On Debian based systems, you may also need to install libmysqlclient-dev and python3-dev. On FreeBSD, you may need to install py38-sqlite3. We will update this step as we come across more OS dependencies. You may also need to install default-libmysqlclient-dev and build-essential.

  6. Clone this repository and change directory to BAR_API

  7. Set up a virtual environment

python3 -m venv venv
  1. Activate the virtual environment. Bash/Zsh:

source venv/bin/activate

csh/tcsh:

source venv/bin/activate.csh
  1. Install requirements

pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
  1. Copy config/BAR_API.cgi to your preferred directory, for example:

cp config/BAR_API.cgi ~/.config/

Add, update, and modify passwords and environment variables as needed.

  1. Copy ./config/init.sh to BAR_API directory:

cp config/init.sh .

Change passwords in ./init.sh and run this script to load the databases:

./init.sh

Then delete ./init.sh.

  1. Edit ./api/__init__.py and update the location of your BAR_API.cfg file if you have changed it.

  2. Run pytest. Tests should pass if the system is set up correctly.

  3. Run python app.py to start.

  4. Load http://localhost:5000/ in a web browser. Enjoy :)