User Tools

This is an old revision of the document!


FitTrackee

FitTrackee is an open-source fitness tracker selfhosted application that can also sync with Garmin and Strava. It is aimed at outdoor acvities.

Installation

Detailed instructions can be found here. There is no container for FitTrackee, so i will show you how to install on bare-metal.

useradd -d /data/daemons/fittrackee -m fittrackee

FitTrackee uses Python, so check out PIP on Gentoo page to enable virtual environments and PIP for the fittrackee user.

python -m venv venv_ft source venv_ft/bin/activate pip install fittrackee

Now, FitTrackee requires PostgreSQL, so you need to install and start it. For reference, and this and this are the Gentoo wiki pages on PostgreSQL. These two pages are very well written and will let you setup your postgres in a few moments.

From now on i assume PostgreSQL is installed and ready.

Now access your postgres as admin user and create the database:

psql -U postgres

type in the following SQL statements:

CREATE USER fittrackee WITH PASSWORD '<PASSWORD>';
CREATE SCHEMA fittrackee AUTHORIZATION fittrackee;
CREATE DATABASE fittrackee OWNER fittrackee;
.env
export PORT=5123
export APP_SECRET_KEY=<my secret>
export APP_LOG=/data/daemons/fittrackee/log.txt
export UPLOAD_FOLDER=/data/daemons/fittrackee/uploads
export DATABASE_URL=postgresql://fittrackee:xxxxxxx@127.0.0.1:5432/
export UI_URL=https://train.mydomain.com
export EMAIL_URL=smtp://xxxx:xxxx@smtp.mydomain.com:587/?tls=True
export SENDER_EMAIL=xxx@mydomain.com
export FLASK_APP=fittrackee

Ensure this .env file is sourced in your ~/.bashrc.

As a reference:

.bashrc
(only last lines shown)
export PATH=$PATH:~/.local/bin
source venv_ft/bin/activate
source .env

Now, initialize the database: ftcli db upgrade

To start FitTrackee see the autostart script below.

Reverse Proxy

I have deployed FitTrackee on a subdomain, because i already had one set up for it. Check The Reverse Proxy concept for more details:

fittrackee.conf
server {
        server_name train.gardiol.org;
        listen 443 ssl;
        listen 8443 ssl;

        access_log /var/log/nginx/train.gardiol.org_access_log main;
        error_log /var/log/nginx/train.gardiol.org_error_log info;

        location / {
                proxy_pass http://127.0.0.1:5123;
                proxy_redirect    default;
                proxy_set_header  Host $host;
                proxy_set_header  X-Real-IP $remote_addr;
                proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header  X-Forwarded-Host $server_name;
                proxy_set_header  X-Forwarded-Proto $scheme;
        }

        client_max_body_size 100M;
        include org.gardiol/certbot.conf;
}

Autostart

If you follow my Custom User Services approach…

Create the script /data/daemons/fittrackee_start.sh:

fittrackee_start.sh
#!/bin/bash
cd ~
export PATH=$PATH:~/.local/bin
source venv_ft/bin/activate
source .env
flask worker --processes 2&
fittrackee

and make it executable.

Then add the links (as root):

 ln -s _servicer.sh 65-fittrackee--script.start
server /etc/local.d # ln -s _servicer.sh 65-fittrackee--script.stop

and run the start link now to start it.

User management

ftcli users create --password <password> --lang en --email xxx@mydomain.com myuser
ftcli users update myuser --set-admin true

TODO

fix log path

fix email sending

Garmin Integration

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information