Skip to content
ESalomons edited this page Jul 13, 2021 · 7 revisions

Preconditions

This project assumes that the following software is installed on an OSX / Linux system:

  • Python 3 (anaconda)
  • Node.js / npm
  • MongoDB

Bootstrap scripts can be found in the folder /scripts

Setup process

1. Create python environment

The folder /scripts/conda-env contains an environment.yml file that can be used to create an anaconda environment with all dependencies:

conda env create -f environment.yml

This will create an environment called "alm".

For more information about installation and usage of anaconda, see https://www.anaconda.com/

2. Start mongo server

A startup script for mongodb can be found in /scripts/start-scripts. In order for this script to work, the folders that are indicated in the file mongod.conf must exist.

3. Initialize mongodb

Run the create_initial_data.py script in /scripts/initialize-scripts

python create_initial_data.py

This script creates the initial data needed for an application. Mainly it created a database called "general" and creates an administrator with these credentials:

Email: admin@admin.com
Password: admin

4. Install npm dependencies

From the /frontend folder run

npm install

This will install all dependencies locally.

5. Create mailer account

The backend system will mail new users their passwords. The system has been tested using gmail. In the file /backend/app.py add the credentials for this account, e.g.

app.config['MAIL_USERNAME'] = 'athletemailerbot'  
app.config['MAIL_PASSWORD'] = 'af33afd89XFvSPp4mfaafwab'  

When using gmail, you have to modify the security settings to allow less secure apps to have access to the account. This can be modified in https://myaccount.google.com/ (menu item Security Settings).

6. Start backend and frontend

Run the start scripts startBackend.sh and startFrontend.sh

7. Create a club

Open the address http://localhost:8080 in a browser and login as administrator. Open the (hamburger) menu on the left and add a new club (e.g. FC Ami).

Admin menu
Added club

This club name will translate into the database name fc_ami (lowercase, spaces converted to underscores). This database name must be used in the next steps.

database example
Database example

8. Import data formats

The import data formats are described in json files. An example is given in scripts/initialize-scripts/data/fc_ami_config.json. Per file the columns are described (including internal / database name, data resolvers etc).

This configuration can be imported using the import_configuration script. For this script, two arguments are required: database name and filename. The file needs to be placed in the data folder within the initialize-scripts folder.

Command to execute script:

python import_configuration.py <file_name.json> <database_name>

Example:

python import_configuration.py fc_ami_import_config.json fc_ami

!IMPORTANT

The import configuration has a specific structure. Detailed information can be found in the page Import System

9. Import machine learning configuration

The machine learning configuration is also described as a json file.

Command to execute script:

python import_ml_configuration.py <file_name.json> <database_name>

Example:

python import_ml_configuration.py fc_ami_ml_config.json fc_ami

!IMPORTANT

The import configuration needs to have a specific structure. Detailed information can be found in the chapter "Machine learning"

10. Add a club administrator

Finally, a club administrator must be created. This account can create accounts for the club coaches (Trainers) and teams. Both club admins and trainers can add players to teams and import data.

The club administrator can be created by the system administrator using the web application.

... Using the application

Currently, it is possible to import data. This data will be matched against data from other sources. However, the import does not give feedback to the user on the progress of the import process.