/fitbook

Gym tracker with Dropbox storage

Primary LanguageJavaScriptMIT LicenseMIT

logo

Fitbook 🏅

Gym tracker with Dropbox storage.

Usage

  • Navigate to https://fitbook.satge.me/
  • Login with Dropbox
    • The app will ask for write permissions in the app folder
  • Save workouts on the go
    • Data will be saved in Dropbox/Applications/fitbook/logs

Local installation

# Make sure node 16 is installed
node -v
# Clone the project
git clone git@github.com:johansatge/fitbook.git
cd fitbook
# Install dependencies
npm install
# Create env file with a Dropbox API key (with "localhost:4000" as allowed URL)
echo "module.exports = { FITBOOK_DROPBOX_APP_KEY: 'xxx' }" > .env.js
# Run the local server (will rebuild app on changes)
npm run watch
# Navigate to http://localhost:4000/

Adding workout types

Workout types are stored in app/config/workouts.json. Example:

"rowing": {
  "name": "Rowing machine",
  "icon": "directions_boat",
  "fields": [
    "datetime",
    "duration",
    "distance"
  ],
  "highlight": "distance"
}

Field types are stored in app/config/fields.json. Example:

"distance": {
  "name": "Distance",
  "type": "number",
  "unit": "km",
  "icon": "map"
}

Available icons are visible in app/icons (Material Symbols).

Build and deployment

To test the build locally, run:

npm run build

Assets are built in .dist.

Deployment is handled by Cloudflare Pages, when pushing updates on master.