You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to the Australian Threatened Species Index (TSX) Repository
For information about the Australian Threatened Species Index project, see https://tsx.org.au
The code in this repository is responsible for data import and pre-processing of data, and visualsation of the generated trend graphs and associated data.
User Guide
The easiest way to learn about running the TSX workflow is to check out the User Guide at https://tsx.org.au/user-guide/
Developer Guide
1. Setup database (MySQL)
First create a new MySQL database.
You can call it anything but the instructions below assume it is named "tsx".
Initialise the database using the provided scripts:
mysql tsx < data/sql/create.sql
mysql tsx < data/sql/init.sql
Copy example configuration:
cp tsx.conf.example tsx.conf
Then edit the [database] section in tsx.conf to match the database you just created.
2. Setup python virtual environment and install dependencies
pip install pipenv # if you don't have virtualenv already
pipenv sync
3. Import taxa
python -m tsx.import_taxa [path to TaxonList.xlsx]
# Start back-end API:
FLASK_DEBUG=1 FLASK_APP=tsx/api/api.py python -m flask run
# Start front-end (in a separate terminal):cd web
npm install
npm run dev-data
Setup database (see instructions for dev environment)
Install tsx package:
python setup.py install
Edit configuration in /opt/tsx/conf/tsx.conf
Setup as service (Linux):
sudo cp etc/init.d/tsxapi /etc/init.d/
sudo service tsxapi start
Deploy static resources:
# If you don't have have node/npm installed:
#
# sudo apt install npm nodejs
#
# .. or might need a more recent version ..
#
# sudo apt-get remove nodejs npm ## remove existing nodejs and npm packages
# sudo apt-get install curl
# curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
# sudo apt-get install -y nodejs
#
cd web
npm install
(TODO - add step to point code to REST API base URL)
npm run build
sudo cp -r dist/ /var/www/tsx/
sudo chown -R www-data:www-data /var/www/tsx