Skip to main content

An app for tracking your health and training progress.

Project description

Valens

/ˈva.lens/ [ˈväːlɛns] lat. strong, vigorous, healthy

App screenshots

Features

  • Track your training progress
    • Define training routines
    • Log repetitions, weight, time and rating of perceived exertion (RPE) for each set
    • Measure your training execution using a stopwatch, timer or metronome
    • Assess the progress for each routine and exercise
  • Keep track of your body weight
  • Calculate and log your body fat based on the 3-site or 7-site caliper method
  • Monitor your menstrual cycle (if you have one 😉)

Installation

The latest release can be installed from PyPI.

pip install valens

The latest development version can be installed from TestPyPI.

pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ valens

Demo Mode

To get a first impression of Valens, the app can be run in demo mode.

valens demo

The app can be accessed on http://127.0.0.1:5000/. A temporary database with random example data is used. All changes are non-persistent. Adding --public to the command line makes the app available to other devices on your network.

Configuration and Running

A configuration file must be created before running the app for the first time.

valens config

The environment variable VALENS_CONFIG must be set to the absolute path of the created config file.

Local Network

The development server can be used to provide the app for your local computer or local network.

VALENS_CONFIG=$PWD/config.py valens run

By default, the app is only accessible on your local computer at http://127.0.0.1:5000/. If you trust the users in your network, you can make the server publicly available adding --public to the command line:

VALENS_CONFIG=$PWD/config.py valens run --public

Public Network

The development server is not intended for production use. Please consider the deployment options for providing the app in a public network.

Example Configuration: NGINX and uWSGI

The following configuration binds the app to /valens.

/etc/uwsgi/valens.ini

[uwsgi]
master = true
plugins = python
socket = /run/uwsgi/%n.sock
manage-script-name = true
mount = /valens=valens.web:app
uid = http
gid = http
env = VALENS_CONFIG=/opt/valens/config.py

/etc/nginx/nginx.conf

[...]

http {

    [...]

    server {

        [...]

        gzip on;
        gzip_types text/plain test/css text/javascript application/json application/wasm;

        location = /valens { return 301 /valens/; }
        location /valens/ { try_files $uri @valens; }
        location @valens {
                include uwsgi_params;
                uwsgi_pass unix:/run/uwsgi/valens.sock;
        }

    }

}

NGINX compression is disabled by default. With compression enabled, the amount of data transferred can be significantly reduced, resulting in a reduction in transfer time, especially on slow networks.

Development

The following software is required:

Setting up the development environment

Add the WebAssembly target to the Rust toolchain.

$ rustup target add wasm32-unknown-unknown

Install the Rust development tools.

$ cargo install --locked trunk

Install the Python project and development tools.

$ poetry install

Running development servers

The current codebase can be executed by running development servers for the frontend and the backend. The development servers will automatically reload when the codebase is changed.

Start both development servers at the same time (requires an active tmux session):

$ make run

Alternatively, start the development servers for the frontend and the backend separately:

$ make run_frontend
$ make run_backend

After a successful start of the development servers, the web app can be reached on http://127.0.0.1:8000.

Building a distribution package

$ make dist

Deploying the application

Install Fabric.

$ poetry install --only=deploy

Deploy the latest distribution package.

$ fab -H user@host deploy

License

This project is licensed under the terms of the AGPL-3.0 license and includes third-party software.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

valens-0.4.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

valens-0.4.0-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file valens-0.4.0.tar.gz.

File metadata

  • Download URL: valens-0.4.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for valens-0.4.0.tar.gz
Algorithm Hash digest
SHA256 af6e6515c167ccc38ab4ffe6dd78de425e457d55ba13255df3c8f66715567620
MD5 566bdf6a4c17a8e2404f075418218fd5
BLAKE2b-256 9cab0ef038ad8c359a24d28b2180aeedbb394fffbb35ff4f60a08a864cad420e

See more details on using hashes here.

File details

Details for the file valens-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: valens-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for valens-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db3e831d6b838f2bb5c261ccc83fd23b003fdef328f23d0ac444076b657d1b5e
MD5 1e2a3ed5d7e68d39ab6e2d7fd0b4a3ca
BLAKE2b-256 47824751f3e0f8ca57fb5c6a3fad754c16fa4c106c6186a14975b734f7d9baa0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page