Basic Install - pgalko/athlete_data_warehouse GitHub Wiki

Installation and setup (uses default flask server):

  • Install Python 3.9 (any Python 3.x version should work)

  • Clone the repository

  • Install Python requirements

    cd to src directory and run "pip install -r requirements.txt"
    
  • Install and configure PostgreSQL v13.1 (tested on 10.0 and above)
    Set path/environment variables. eg.C:\Program Files\PostgreSQL\13\lib eg.C:\Program Files\PostgreSQL\13\bin.
    Set max prepared transactions to non zero value in the 'postgresql.conf'. max_prepared_transactions = 100

  • Create download folder eg. C:\Data_Dump)

  • Configure and encrypt settings.ini Modify 'sample_settings.ini' to reflect your environment and use scenario and rename to 'settings.ini' when done. Sensitive information in the .ini file will get encrypted upon the apps first execution, and the original clear text settings.ini will be deleted.

    The encryption function uses settings.ini as a base, encrypts all sensitive information in it and generates encrypted_settings.ini file which is then used by the application. The original settings.ini is automatically deleted when the application starts, or it can be deleted manually after the 'encrypt_ini_file.py' successfully executes. The 'encrypt_ini_file.py' script is executed automatically when the app ('web_app_loader_flask.py' or 'web_app_loader_apache.py') is started for the first time, or it can be executed prior, by running it manually. It will need to be executed with the same passphrase argument as will be used later for the app. If it needs to be re-run (eg passphrase change etc) and the settings.ini has been deleted, simply rename encrypted_settings.ini back to settings.ini, replace all encrypted sections with the plain text, and restart the application or run manually providing the correct passphrase.

    What gets encrypted:
    [app]: secret_key, smtp_password
    [postgresql]: password
    [dropbox]: app_secret, app_key
    [oura]: client_id, client_secret
    [strava]: client_id, client_secret
    [anticaptcha]: api_key

    At a very least you will need to provide [app]: secret_key,[postgresql]: password for the application to be able to function, the rest is optional. More info about Settings & Encryption can be found here: https://github.com/pgalko/athlete_data_warehouse/wiki/Settings-Encryption

  • Run "web_app_loader_flask.py" to start the app using Flask server, for Apache/mod-wsgi use "web_app_loader_apache.py". Once executed you will be prompted to provide an encryption password of your choice to encrypt the "settings.ini" file and all sensitive user data in the DB. It is important that you remember the password as the password is not saved and you will be asked to provide it every time you restart the app ! The autosynch loop will be also started at this time and will check for new user data automatically at the intervals specified in settings.ini.

    Browse to http://127.0.0.1:5000 (if using local Flask server) and you should be able to start experimenting with different download options and settings.

    Upon first submit the user data DB and user role will be created. The DB will be accessible using the usual DB management tools like pgAdmin.
    The DB role and password for user's DB are derived from user's logon username and password. If username = [email protected] and password = pass123, the DB role will be created as johndoe with password pass123.