GithubHelp home page GithubHelp logo

senier / valens Goto Github PK

View Code? Open in Web Editor NEW

This project forked from treiher/valens

0.0 0.0 0.0 4.93 MB

An app for tracking your health and training progress.

License: GNU Affero General Public License v3.0

JavaScript 0.37% Python 37.73% Rust 60.50% Makefile 0.55% HTML 0.34% Mako 0.06% SCSS 0.46%

valens's Introduction

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

Changing the database schema

Create a migration script after changing the SQLAlchemy ORM model.

$ VALENS_CONFIG=$PWD/build/config.py alembic revision --autogenerate -m "Add foo table"

The automatically generated migration script may be incomplete.

Upgrade the database schema to the latest revision.

$ VALENS_CONFIG=$PWD/build/config.py alembic upgrade head

License

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

valens's People

Contributors

treiher avatar dependabot[bot] avatar

valens's Issues

Reject future training dates

When picking a future date for a training, the respective training cannot be accessed anymore. The training tab shows something like "Last session -2 days ago.". It will only show up again in the training list in the future.

  • Gray out future dates in the calendar in frontend
  • Mark date as invalid / gray out save button in frontend

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.