Files
kuentagym/website/docs.html
T
Duarte Santos ae9d6785ac Coach: Admin-Karte als Setup-Assistent, sichtbarer Einstieg im Plan, Doku-Kapitel auf der Website
Solange der Coach aus ist, zeigt die Admin-Karte einen sauberen Pitch mit einem Knopf statt
halb ausgegrauter Regler; danach ein echter Assistent: nur der naechste offene Schritt ist
aufgeklappt, ein Fortschrittsbalken zaehlt mit, fertige Schritte falten sich zur Quittung.
Arbeitende Knoepfe sind getoent statt grau (List models, Replace key), der deaktivierte
Test-Knopf erklaert, welcher Schritt noch fehlt, Provider-Chips haben einen klaren
gewaehlt-Zustand. Der Coach-Einstieg im Plan ist eine deutliche Karte mit Farbverlauf statt
einer Settings-Zeile. Website: das #coach-Kapitel erklaert Pipeline, Provider, den komplett
lokalen Betrieb inkl. "jedes Modell, das du pullen kannst, kannst du nutzen" und ehrlicher
RAM-/Tempo-Beratung; docs/AI_COACH.md ergaenzt Modellwahl und Performance auf kleinen Boxen.
2026-08-31 08:07:43 +02:00

305 lines
19 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<title>Docs — openGym</title>
<meta name="description" content="How to install openGym on Android, use it on iPhone, self-host it with Docker, import your training history, and keep backups.">
<meta name="theme-color" content="#000000">
<link rel="icon" type="image/png" sizes="512x512" href="icon-512.png">
<link rel="icon" type="image/png" sizes="180x180" href="icon-180.png">
<link rel="apple-touch-icon" href="icon-180.png">
<link rel="stylesheet" href="styles.css?v=9">
<script>document.documentElement.className += ' js'</script>
<!-- Umami web analytics for opengym.duarte-santos.ch (self-hosted, cookieless). -->
<script defer src="https://stats.duarte-santos.ch/script.js" data-website-id="db36019e-50f4-453c-9c56-d0588aefe233"></script>
</head>
<body>
<nav><div class="wrap nav-in">
<a class="brand" href="/">
<img src="icon-180.png" alt="" width="24" height="24">
openGym
</a>
<button class="nav-toggle" aria-expanded="false" aria-controls="menu" aria-label="Menu">
<span></span><span></span>
</button>
<div class="nav-links" id="menu">
<a href="/#features">Features</a>
<a href="/#screens">Screenshots</a>
<a href="/#demo">Demo</a>
<a href="docs.html">Docs</a>
<a href="about.html">About</a>
<a href="https://gitlab.com/DuarteSantos8/opengym" rel="noopener">GitLab <span data-gh="stars"></span></a>
<a href="https://discord.gg/e62jY6fwVb" rel="noopener">Discord</a>
<a class="cta" href="/#download">Download</a>
</div>
</div></nav>
<!-- TEMPORARY: GitHub account suspended -> repo lives on gitlab.com. Remove this block and
revert the links (+ site.js) to github.com once the account is restored. -->
<div class="notice-wrap"><div class="wrap">
<aside class="notice" role="note">
<div class="notice-tag">Repository moved</div>
<h2>My GitHub account was suspended, and the openGym repo went with it.</h2>
<p><b>github.com/DuarteSantos8/openGym is offline</b> — not by choice. The app is
untouched: the APK, the demo and every self-hosted install work exactly as before. The
code, the releases, the container images and the APK builds now live on GitLab under
the same AGPL-3.0 license, and every repository link here points there.</p>
<div class="actions">
<a class="btn" href="https://gitlab.com/DuarteSantos8/opengym" rel="noopener">Open on GitLab</a>
<a class="btn dc-btn" href="https://discord.gg/e62jY6fwVb" rel="noopener">Join the Discord</a>
</div>
</aside>
</div></div>
<main class="wrap prose">
<h1>Docs</h1>
<p class="lead">Everything you need to get openGym running — on a phone, or on your own
server. The deeper, maintainer-level docs live
<a href="https://gitlab.com/DuarteSantos8/opengym/-/blob/main/docs" rel="noopener">in the repository</a>.</p>
<div class="toc">
<a href="#android">Android</a>
<a href="#iphone">iPhone</a>
<a href="#selfhost">Self-hosting</a>
<a href="#mcp">Ask an AI</a>
<a href="#coach">AI Coach</a>
<a href="#import">Import your history</a>
<a href="#backup">Backups</a>
<a href="#build">Build it yourself</a>
<a href="#faq">FAQ</a>
</div>
<h2 id="android">Install on Android</h2>
<ol>
<li>Open <a href="/#download">the download</a> on your phone and tap <b>Download for Android</b>.</li>
<li>Your browser will ask whether it may install apps — allow it. This is standard for
any app installed outside the Play Store (called <i>sideloading</i>), and you can
revoke the permission right after.</li>
<li>Open the downloaded <code>openGym.apk</code>, confirm, done. No account, no setup.</li>
</ol>
<div class="note">openGym is deliberately <b>not</b> on the Play Store — no store account
between you and an open-source app. The APK is signed; updates install over the old
version and keep your data.</div>
<p>Everything is stored on the phone itself. The only things fetched from the internet are
the exercise images and animations (from a CDN, on demand).</p>
<h2 id="iphone">Use on iPhone</h2>
<p>Apple does not allow installing apps outside the App Store, so there is no iOS download —
that's a platform rule, not a choice we made. What works instead:</p>
<ul>
<li><b>Self-host + home screen (recommended):</b> open your own openGym instance in
Safari → <b>Share</b> → <b>Add to Home Screen</b>. You get a full-screen app with its
own icon, passkey sign-in and sync — no expiry, no fees.</li>
<li><b>Build it onto your own iPhone:</b> with a Mac and Xcode, the native app runs on
your device with a free Apple ID (Apple expires the signature after 7 days; re-run
from Xcode to renew). See
<a href="https://gitlab.com/DuarteSantos8/opengym/-/blob/main/docs/MOBILE.md" rel="noopener">docs/MOBILE.md</a>.</li>
<li><b>Just looking?</b> Try the <a href="/demo/">in-browser demo</a> — the real app with
example data, no account and nothing to install. The Android app above needs no account either.</li>
</ul>
<h2 id="selfhost">Self-host with Docker</h2>
<p>The self-hosted flavor adds passkey profiles, sync across devices, and (optionally) an
admin dashboard. You need <a href="https://docs.docker.com/get-docker/" rel="noopener">Docker</a>
with Compose:</p>
<pre><code>git clone https://gitlab.com/DuarteSantos8/opengym
cd openGym
cp .env.example .env
docker compose pull # prebuilt images (amd64 + arm64) — skip to build from source
docker compose up -d</code></pre>
<p>Open <code>http://localhost:8080</code>, tap <b>Create profile</b>, and you're in. The
first launch downloads the exercise media (~140&nbsp;MB) once.</p>
<div class="note">Want it reachable from your phone with passkeys? You'll need an HTTPS
domain — a two-line change in <code>.env</code>. The full guide, including reverse-proxy
examples and the invite-only/admin options, is in
<a href="https://gitlab.com/DuarteSantos8/opengym/-/blob/main/docs/SELF_HOSTING.md" rel="noopener">docs/SELF_HOSTING.md</a>.</div>
<h3>Settings worth knowing about</h3>
<p>All of these live in <code>.env</code>; the defaults are what you get if you touch nothing.</p>
<table class="cfg">
<tr><td><code>RP_ID</code> / <code>ORIGIN</code></td><td>The domain passkeys are bound to, and the full URL you serve from. The two must agree, or sign-in fails.</td></tr>
<tr><td><code>WEB_PORT</code></td><td>Host port for the web UI. Default <code>8080</code>.</td></tr>
<tr><td><code>INVITE_ONLY</code></td><td>Set <code>1</code> and new profiles need an invite code you generate.</td></tr>
<tr><td><code>ALLOW_GUEST</code></td><td>Set <code>0</code> to remove <b>Continue without account</b>, so everyone using the instance has a profile.</td></tr>
<tr><td><code>ADMIN_UIDS</code></td><td>Which user ids get the admin dashboard.</td></tr>
<tr><td><code>SESSION_DAYS</code></td><td>How long a sign-in lasts. Default <code>90</code>.</td></tr>
<tr><td><code>BACKEND</code> / <code>PORT</code> / <code>NGINX_PORT</code></td><td>For fitting openGym into a stack that already has an <code>api</code> service, or putting it behind your own proxy on another port. The web container renders its nginx config at start-up, so these work on a prebuilt image.</td></tr>
</table>
<h2 id="mcp">Ask an AI about your training</h2>
<p>openGym ships an optional <b>MCP server</b>: a small read-only bridge that lets a client
like Claude Desktop or Cursor answer questions from your actual log — <i>"what did I bench
last week?"</i>, <i>"which muscle have I not trained this month?"</i>, <i>"what's my
estimated 1RM on squats?"</i></p>
<p>It runs on your machine, is spawned by the client, and reads your exported data directly.
Nothing is sent anywhere, and it is <b>not part of the Docker build</b> — if you don't use
an AI assistant, it simply isn't there. Setup is a few lines of client config:
<a href="https://gitlab.com/DuarteSantos8/opengym/-/blob/main/mcp/README.md" rel="noopener">mcp/README.md</a>.</p>
<h2 id="coach">Let an AI coach write your plan</h2>
<p>Separate from the read-only bridge above, openGym has an optional <b>AI Coach</b>. Answer a
few questions — goal, days a week, session length, equipment, anything to work around — and
it designs a week of routines. Later it reviews what you actually logged and proposes
changes; you can also ask it to look at <b>one workout</b> (a debrief: a score, what went
well, what to watch, what to do next time) or to <b>improve a single routine</b> and leave
the rest alone. If the admin allows it and at least three people opt in, it can show
anonymous medians so you can see how you sit against the others on your instance.</p>
<h3>How it works</h3>
<p>The Coach is a chat. The first visit is a short intake, one question per screen; after
that, every request works the same way:</p>
<ol>
<li>The server builds a JSON payload from a <b>by-name allowlist</b>: your plan, the sets
you logged in the review window, weigh-ins, your intake answers, and a few preferences —
under a pseudonym. Your name, e-mail, passkeys and everyone else's data are not in it,
by construction: fields are copied in one by one, nothing is passed through.</li>
<li>That payload goes to the provider <b>you</b> configured — there is no openGym service in
the middle.</li>
<li>The answer is parsed and <b>validated against a closed list of change types</b> (add,
remove or swap an exercise, sets, reps, schedule, progression policy…). An answer that
names an exercise that doesn't exist, invents a change type, or breaks a rule is
refused — it gets exactly one repair round, then the job fails rather than guessing.</li>
<li>What survives is shown to you as a card, <b>one checkbox per change</b>, each with the
evidence behind it. Nothing touches your plan until you accept it, every proposal stays
in the chat history whether you said yes or no, and the last accepted change-set can be
undone in one tap.</li>
</ol>
<h3>Providers</h3>
<p>It is <b>off by default</b>. An admin turns it on in <b>Settings → Admin → AI Coach</b> and
picks who answers:</p>
<table class="cfg">
<tr><td><b>Anthropic, OpenAI, Google&nbsp;Gemini</b></td><td>Paste an API key from the provider's console. Plain HTTPS from the api process — runs on the default image.</td></tr>
<tr><td><b>OpenAI-compatible endpoint</b></td><td>Any server that speaks the Chat Completions API: <b>Ollama</b>, <b>LM Studio</b>, <b>vLLM</b>, <b>OpenRouter</b>, a gateway of your own. A key only if the endpoint wants one. Also the default image.</td></tr>
<tr><td><b>Claude Agent SDK / Codex CLI</b></td><td>Run a real AI runtime inside the container — the one case that needs the bigger build: <code>API_TARGET=coach docker compose up -d --build api</code></td></tr>
</table>
<h3 id="coach-local">Run it fully local — no cloud, no cost</h3>
<p>A model on your own hardware is just the compatible endpoint with no key. The usual way is
an Ollama container next to openGym:</p>
<pre><code># docker-compose.yml — add next to the openGym services (same file = same network)
ollama:
image: ollama/ollama
restart: unless-stopped
volumes:
- ./data/ollama:/root/.ollama
environment:
- OLLAMA_KEEP_ALIVE=-1 # keep the model (and its prompt cache) loaded
- OLLAMA_NUM_PARALLEL=1
mem_limit: 4g</code></pre>
<pre><code>docker exec -it &lt;ollama container&gt; ollama pull qwen2.5:3b</code></pre>
<p>Then in <b>Settings → Admin → AI Coach</b>: provider <b>OpenAI-compatible endpoint</b> →
Base URL <code>http://ollama:11434</code> → <b>List models</b> → pick the model →
<b>Test the Coach</b>. That's the whole setup.</p>
<p><b>Any model you can pull, you can use.</b> <code>ollama pull</code> whatever you like and
it appears under <i>List models</i> — the admin is free to run anything the box can hold,
and each provider remembers its own model choice, so switching around never loses one.
Honest sizing, from measuring exactly this on a small box:</p>
<ul>
<li>A <b>~3B model at Q4</b> (like <code>qwen2.5:3b</code>) fits a 4–6&nbsp;GB container and
answers a review in <b>about a minute</b> on a 4-core CPU once its cache is warm.</li>
<li>A <b>4B model needs ~6&nbsp;GB+</b> for its container. Squeezed into less, it doesn't
fail — it thrashes, generating at ~1 token/second. Smaller and comfortable beats bigger
and swapping.</li>
<li>The <b>first request after a restart is slow once</b>: the model loads and reads the
Coach's rules. The api pre-warms that cache at boot and every half hour, so in practice
people hit the warm path.</li>
<li>On a genuinely slow box, raise the job budget with <code>COACH_JOB_TIMEOUT_MS</code>
in <code>.env</code>.</li>
</ul>
<p>A GPU machine elsewhere on your LAN works the same way: run Ollama or LM Studio there and
point the Base URL at it, e.g. <code>http://192.168.1.50:11434</code>.</p>
<h3>On the phone</h3>
<p><b>Settings → AI Coach</b> offers two ways in: pair the phone with your self-hosted
instance and the Coach runs there under the rules above, or bring your own API key and the
phone calls the provider directly — same allowlist, same validator, key in the platform's
secure storage, ten runs a day.</p>
<h3>Privacy and limits</h3>
<p>Before anyone uses it, a consent screen lists exactly which categories of data leave the
server — generated from the same module that builds the payloads, so it cannot drift from
what actually happens. The admin can cap runs per person and per instance per day, and
<code>COACH_DISABLED=1</code> in the environment switches the feature off harder than any
toggle. The Coach is not a doctor or a physiotherapist — if something hurts, ask a
professional. Full details, including exactly what is sent and how credentials are stored:
<a href="https://gitlab.com/DuarteSantos8/opengym/-/blob/main/docs/AI_COACH.md" rel="noopener">docs/AI_COACH.md</a>.</p>
<h2 id="import">Import your training history</h2>
<p>Coming from another tracker? <b>Settings → Data → Import from another app</b> reads:</p>
<ul>
<li><b>FitNotes</b> (both the Android and the FitNotes 2 iOS export)</li>
<li><b>Strong</b> and <b>Hevy</b> (CSV exports — session lengths carry over, so the
activity heatmap fills in properly)</li>
<li><b>Apple Health</b> (body-weight history from the XML export)</li>
<li>…and anything else with date, exercise-name and weight/reps columns</li>
</ul>
<p>Exercise names are matched against the 1,324-exercise library; anything genuinely
ambiguous becomes one of your own custom exercises instead of being guessed at. A summary
shows exactly what will happen before anything is written, and importing is idempotent —
running it twice never duplicates a workout.</p>
<h2 id="backup">Backups</h2>
<p><b>Settings → Data → Export backup (JSON)</b> writes your entire log — plan, workouts,
weights, settings — into one file. On the mobile app it goes out through the share sheet
(Files, AirDrop, mail…); in the browser it downloads. <b>Import backup</b> restores it
anywhere: another phone, your self-hosted instance, or a fresh install. That file is the
whole point of openGym — your training log as a file <i>you</i> own.</p>
<h2 id="build">Build it yourself</h2>
<p>Everything on this page is built from the public repo:</p>
<ul>
<li><b>Web / self-host:</b> <code>docker compose up -d --build</code> builds the frontend
inside the container — no local Node needed.</li>
<li><b>Android APK / iOS app:</b> the Capacitor projects live in <code>frontend/android</code>
and <code>frontend/ios</code> — build, signing and distribution notes are in
<a href="https://gitlab.com/DuarteSantos8/opengym/-/blob/main/docs/MOBILE.md" rel="noopener">docs/MOBILE.md</a>.</li>
</ul>
<h2 id="faq">FAQ</h2>
<h3>Is it really free?</h3>
<p>Yes — free as in cost <i>and</i> as in freedom (AGPL-3.0). No pro tier, no locked
features, no ads, and the license keeps every fork open source too.</p>
<h3>What data does openGym collect?</h3>
<p>None. There is no telemetry, no analytics, no crash reporting. The mobile app's only
network traffic is fetching exercise media from a CDN; a self-hosted instance talks only
to your own server.</p>
<h3>Why isn't it on the Play Store / App Store?</h3>
<p>By choice (and on iOS, by Apple's rules for sideloading). Store accounts cost money,
impose terms that sit badly with the AGPL, and put a gatekeeper between you and an app
whose whole point is that your data is yours.</p>
<h3>Mobile app or self-hosted — which one should I pick?</h3>
<p>If you just want to track your training: the mobile app. If you want your data on your
own hardware, synced across devices, with profiles for the people you train with: self-host.
You can start with the app and move to a server later — the backup file migrates everything.</p>
<h3>Where does the exercise database come from?</h3>
<p>From <a href="https://github.com/hasaneyldrm/exercises-dataset" rel="noopener">hasaneyldrm/exercises-dataset</a>:
1,324 exercises with animations and instructions in 11 languages, including openGym's
separately curated Brazilian Portuguese translation. In pt-BR, built-in exercise names
show Portuguese first and the canonical English title in parentheses. That dataset licenses the two
halves differently, and so does openGym: the exercise metadata and instruction text are
<b>MIT</b>, while the images and animations are
<b>© <a href="https://gymvisual.com/" rel="noopener">Gym visual</a></b>, used under the
dataset's terms rather than openGym's AGPL.</p>
<p>openGym does not redistribute that media — your instance downloads it from the upstream source on
first run. If you want to reuse it yourself, commercially or otherwise, get your own licence from
Gym visual first (<a href="https://gymvisual.com/content/3-terms-and-conditions-of-use" rel="noopener">terms&nbsp;&amp;&nbsp;conditions</a>).</p>
</main>
<footer><div class="wrap foot">
<span class="c">openGym · AGPL-3.0 · © 2026 <a href="https://duarte-santos.ch" rel="noopener">Duarte Santos</a></span>
<div class="links">
<a href="docs.html">Docs</a>
<a href="about.html">About</a>
<a href="https://gitlab.com/DuarteSantos8/opengym" rel="noopener">GitLab</a>
<a href="https://discord.gg/e62jY6fwVb" rel="noopener">Discord</a>
<a href="/#download">Download</a>
</div>
</div></footer>
<script src="site.js?v=9" defer></script>
</body>
</html>