doersino / leichter

A bare-bones weight tracking app with a simple and responsive web interface.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

leichter

A bare-bones weight tracking app with a simple and responsive web interface. "Leichter" is German for lighter, which is about as imaginative a name as I was able to come up with in a minute.

desktop

Installation

  1. Make sure to install on a webserver with PHP and SQLite3 support

  2. Create a file config.php with the following content, replacing "" with a password if you wish to password-protect your instance (you can also set an API key to expose a simple API for adding a weight – I use this via iOS Shortcuts) and setting a path to the database file, which will be created in the next step:

    <?php
    
    // authentication (leave blank to disable)
    const PASSWORD = "";
    const SESSION_LENGTH = 30;  // number of days a login is valid
    
    const API_KEY = "...";
    
    // path to where you'd like the database to be located (make sure it's not publicly accessible)
    const DB_PATH = "....sqlite";
  3. Access index.php?reset in a browser, type "yes" (after logging in if you've set a password in the previous step) and press enter to set up the database

  4. Go to index.php and start tracking your weight! Pro tip: There's no logout button, but you can log out by appending "&logout" to any URL.

Export to CSV

Assuming your database is located in the current working directory and named leichter.sqlite, run the following command:

sqlite3 -csv leichter.sqlite "SELECT datetime(time, 'unixepoch', 'localtime'), weight FROM weight ORDER BY time;" > leichter.csv

Note that the license does not apply to files in lib/, those come with their own licenses.

About

A bare-bones weight tracking app with a simple and responsive web interface.

License:MIT License


Languages

Language:PHP 100.0%