https://github.com/jovandeginste/workout-tracker Skip to content Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} jovandeginste / workout-tracker Public * Notifications * Fork 3 * Star 249 * A workout tracking web application for personal use (or family, friends), geared towards running and other GPX-based activities License View license 249 stars 3 forks Branches Tags Activity Star Notifications * Code * Issues 2 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights jovandeginste/workout-tracker This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master BranchesTags Go to file Code Folders and files Last Last Name Name commit commit message date Latest commit History 277 Commits .github/workflows .github/workflows assets assets docs docs pkg pkg translations translations vendor vendor views views .air.toml .air.toml .dockerignore .dockerignore .gitignore .gitignore .prettierignore .prettierignore Dockerfile Dockerfile LICENSE LICENSE Makefile Makefile README.md README.md compose.yaml compose.yaml go.mod go.mod go.sum go.sum main.css main.css main.go main.go package-lock.json package-lock.json package.json package.json tailwind.config.js tailwind.config.js workout-tracker.example.yaml workout-tracker.example.yaml View all files Repository files navigation * README * License A workout tracking web application for personal use (or family, friends), geared towards running and other GPX-based activities Self-hosted, everything included. Heavily inspired by FitTrackee [?]. Getting started Docker Run the latest master image from GitHub Container Registry: docker run -p 8080:8080 ghcr.io/jovandeginste/workout-tracker:master Open your browser at http://localhost:8080 To persist data and sessions, run: docker run -p 8080:8080 \ -e WT_JWT_ENCRYPTION_KEY=my-secret-key \ -v $PWD/data:/data \ ghcr.io/jovandeginste/workout-tracker:master or use docker compose # Create directory that stores your data mkdir -p /opt/workout-tracker cd /opt/workout-tracker # Download the compose.yaml curl https://raw.githubusercontent.com/jovandeginste/workout-tracker/master/compose.yaml --output compose.yaml # Start the server docker compose up -d Natively Download a pre-built binary or build it yourself (see Development below). wget https://github.com/jovandeginste/workout-tracker/releases/download/v0.3.0/workout-tracker-v0.3.0-linux-amd64.tar.gz tar xf workout-tracker-v0.3.0-linux-amd64.tar.gz ./workout-tracker To persist sessions, run: export WT_JWT_ENCRYPTION_KEY=my-secret-key ./workout-tracker This will create a new database file in the current directory and start the web server at http://localhost:8080. Screenshots Dashboard [dashboard] Dashboard view with: * personal totals * running records * a calendar view * recent activities (by you and other users) Overview of workouts [workout_ov] Overview of all your activities, with summaries. The columns are sortable. Details of a single workout [single_wor] Details of a workout, with: * a zoomable, dragable map of the GPX track with more details per point * many summarized statistics * a breakdown per kilometer * track color based on elevation of the segment Tooltips for even more information [track] * green and red circle are start and end points of the track * every point on the track has a tooltip with a summary at that moment * hover over the breakdown per kilometer to highlight the point Upload your files [upload_wor] * Upload one or multiple GPX files. * Pick the type (running, cycling, ...) or let the application guess based on average speed * The files are parsed when uploaded: statistics and other information are calculated and stored in the database (serialized). Statistics to follow your progress [statistics] * Graphs showing monthly aggregated statistics. Basic multi-language support [i18n] * Switch between (supported) languages * Use the language configured in the browser (default) * Very limited amount of languages supported for now * Re-calculate all previously uploaded workouts (useful while developing) Responsive design [responsive] * Usable on small and medium screens Light and dark mode [single_wor] * Browser decides whether to use light or dark mode, based on your preferences Configuration The web server looks for a file workout-tracker.yaml (or json or toml) in the current directory, or takes it's configuration from environment variables. The most important variable is the JWT encryption key. If you don't provide it, the key is randomly generated every time the server starts, invalidating all current sessions. Generate a secure key and write it to workout-tracker.yaml: echo "jwt_encryption_key: $(pwgen -c 32)" > workout-tracker.yaml or export it as an environment variable: export WT_JWT_ENCRYPTION_KEY="$(pwgen -c 32)" See workout-tracker.example.yaml for more options and details. After starting the server, you can access it at http://localhost:8080 (the default port). A login form is shown. If no users are in the database (eg. when starting with an empty database), a default admin user is created with password admin. You should change this password in a production environment. Development Build and run it yourself * install go * clone the repository go build ./ ./workout-tracker This does not require npm or Tailwind, since the compiled css is included in the repository. Do some development You need to install Golang and npm. Because I keep forgetting how to build every component, I created a Makefile. # Make everything. This is also the default target. make all # Run tests and build all components # Install system dependencies make install-deps # Testing make test # Runs all the tests make test-assets test-go # Run tests for the individual components # Building make build # Builds all components make build-tw # Builds the Tailwind CSS output file make build-server # Builds the web server make build-docker # Performs all builds inside Docker containers, creates a Docker image # Running it make serve # Runs the compiled binary make dev # Runs a wrapper that watches for changes, then rebuilds and restarts make watch-tw # Runs the Tailwind CSS watcher (not useful unless you're debugging Tailwind CSS) # Cleanin' up make clean # Removes build artifacts What is this, technically? A single binary that runs on any platform, with no dependencies. The binary contains all assets to serve a web interface, through which you can upload your GPX files, visualize your tracks and see their statistics and graphs. The web application is multi-user, with a simple registration and authentication form, session cookies and JWT tokens). New accounts are inactive by default. An admin user can activate (or edit, delete) accounts. The default database storage is a single SQLite file. What technologies are used * Go, with some notable libraries + gpxgo + Echo + Gorm + Spreak * HTML, CSS and JS + Tailwind CSS + Font Awesome + FullCalendar + Leaflet + sorttable + Chart.js * Docker The application uses OpenStreetMap as its map provider and for geocoding a GPS coordinate to a location. Compatiblity This is a work in progress. If you find any problems, please let us know. The application is tested with GPX files from these sources: * Garmin Connect (export to GPX) * FitoTrack (automatic export to GPX) TODO * write tests!!!!! * add support for authentication through a reverse proxy * make a dev-flag that doesn't embed all files in the binary * add support for generic database drivers * add support for other types of import files (eg. Garmin fit files) * add support for auto-import from a folder (per user) * see if htmx is worth using About A workout tracking web application for personal use (or family, friends), geared towards running and other GPX-based activities Topics go docker gpx leaflet chartjs self-hosted workouts fitness-tracker workout-tracker tailwindcss Resources Readme License View license Activity Stars 249 stars Watchers 2 watching Forks 3 forks Report repository Releases 17 v0.9.0 Latest Feb 29, 2024 + 16 releases Packages 2 Contributors 2 * @jovandeginste jovandeginste Jo Vandeginste * @carteakey carteakey Kartikey Chauhan Languages * Go 56.2% * CSS 21.3% * HTML 19.8% * JavaScript 1.3% * Other 1.4% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.