Compare commits

...
82 Commits
Author SHA1 Message Date
Duarte Santos 551b072c54 MCP: die zweite Einheit an einem Tag ist erreichbar, und ein leeres 1RM sagt warum
Zwei Befunde aus dem Parity-Durchlauf gegen echte Daten. Die Arithmetik stimmte
ueberall (rund 120 Werte gegen eine unabhaengige Nachrechnung, null Abweichung)
— diese beiden nicht.

get_workout nahm `.find(x => x.d === date)`. Wer morgens hebt und abends laeuft,
hat zwei Einheiten am selben Datum, und die zweite war ueber gar keinen Weg
erreichbar: es gab nirgends eine id, und die Frage nach dem Lauf bekam die
Zahlen des Zugtrainings — vollkommen selbstbewusst vorgetragen. list_workouts
liefert jetzt `id`, get_workout nimmt `workout_id` oder `date`, und bei zwei
Treffern am selben Tag antwortet es mit beiden zur Auswahl statt zu raten.

Und `best: null` hatte zwei gegensaetzliche Ursachen in einer Form: nie
trainiert, oder immer ueber der 12-Wiederholungs-Grenze. Eine Wade, die seit
Monaten mit 15ern im Log steht, las sich damit als "keine Aufzeichnungen".
no_estimate_reason unterscheidet die beiden, und formula_note steht jetzt auch
auf diesem Zweig — bisher gab es die Erklaerung nur in der PR-Tabelle.

Drei Regressionstests dazu (36 statt 33), mcp/README zu get_workout nachgezogen.
2026-08-04 17:48:52 +02:00
Duarte Santos e007f76d43 MCP: CI laeuft ueberhaupt erstmal, und der Server ueberlebt seinen Client nicht
Fuer mcp/ gab es keinen CI-Job — weder die 33 Tests noch sonst irgendwas lief je
auf GitHub. Jetzt laeuft beides bei jedem PR, der mcp/ oder frontend/ anfasst.

Dazu der Check, den die Testsuite prinzipiell nicht machen kann: vitest loest
ueber Vite auf, also gehen dort import.meta.glob, ?raw und .jsx anstandslos
durch. Genau so kam ein Vite-only-Import in ein gemeinsames Lib-Modul und liess
33 gruene Tests ueber einem Server stehen, der beim Start starb.
check-node-loadable.mjs laeuft deshalb unter nacktem node — dass es ausserhalb
von vitest laeuft, IST der Test. Gegengeprueft: Bug wieder eingebaut → Exit 1
und history.js/progression.js/tools.js namentlich gemeldet; sauber → Exit 0.

Und der fs.watch-Handle haelt die Event-Loop offen, sobald es eine State-Datei
zu beobachten gibt — der Prozess ueberlebt damit den Client, der ihn gestartet
hat, obwohl die mcp/README genau das Gegenteil verspricht. Ein unref() reicht;
nachgemessen: mit State-Datei vorher Exit 124 (haengt), jetzt Exit 0, und der
Watcher invalidiert den Cache unveraendert weiter.
2026-08-04 16:40:03 +02:00
Duarte Santos e28345dd13 Release v1.2.5: der MCP-Server, und sonst nichts an der App
Letztes publiziertes Release war v1.2.4, also ist das hier v1.2.5 — alles seit
dem Release in EINE Nummer. Inhalt ist genau eine Sache: der optionale
MCP-Server aus PR #19 nebst dem i18n-Kern-Split, der ihn ueberhaupt erst unter
reinem Node ladbar macht.

An der App selbst aendert sich nichts. Wer keinen KI-Client benutzt, merkt von
diesem Release ueberhaupt nichts: nichts wandert in den Docker-Build, die
docker-compose.yml bleibt unberuehrt.

Kein neues APK — der Bundle-Hash bewegt sich zwar (der Modulgraph haengt jetzt
direkt am i18n-Kern), aber verhalten tut sich die App identisch. Die
Download-Zeile auf der Website bleibt deshalb bei v1.2.4.
2026-08-04 16:35:34 +02:00
Duarte Santos ba412cb36d MCP: die Lib bleibt unter reinem Node ladbar, und die Testwerte stimmen wieder
Der MCP-Server ist ein nacktes `node src/index.js` — kein Vite, kein React. PR 19
hatte dafuer den reinen Kern nach i18n-core.js gezogen; v1.2.4 hat danach in
history.js `t` wieder aus i18n.js geholt, und damit import.meta.glob ueber die
Locale-Packs plus useSyncExternalStore in einen Prozess, der beides nicht hat.
Der Server starb beim Import:

  TypeError: (intermediate value).glob is not a function

Die Testsuite konnte das nicht sehen: vitest transformiert import.meta.glob, also
liefen 33 gruene Tests gegen ein Binary, das nie startet. i18n.js re-exportiert
ohnehin genau dieses `t` aus dem Kern — history.js, mobile.js und plan-share.js
holen es jetzt direkt von dort, und mitgeschleppt wird nichts mehr.

Dazu die Werte, die der v1.2.4-Seed verschoben hat: Volumen 18500 → 18412.5
(Handsumme w×r ueber die zwanzig erledigten Saetze), Koerpergewicht 78.6 → 78.4,
Wiegung 78.5/1.5 → 78.3/1.3, Dauer 51 min → 1h 11m — samt der Zusicherung, die
sich das "N min"-Format noch fest verdrahtet hatte. Jeder Wert nachgerechnet,
nicht aus einem roten Lauf abgeschrieben.

Und das FORMULAS aus Punkt 2 des Reviews, das als einziges stehengeblieben war.
2026-08-04 16:30:34 +02:00
Duarte Santos f554b6b004 Merge pull request #19 from Pengboi/feat/mcp-server
MCP: read-only stdio server for LLM apps to query workout history

Ein Node-Prozess, den der LLM-Client selbst startet und der dieselben reinen
Helfer aus frontend/src/lib benutzt wie die Stats-Seite — also stehen dort
dieselben Zahlen. Read-only, kein Container, kein zusaetzliches Auth, nichts
verlaesst die Box. Wer keinen KI-Client benutzt, merkt nichts davon.
2026-08-04 16:30:14 +02:00
Pengboi 09949686c2 MCP: fixes from review (cardio mode, dead code, Stryker drop, docs)
· entryView was passing `e.target || { id: e.id }` to modeOf, which
   doesn't put id on the target when target exists — so a cardio config
   saved as {sets, min, speed} (no mode, no id) fell through to 'reps'
   and the label came back as "0×0". Now uses the same pattern every
   app call site uses (Workout.jsx, Stats.jsx, progression.js):
   modeOf({ ...(e.target || {}), id: e.id }). Same fix applied to the
   setLabel call right below. Added a regression test using a real
   cardio exercise id with a target that has no mode key — would have
   caught the original bug.

 · requireIso/ISO/fmt/friendlyDate/MUSCLES were unused (zod regexes
   cover ISO validation at the SDK layer). Removed, along with the
   misplaced comment that described requireIso but sat above entryView.

 · estimate_1rm's exercise_id schema description referenced
   search_exercises (v1.5) which doesn't exist yet — an LLM reading
   the schema would try to call it. Dropped the reference; the
   Roadmap section in mcp/README.md drops the same mention.

 · resolveUid threw "set OPENGYM_UID to one of: " (empty list) when
   there were zero state files but multiple users in db.json — the
   files array was empty so files.join(', ') rendered nothing. Now
   falls back to the db.json user ids in that branch.

 · Dropped Stryker entirely. The MCP SDK's 93 transitive runtime
   packages are tolerable since mcp/ is opt-in and never enters
   Docker, but a second test toolchain for a 39% mutation score
   wasn't carrying its weight next to the plain vitest suite.
   Removed .stryker.conf.json, the two Stryker devDeps, the
   mutation:test script, the .gitignore entries, and the README
   section. mcp/ now has a single devDep (vitest); 0 vulnerabilities
   (was 2 moderate).

 · CONTRIBUTING.md layout block + a one-line cross-reference in
   README.md's Tech section pointing at mcp/README.md, so people can
   actually find it.

92 frontend + 33 MCP tests pass.
2026-08-02 19:42:36 +01:00
Duarte Santos 7c69e57b4f Website: the download is v1.2.4
The APK on opengym.duarte-santos.ch is the 1.2.4 build (versionCode 5, same
signing key, so it installs over 1.2.3). The meta line said 1.2.3.
2026-08-01 17:09:28 +02:00
Duarte Santos 663e0b3987 Release v1.2.4: the effort stats, and bodyweight training that knows it is
v1.2.3 is published, so this is the next patch and everything since it belongs in
this one version: the Effort card and the readings built on it, the bodyweight and
per-side work from issues #31/#32/#33, and two fixes worth naming.

Versions bumped in frontend, api and the Android module (versionCode 5). CHANGELOG
gets the release heading and a Fixed section, README two feature bullets.
2026-08-01 17:07:17 +02:00
Duarte Santos 5a0345c905 Merge bodyweight: issues #31, #32, #33 2026-08-01 17:06:31 +02:00
Duarte Santos 1e86d6ace2 Config sheet: a stepper is not a list-row accessory
Added weight sat inside a list row next to its label, which is fine for a switch
and wrong for a stepper: the control took the width it needed and left the text
column wrapping one word per line. It now gets the same full-width treatment as
sets and reps, with the explanation underneath, and reuses the "Added (kg)" label
the set table already uses.

Also stops a long value overlapping its own title in a list row — flex:none meant
"Follow the routine (Linear progression)" ran straight through "Rule", since the
title's column was already free to shrink to nothing. The value shrinks and
ellipsises instead. Pre-existing, visible in every settings row with a long value.
2026-08-01 17:00:30 +02:00
Duarte Santos a5e360cde5 Settings can register on an invite-only instance too
The sign-in screen asks for an invite code when the server says it needs one. The
same registration reached from Settings never did: it collected a name, called
passkeyRegister without the second argument, and the server refused it. On an
invite-only instance that path could not succeed at all, with nothing on screen to
explain why.

It now reads /api/config and shows the code field on the same terms, reusing the
sign-in screen's own strings so nothing new needs translating.
2026-08-01 16:52:30 +02:00
Duarte Santos 00b4f543a3 Per side stays on reps work, where reps exist
Switching a per-side exercise to Time carried `side` onto the hold: the config
sheet hides the toggle in that mode but still saved the flag, and the workout
badge then halved a rep count a timed set does not have, reading "0 per side".

Dropped at all three points it could get through — the config sheet no longer
writes it outside reps mode, the badge no longer renders outside it, and the plan
serialiser refuses it on a hold so an older file cannot bring it back.
2026-08-01 16:48:57 +02:00
Duarte Santos 4afffcb248 Per side: log the total, show the split
Feedback on #31: a rep count that sometimes means one side and sometimes both is
the ambiguity, not the fix for it. So the logged number is the total — 16 — the
same as every other set in the app, and the split is derived for planning: "8 per
side" on the exercise, "3 × 16 · 8/side" on the plan line and the printed sheet.

Unilateral targets step in twos. 16 → 18 → 20, in the config stepper, the set-row
stepper and the bodyweight rep progression, because half of an odd total is a rep
one side never gets. Turning the flag on rounds an existing target up to even, and
a saved target is stored even for the same reason. An odd total that arrives some
other way still displays honestly, as 8.5 per side, since that is what it means.

Volume loses its per-side case: both sides are already in the number logged.
2026-08-01 16:47:44 +02:00
Duarte Santos c33ff15d9d Bodyweight work, logged the way it is done
A push-up has no weight to type and the app asked for one anyway, on a quarter of
the catalogue. Issues #31, #32 and #33 are the same gap seen from three sides: the
app assumed progress lived in the load.

Two flags on the exercise config rather than two new modes, because "bodyweight"
and "per side" are equally true of a rep set and a timed hold:

  bodyweight — seeded from the equipment the dataset already records. The weight
               column is gone, the set row is one stepper, and the working-weight
               prompt stops asking about a weight that was never there. A belt
               weight reads as an addition and hands progression back to the
               normal policies, because now there is something to add.
  side       — 8 logged is 8 per side. The total is spelled out where there is
               width for it, and volume counts both sides so a routine that moved
               to single-arm work no longer halves itself on the chart.

Bodyweight progression grows reps, and now sets: a rep ceiling sends the reps back
to the bottom and adds a set instead of climbing forever, stopping at six with the
advice it should have given all along. No ceiling keeps the old behaviour exactly.

Both flags are written to a plan only when they disagree with the catalogue, and
absent reads as false, so every existing plan, workout and backup is read
unchanged.
2026-08-01 16:37:52 +02:00
Duarte Santos 8de55ce0d9 Merge pull request #29 from DuarteSantos8/dependabot/npm_and_yarn/frontend/frontend-120fce7b1d
Bump react-router-dom from 7.18.1 to 7.18.2 in /frontend in the frontend group
2026-08-01 14:49:40 +01:00
Duarte Santos aefb13b544 Merge pull request #30 from DuarteSantos8/dependabot/github_actions/actions-6382876e44
Bump docker/login-action from 4.5.2 to 4.6.0 in the actions group
2026-08-01 14:49:21 +01:00
dependabot[bot] 7354b1ca0c Bump docker/login-action from 4.5.2 to 4.6.0 in the actions group
Bumps the actions group with 1 update: [docker/login-action](https://github.com/docker/login-action).


Updates `docker/login-action` from 4.5.2 to 4.6.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v4.5.2...v4.6.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-version: 4.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-01 00:45:03 +00:00
dependabot[bot] f5562febca Bump react-router-dom in /frontend in the frontend group
Bumps the frontend group in /frontend with 1 update: [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom).


Updates `react-router-dom` from 7.18.1 to 7.18.2
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/react-router-dom@7.18.2/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@7.18.2/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-version: 7.18.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: frontend
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-01 00:44:33 +00:00
Duarte Santos 1f40230727 Dependabot: majors arrive on their own, and Capacitor waits
Grouping by ecosystem cut the noise, which was the point, but it also let a
Capacitor 7 → 8 migration turn up as "the frontend group, 7 updates" — six
routine siblings and one native-platform migration, indistinguishable in the
list. CI would have gone green on it too: the test workflow builds the web app
and never touches the mobile flavour, so the check would have been reassuring
about something it had not looked at.

Minor and patch stay grouped and quiet. Majors get their own PR per ecosystem,
where being alone is the signal.

Capacitor majors are ignored outright for now: Capacitor 8 declares Node >= 22
and the build host runs 20, and frontend/android and frontend/ios are committed,
so the upgrade also means migrating Gradle/AGP and the Podfile. That is a piece
of work to schedule, not a PR to merge. The comment says to drop the ignore once
the build host moves to Node 22.
2026-07-31 20:35:12 +02:00
Duarte Santos de65e1099a Merge pull request #28 from DuarteSantos8/dependabot/github_actions/actions-d8aa18c958 2026-07-31 19:30:56 +01:00
dependabot[bot] be2fb2dd1d Bump the actions group across 1 directory with 10 updates
Bumps the actions group with 10 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4` | `7` |
| [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `3` | `4` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3` | `4` |
| [docker/login-action](https://github.com/docker/login-action) | `3` | `4.5.2` |
| [docker/metadata-action](https://github.com/docker/metadata-action) | `5` | `6` |
| [docker/build-push-action](https://github.com/docker/build-push-action) | `6` | `7` |
| [actions/setup-node](https://github.com/actions/setup-node) | `4` | `7` |
| [actions/configure-pages](https://github.com/actions/configure-pages) | `5` | `6` |
| [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) | `3` | `5` |
| [actions/deploy-pages](https://github.com/actions/deploy-pages) | `4` | `5` |



Updates `actions/checkout` from 4 to 7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v7)

Updates `docker/setup-qemu-action` from 3 to 4
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v3...v4)

Updates `docker/setup-buildx-action` from 3 to 4
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v3...v4)

Updates `docker/login-action` from 3 to 4.5.2
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v3...v4.5.2)

Updates `docker/metadata-action` from 5 to 6
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](https://github.com/docker/metadata-action/compare/v5...v6)

Updates `docker/build-push-action` from 6 to 7
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6...v7)

Updates `actions/setup-node` from 4 to 7
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v4...v7)

Updates `actions/configure-pages` from 5 to 6
- [Release notes](https://github.com/actions/configure-pages/releases)
- [Commits](https://github.com/actions/configure-pages/compare/v5...v6)

Updates `actions/upload-pages-artifact` from 3 to 5
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v3...v5)

Updates `actions/deploy-pages` from 4 to 5
- [Release notes](https://github.com/actions/deploy-pages/releases)
- [Commits](https://github.com/actions/deploy-pages/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/configure-pages
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/deploy-pages
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/setup-node
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-pages-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: docker/build-push-action
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: docker/login-action
  dependency-version: 4.5.2
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: docker/metadata-action
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: docker/setup-buildx-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: docker/setup-qemu-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-31 17:34:50 +00:00
Duarte Santos 611987545a Dependabot: don't chase Node majors that were never LTS
The first run offered node:22-alpine → 25-alpine in both Dockerfiles. Odd
majors are Current, not LTS, and stop getting fixes about six months in — for
an image other people self-host that trades stability for nothing. Even majors
are still proposed, so 22 → 24 will show up as a PR, which is the move actually
worth reviewing.
2026-07-31 19:32:57 +02:00
Duarte Santos accc3c1038 Sessions you can actually end, and invite codes worth guessing at
SECURITY.md documented three weaknesses two hours ago. Documented is better than
hidden; fixed is better than documented.

Sessions were a signed cookie the server trusted for a year, and /api/logout
only cleared it in the browser you clicked it in — a copy left on a shared
machine stayed good until it expired, and the only way to end it was deleting
./data/secret and signing out the entire instance. The cookie payload now
carries the user's session version, and POST /api/logout/all bumps it, which
kills every cookie that account ever had. Settings grows a "Sign out
everywhere" row for it.

Cookies already in the wild have no version field. They read as version 0 and
match a user who has never bumped, so nobody is signed out by this deploy and
db.json needs no migration — sv appears lazily on the first bump. Verified
against a server running the new code with a db.json shaped like the live one.

Session default drops from 365 days to 90, overridable with SESSION_DAYS. The
expiry is baked into each cookie when issued, so lowering it never cuts an
existing session short.

Invite codes go from 32 to 64 bits. The app has no rate limiting by design and
/api/register/options answers whether a code is valid, so the code itself has to
be the part not worth guessing. Existing codes still work — validation is an
exact string compare. Unused old ones are worth revoking and reissuing.

What did not change: no rate limiting, still the reverse proxy's job, still the
first caveat in SECURITY.md. requireUserVerification stays false — raising it
could refuse passkeys that already exist, which is a lockout, not a fix.
2026-07-31 19:32:57 +02:00
Duarte Santos 1574811af0 Wake-lock test: stop assigning to a global Node now owns
The first CI run found this, which is the point of having one. Node 21+ defines
globalThis.navigator itself as a getter with no setter, so `globalThis.navigator
= {...}` throws under ESM strict mode. This box runs Node 20, where the global
does not exist and the assignment is fine — the test has never failed locally
and never would.

Only the first test failed: its afterEach deletes the built-in accessor, so
every later test assigned cleanly against the hole it left. defineProperty works
on both runtimes.

Production images are node:22-alpine (web/Dockerfile, api/Dockerfile), so the
version CI runs is the right one and the test was what needed fixing.
2026-07-31 19:21:03 +02:00
Duarte Santos b45dbca2a6 Demo: rate the sets, so the demo shows the effort stats
The live demo is the shop window, and it was the one place the new Effort card
could not appear — demoSeed fabricated twelve weeks of training with no ratings
at all, so every chart that reads effort rendered empty or absent.

The seed now rates about 82% of finished sets, deterministically as before:
effort tracks position in the session and the block's progression, one deload
week sits well away from failure, the first three weeks are written in RPE as if
imported from another app, and one exercise stays unrated throughout so the
partial-coverage case is visible rather than theoretical. Only reps-mode sets
are rated — a reps-in-reserve number on a cardio set would be nonsense.
2026-07-31 19:12:18 +02:00
Duarte Santos 3a120df205 A security policy, and dependency updates that stay quiet
openGym ships passkeys, a signed session cookie and an admin dashboard, and
people run it on the open internet. Until now someone finding a hole had no
option but a public issue.

SECURITY.md documents the model as it actually is, verified against server.js
rather than described from memory: what the session cookie is and how long it
lasts, that it cannot be revoked individually, that ./data is unencrypted and
its holder can mint a session for any account, that there is no rate limiting,
and what changing RP_ID costs. A self-hoster deciding whether to run this for
other people deserves that list up front.

Dependabot is monthly and grouped one PR per ecosystem — a default setup on a
solo project produces noise that stops being read, which is the opposite of the
point. Android/iOS are left out on purpose: Capacitor pins those to the npm
packages, so bumping them separately breaks the mobile build.

Also: api/ has had two dependencies since notifications landed. CONTRIBUTING
still claimed one.
2026-07-31 19:12:18 +02:00
Duarte Santos 051a37abbf CI: actually run the tests, and hold the locales to one key set
There are 159 unit tests and nothing ran them. Both existing workflows fire on
push to main only, so the two outside pull requests merged so far were reviewed
by eye alone. This runs the suite, the build and a locale check on every pull
request.

The locale check exists because of a bug that shipped last week: a feature added
17 strings to de.js only, and the other ten languages fell back to English
mid-sentence with nothing failing anywhere. The checker compares every locale
against the union of all keys, so a string added to one file flags the other ten
instead of passing unnoticed.
2026-07-31 19:12:18 +02:00
Duarte Santos 8440cf3546 Changelog: the effort stats, under Unreleased
v1.2.3 is published, so this is the start of the next version rather than an
amendment to that one — it stays under Unreleased until there is a release to
fold it into.
2026-07-31 19:00:42 +02:00
Duarte Santos b0d176aba3 Merge branch 'effort-stats': the effort ratings, read back as statistics
Sets have carried an RIR/RPE rating since v1.2.3, but nothing ever read it
back — the number lived in the set label and nowhere else. This is the other
half: a trend per week, the spread across the scale, the share of sets taken
near failure, a hard-sets mode on the muscle map, and the rating riding along
on each exercise's own curve.
2026-07-31 18:49:41 +02:00
Duarte Santos 42ac8c8513 Send questions to Discussions, and put a Sponsor button on the repo
Discussions has been enabled since the start and empty since the start, so
every question arrives as an issue — the tracker is carrying design debates and
"how do I" alongside actual bugs, and the answers end up buried in closed
issues where the next person searching won't find them.

The "New issue" screen now offers Q&A, Ideas and Show-and-tell before the
templates, which is where that traffic gets intercepted; README and CONTRIBUTING
say the same thing in a table.

FUNDING.yml does nothing until the account is enrolled in GitHub Sponsors —
GitHub simply doesn't render the button. Stated plainly next to it: openGym is
AGPL, there is no paid tier and nothing is held back for sponsors. A project
that starts selling access to its maintainer stops being the thing people
starred.
2026-07-31 18:43:15 +02:00
Duarte Santos f232b5ba7e Effort stats: the other ten languages, and drop what nothing calls
The card shipped translated into German only, so every other UI language fell
back to the English source strings mid-sentence — the locale files have been
key-for-key identical until now, and they are again (607 each).

exerciseEffort() had no caller: Stats builds its per-exercise curve from the
points it already has, which are filtered by training mode, so the library
version would have drawn a different set of sessions. Removed with its tests
rather than left as a second answer to the same question.
2026-07-31 16:55:21 +02:00
Duarte Santos caaf61d91e Stats: read the effort back — trend, distribution, hard sets, per exercise
Rating a set only paid off inside the set label until now: Stats never looked at
rir/rpe at all. It reads them now, in four places.

lib/effort.js aggregates everything in RIR and converts back to whichever scale the
profile reads. A history that mixes the two — own logs in RIR, an imported file in
RPE — has to average as one series or every chart draws half the data, and RIR is the
internal unit because its zero is real where RPE's floor of 6 is a convention.

- an Effort card: average and share of sets taken near failure, the week-by-week curve
  with the week's volume in the tooltip, and where the sets land on the scale
- the muscle map gains a hard-sets mode: a muscle can lead on volume and still never
  be trained near failure
- Exercise progress carries effort on the top-set dots and as a curve of its own — the
  same weight with more left in the tank is progress a weight-only line draws flat
- LineChart learns an inverted axis (RIR counts down as it gets harder) and per-point marks

Every number carries how much of the training it speaks for: rating is optional and off
by default, so an unrated set is left out rather than read as failure, and an average
waits for five rated sets before it claims to be one.
2026-07-31 16:17:08 +02:00
Duarte Santos 4c829b6d1f Release v1.2.3: fold in the screen lock, the rest timer and the settings grouping
v1.2.3 was tagged but never published, so everything since v1.2.2 -- the last
published release -- belongs in this one version rather than a new number.

CHANGELOG gets the three new sections, README a feature bullet, SELF_HOSTING a note
that the Wake Lock API wants HTTPS (or localhost) like passkeys do and that iOS
refuses it in Low Power Mode. Website: the APK line said v1.2.2 while the download is
1.2.3, and the feature grid gained the screen-awake card.
2026-07-31 15:35:36 +02:00
Duarte Santos c5e131f81c Rest timer: take 15 seconds off, not only add them
addRest now accepts a negative step, and taking off more than is left finishes the
rest instead of counting into the negative -- which also kept a negative duration out
of the progress bar and out of the server-side push schedule.

Three controls and the clock do not fit one line on a phone: at 360px the bar was
left with about 30px and stopped saying anything. The rest variant stacks -- clock and
bar on top, controls beneath, -15 and +15 together in number-line order, Skip pushed
to the far edge so the button that ends the rest is not next to the one you tap to buy
more time. Scoped to #timer.rest, so the work timer keeps its single row. Back to one
line at >=1000px, and the card is nearly opaque now -- the set rows underneath were
reading through it.
2026-07-31 15:35:27 +02:00
Duarte Santos 248da53dca Keep the screen awake while a workout is running
Locking and unlocking the phone between every set was the worst part of logging on
one. Settings -> During a workout -> Keep screen awake, on by default; the lock is
held only while S.active exists, so it follows the workout rather than the route and
lets go when you finish.

The browser drops the lock whenever the document stops being visible, which is what
happens the moment you glance at a message, so wakelock.js keeps its own 'wanted'
intent and re-acquires on every visibilitychange. It also releases a sentinel that
arrives after a release landed mid-request, and swallows the rejection iOS gives in
Low Power Mode. Where the API is missing the row shows disabled instead of offering
a switch that does nothing.

Settings is regrouped by what each thing affects while the row needed a home:
General (language, units), During a workout (rest timer, keep awake, sounds, effort),
Notifications, Appearance, Data. Nothing removed, no setting changed meaning.
2026-07-31 15:35:18 +02:00
Duarte Santos 42d3659615 Release v1.2.3: effort per set, and the RPE your old app already had
Everything published since v1.2.2 is one number: the RIR column from #21 and
the RIR/RPE scale choice built on top of it, plus the importer reading the
RPE that Hevy and Strong export.

Changelog, README, roadmap and the website all describe the feature as it
actually shipped — a rating that is optional, keeps its scale per set, and
is deliberately not an input to progression or the 1RM estimate.

Android versionCode 4: it has to increase strictly or the APK will not
install over the v1.2.2 build already out there.
2026-07-31 00:16:43 +02:00
Duarte Santos ca917f0320 Merge branch 'effort-metric': effort per set (RIR / RPE)
Adds an optional per-set effort rating on either of the two scales people
actually use, generalising the RIR column from #21 rather than bolting a
second one next to it, and teaches the importer to read the RPE that Hevy
and Strong already export.
2026-07-31 00:14:51 +02:00
Duarte Santos 54fb14be13 Import: bring the RPE other apps already recorded
Hevy and Strong both write an RPE next to every set and the importer was
dropping the column, so a history imported from either arrived flatter than
the file it came from. It is read now, along with an RIR column if a file
happens to have one.

A blank cell stays unrated rather than becoming 0, and a written-out 0 is
only a rating on the RIR scale — RIR 0 is a set taken to failure, while RPE
runs 1-10, so an app writing 0 there means "nothing here" and reading it as
an effort would stamp one on every unrated set in the file. Ratings above
the scale are capped rather than thrown away, junk is ignored, and effort
only rides along on weighted rep sets — a treadmill row has nowhere to show
it. A file carrying both columns is read as RIR, the precedence setLabel
already reads them back with.

The import summary reports how many sets brought a rating, and says where
to switch the column on when the profile is not logging effort yet —
otherwise the ratings arrive invisibly and look like they were lost.

Export needed no change: the backup is the whole state serialised, so both
fields and the setting travel with it. There is a test pinning that now,
along with 11 for the import paths.
2026-07-30 23:59:01 +02:00
Duarte Santos 6905117352 Effort stepper: count up from the bottom of the scale
The first + on an empty cell jumped straight to a "typical working set"
(RIR 2 / RPE 8), skipping 0 and 1 with no way to see why. A stepper that
lands somewhere other than where counting would take you is just puzzling,
so it now starts at the bottom of the scale and walks up in even steps like
every other stepper in the app: RIR from 0, RPE from 6 — the scale is only
meaningful for working sets and anything lighter is a warm-up nobody rates.

Stepping back off the floor clears the cell again, so a mistap is undoable
instead of sticking at 0 — which on the RIR scale claims the set went to
failure. − on a cell that was never filled in still leaves it empty.

The stepping moved out of the view into stepEffort/capEffort in history.js,
where it can be tested: 16 new cases covering the scale walk, the floor and
ceiling, the clear-on-undershoot, half-step rounding, junk settings values,
the showRir overlay every load path performs, and a session's worth of
logging end to end.

A typed value is still only capped, never floored — clamping up would turn
the "1" of "10" into the floor and fight the input.

The help sheet no longer claims the highlighted row is where + starts; it is
where working sets usually land. Reworded in all 11 language packs.
2026-07-30 23:52:57 +02:00
Duarte Santos 0c6c22c04b Effort help: show the two scales as one table, (i) before the control
The sheet explained RIR and RPE in three paragraphs, which is a bad way to
say "these are the same judgement counted from opposite ends" — you had to
hold both sentences in your head to see the correspondence. A conversion
table shows it in one look: RIR and RPE in fixed tabular columns you can
read straight down, the feel in words next to them, and the row a working
set usually lands on highlighted in the accent.

The table is built from the same parts as the app's grouped lists (surface
fill, inset hairlines) instead of a real <table>, so it inherits the card
look and wraps on a narrow phone.

The (i) moves ahead of the segmented control: you reach the explanation on
the way to the choice rather than past it.

The three paragraph strings are replaced by the table's strings in all 11
language packs.
2026-07-30 23:42:21 +02:00
Duarte Santos 4e27461b7e Effort per set: RIR or RPE, whichever scale you think in
The RIR column becomes a three-way setting (Off / RIR / RPE). Both scales
measure the same judgement from opposite ends — RPE 8 is RIR 2 — so they
share one column and one stepper, but keep their own field on the set.

A set is never silently rewritten into the other scale: switching the
setting changes what new sets ask for, and old sets still read back with
the scale they were logged with.

Profiles carrying the old showRir boolean keep their column (effortOf
falls back to it until the new setting is chosen), so a backup or another
device that still has the flag does not lose the column.

The steppers now know the scale: the first + lands on a typical working
set (RIR 2 / RPE 8) instead of the end of the scale, and typed values are
capped at 10 — there is no RPE 12.
2026-07-30 23:35:47 +02:00
Duarte Santos fa978a1bb4 Merge PR #21: optional RIR column on reps-mode sets
octaviodimarco's RIR (reps in reserve) stepper for reps-mode sets, opt-in under
Settings → Units & timer, plus a fixup for the leftover RIR-0 stamp and the
header alignment.
2026-07-30 19:53:21 +02:00
Duarte Santos c08381e558 RIR: an unlogged RIR stays unlogged, and the header lines up
A set that never had an RIR could still end up carrying one: NumberField mapped an
empty field to 0 and the − button clamped to 0, so one stray tap stamped '(RIR 0)' —
went to failure — on the set for good, in history and in backups, with no way back.
An optional field now clears to null (the key is dropped), and stepping down from
empty leaves it empty. A typed 0 still logs a real 0.

The row's three-stepper sizing also has to reach the header, or the labels sit up
to 5px off the columns they name.
2026-07-30 19:53:14 +02:00
Octavio Di Marco c5172d0633 i18n: add RIR strings to all 11 language packs
t('RIR') and the new Settings toggle label had no entries in
src/locales/ — RIR itself is kept as the acronym across languages
(same treatment as 1RM), only the surrounding label text is translated.
2026-07-30 19:20:00 +02:00
Octavio Di Marco c3929b0a70 Remove RIR auto-check; gate the column behind a setting
Two blockers from review:

- NumberField.commit() fires onChange on every keystroke, so typing
  a decimal RIR (e.g. 1.5) committed the auto-check after the first
  character, before the value was finished — and the same auto-check
  turned a stray tap on an empty field's "−" (or clearing it) into a
  permanent "RIR 0", since 0 is indistinguishable from unset once the
  key exists on the set. Logging RIR is back to a plain field with no
  side effect; the checkbox is the only way to mark a set done, same
  as weight and reps.

- The RIR stepper narrowed every reps-mode row's +/- buttons for
  everyone, including the majority not running an RIR-based program.
  It's now behind a `showRir` setting (Settings → Units & timer,
  default off), so the existing row is untouched unless opted in.
2026-07-30 19:20:00 +02:00
Octavio Di Marco eb582e3c7b Auto-check a set when its RIR is logged
Logging RIR is naturally the last thing you do for a set — by the
time you're rating how many reps you had left, you've already
finished it. Editing the RIR field (typing or the +/- stepper) now
checks the set off itself, same beep/vibrate/rest-timer as tapping
the checkbox by hand, so that's one less tap per set.

Weight and reps are unaffected — those are often set before the set
is performed (pre-filled targets), so editing them shouldn't imply
it's done. Guarded by !s.done so re-editing RIR on an already-done
set (e.g. a correction) doesn't re-fire the toggle side effects.
2026-07-28 22:45:28 +02:00
Octavio Di Marco 6714b16e6a Add optional RIR (reps in reserve) to reps-mode sets
Adds a third stepper column, next to weight and reps, for logging RIR
on strength sets — not shown for cardio or timed holds, where it has
no meaning. RIR is purely a logging/display addition: it never
touches the progression engine (linear/Greyskull/double progression
only ever read weight/reps/seconds), and it round-trips through the
existing whole-object backup export/import with no code changes there.

The set object only gains an `rir` key once the user actually logs a
value (buildSets/addSet don't pre-seed it), matching how missing
fields already read as undefined elsewhere in the store — no schema
version or migration needed for existing logged workouts.

Fitting a third stepper next to weight+reps on narrow phones needed
the same treatment as the exercise-config sheet's three-steppers-in-a-row
(.cfgrow): narrower buttons and a smaller value font just for rows
that show RIR, verified by hand at 360-390px with edge-case values
(2-3 digit weight, double-digit reps, decimal RIR together).

"Last time" summaries now append "(RIR n)" when a set has one logged,
covered by new setLabel tests including the rir: 0 case (0 is a valid
RIR and must not be treated as absent).
2026-07-28 17:10:03 +02:00
Pengboi 6aaf2a3eea Comments: trim to the established cadence
The MCP code came in with 5–8 line file headers, JSDoc on every
one-line wrapper, and inline explanations that referenced the PR
itself ("so the MCP server can reuse it") — none of which matches
api/server.js or frontend/src/lib/, where comments are one-line,
fact-shaped and never mention the change that introduced them.

Trimmed across mcp/src/*.js, i18n-core.js, i18n.js, exercises.js,
format.js, mcp/test/tools.test.js, mcp/vitest.config.js and
mcp/README.md. Tool prefaces lost their numbers; duplicate fs.watch
rationale folded into one; the ASCII import diagram in the README
replaced with a paragraph; the cross-references and self-references
removed. Also fixed two real defects: a corrupted Cyrillic word in a
state.js comment and a missing space in a tools.test.js comment.

No code changes; 92 frontend + 32 MCP tests still pass.
2026-07-26 19:47:52 +01:00
Pengboi 4143ab8676 Tests: Stryker mutation testing on the MCP handlers
Adds Stryker 9.6.1 as a devDep and a .stryker.conf.json scoped to the three MCP-only
modules (src/state.js, src/labels.js, src/tools.js). The reused pure lib in
frontend/src/lib/ is deliberately excluded — it has its own 92-test vitest suite, and
mutating it here would just re-test it under a different label.

Two non-obvious config choices, both learned the hard way:
 · inPlace: true. Stryker's default copies the project to a sandbox, but the MCP test
   file imports "../../frontend/src/lib/*.js" — a relative path that breaks the moment
   the source is moved. inPlace mutates files where they live, keeps a backup in
   .stryker-tmp/backup-*/ during the run, and restores on exit. Verified: after the
   run, `git diff` shows no changes and all 92+32 tests still pass.
 · vitest.related: false. The vitest runner's related-files mode uses static import
   analysis to pick which tests to run per mutant; it can't see the cross-directory
   imports and reported "no tests were found". Disabling it means every mutant runs
   the full suite — slower (~54s for 847 mutants) but accurate.

Baseline first run: 39.32% mutation score (333 killed, 330 survived, 184 no-coverage).
Most of the survivors are zod schema string literals (the unit suite bypasses the SDK's
validation by calling handlers directly), and the bulk of the no-coverage debt lives in
state.js — file watching, multi-user resolution and the mtime fallback paths. The HTML
report at mcp/reports/mutation/mutation.html (gitignored, regenerated per run) shows
each survived mutant inline.

Run with `npm run mutation:test` from mcp/.
2026-07-26 19:34:15 +01:00
Pengboi 92914dea43 MCP: read-only stdio server for LLM apps to query workout history
A Model Context Protocol bridge that lets an external LLM application (Claude Desktop,
Cursor, Cline, Continue, …) read a user's openGym profile directly from ./data — no new
container, no extra auth, no third-party service. The LLM client spawns the server
locally as a stdio process (per the official MCP model); reads the same state-<uid>.json
the api server writes; reuses the pure training helpers from frontend/src/lib/*.js so
the numbers it answers with match what the Stats screen shows exactly.

Eight tools in v1, all read-only:
 · list_routines, get_routine — names + exercise counts + per-exercise targets
 · get_week_plan — Mo/We/Fr assignments and today's routine, accounting for any
   date-specific overrides (a "rest" override cancels the day)
 · list_workouts, get_workout — newest-first session summaries + per-set breakdown
 · get_bodyweight — weigh-ins with the goal line and signed deltas vs goal
 · estimate_1rm — Epley/Brzycki/Lombardi formulas, all-time best + trend per exercise,
   or a PR table across all reps-mode exercises
 · muscle_balance — which muscles are trained vs neglected over a week/month/all window

State is read with fs.watch (mtime fallback for platforms where watchers are flaky) so
the server reflects a session the web UI just finished without a restart. No passkey
material, VAPID keys, or session secrets ever cross the boundary — handlers only ever
serialize fields from the state object plus the user's name from db.json.

The MCP server has exactly one runtime dependency beyond the SDK: none. zod is the SDK's
transitive; vitest and Stryker are devDeps only. Tests run against the demo seed fixture
(demoSeed.js) — 32 cases pinning the JSON shape and the most user-facing edge cases
(empty state, missing routine, rest-day override, zero-workout muscle_balance, three
1RM formulas, superset links, timed/cardio set labels).
2026-07-26 19:34:09 +01:00
Pengboi fadeb17b6c i18n: split the pure core out so the lib is Node-loadable
The pure training helpers (history, progression, onerm, muscles, format, exercises) are
deliberately self-contained — that is what lets them ship with their own vitest suites and
got them reused across the React and mobile builds. They were one Vite-only call away from
being loadable from plain Node too: `import.meta.glob` for the lazy locale packs, run at the
top of i18n.js. Anything that imported `t` or `dateLocale` via the chain (i.e. every helper
in src/lib) inherited the dependency.

Splitting the runtime-agnostic state, constants and readers (t, dateLocale, instrFor, getLang,
LANGS, INSTR_LANGS, DATE_LOCALES) into i18n-core.js lets plain Node require them. i18n.js
keeps the Vite-only bits (the async setLang that lazy-loads locale packs via import.meta.glob
and the React subscription hook useLang) and re-exports everything from core, so none of the
23 existing import sites change.

exercises.js had one direct `import.meta.env` access for IMG_BASE/GIF_BASE — guarded with
`?.` so the module resolves without Vite present. format.js and exercises.js import i18n-core
directly; everything else still imports i18n.js.

No public exports changed. 92/92 vitest tests pass; vite build still code-splits the locale
packs the same way.
2026-07-26 19:34:01 +01:00
Duarte Santos ab0c98ba85 Android: versionCode 3 for the v1.2.2 APK
Same versionName — v1.2.2 was never published, so this is still that release — but the code
has to increase strictly or Android refuses to install over the build already out there.
2026-07-25 15:05:12 +02:00
Duarte Santos b15f7d9ec4 Release v1.2.2: docs, changelog and website for everything since v1.2.1
v1.2.2 was tagged but never published, so by the versioning rule everything since the last
published release — v1.2.1 — belongs in this one number: the mobile app, the importer, plan
sharing, the QA fix series, and now timed sets, progression rules and estimated 1RM.

The changelog was missing plan sharing and the fix series entirely; both are written up
here rather than left to the git log.
2026-07-25 15:00:43 +02:00
Duarte Santos 5c846b92d5 i18n: the new strings in all 11 language packs
49 keys per pack, 572 in total. The progression rules explain themselves in prose, so most
of these are full sentences rather than labels — a rule you cannot read is one you will
not trust, in any language.
2026-07-25 14:58:48 +02:00
Duarte Santos c248ca3bae The screens for timed sets, progression and estimated 1RM (#16 #17 #18)
Where the three features surface:

 · Routine editor — a progression rule for the whole routine, and per exercise a
   Reps/Time switch, an optional rule of its own and the step it moves in.
 · Workout — timed sets get a start button and the work-timer bar; every exercise says in
   one line why its target is what it is ("every rep last time — 2.5 kg more", "missed
   reps 3 sessions running — reset to 55 kg"). The weights are already right when the
   session opens rather than being suggested afterwards, which is what the old bump-hint
   button did.
 · Stats — the exercise curve switches between top set and estimated 1RM, and names the
   set the estimate came from. Timed exercises chart the longest hold.
 · Exercise detail — an estimated 1RM from your log plus a calculator for a set you have
   not done yet, so the number is reachable before there is any history.
 · Finish summary — a new best estimated 1RM is reported separately from a weight PR.
   Same weight for more reps is progress, but it is not a heavier lift.

Saving an exercise now replaces its config rather than merging into it, so switching back
from time to reps cannot leave a stale duration behind.
2026-07-25 14:58:42 +02:00
Duarte Santos 8e1d3b96a6 Automatic progression: named rules instead of one hard-coded hint (#17)
The old rule was a single line: all reps done, suggest 2.5 kg more. No rep ranges, no
AMRAP, no idea what to do after a bad session. This replaces it with a small set of
policies — linear, Greyskull LP, double progression, and adding time for timed work —
picked per routine and overridable per exercise.

Every function is pure and derives the next target from the log each time it is needed.
Nothing is written back into a finished workout and no counters are stored, so correcting
a mistyped set immediately produces the right next target.

Reading a session honestly is the whole point. Short reps count as a miss even when the
set was checked off; an unchecked set counts as a miss because it was not performed. A
session that fell apart can never advance the load as though it had succeeded.

Two cases the naive version gets badly wrong, both found against real data:

 · Workouts only started recording their prescription in this version. Judged against
   nothing, every past session scores as a miss — the demo history produced "missed reps
   11 sessions running, deload", and every existing user would have been greeted with the
   same on their first session after updating. Targetless history is judged against the
   exercise's current plan instead, which is what the old hint compared against.

 · Bodyweight work has no load to take off. "Reset your push-ups to 2.5 kg" is not advice,
   so with no external weight the rules progress in reps and leave the load alone.
2026-07-25 14:58:31 +02:00
Duarte Santos ec46c7e20d An exercise can be logged by time instead of reps (#16)
Until now the logging model came from the body part alone: cardio meant duration, and
everything else meant weight × reps. A plank, a hang, a wall sit or a loaded carry could
only be timed by filing it under cardio, which then put it in the wrong charts.

A routine entry can now say so itself — reps, time or cardio. Entries without a mode keep
behaving exactly as before, so every existing plan, workout and shared plan file is read
unchanged and nothing needs migrating.

Timed sets get a work timer that counts the set itself, kept deliberately separate from
the rest timer: the two mean opposite things and must never run together. Finishing early
logs the time actually held, not the target, because crediting a full 45 seconds for a
38-second hold would quietly corrupt the log it exists to keep.

Finished workouts now also store what the session prescribed. Without it, history cannot
say whether a session hit its reps, and a timed session reads back as "0 reps".
2026-07-25 14:58:20 +02:00
Duarte Santos a54bad2641 Estimated 1RM: the calculation, and only from sets that can support it (#18)
Working out how strong a set was meant leaving the app. Epley by default, with Brzycki
and Lombardi available and documented.

Two things it deliberately refuses to do:
 · guess above 12 reps, where the formulas disagree by double digits and the answer says
   more about work capacity than about maximal strength;
 · read `topW`, the working weight you confirm after an exercise — it carries no rep
   count, so it cannot produce an estimate at all.

It also knows nothing about the exercise database. An estimate needs a weight AND reps,
and only reps-mode sets carry both, so cardio and timed sets drop out of every scan on
their own rather than through a type check that would need keeping in sync.
2026-07-25 14:58:10 +02:00
Duarte Santos 0818f1b32b Tests: a runner for the pure helpers
The logic that decides what you lift next has no business being verified by hand in a
browser. Vitest is a dev dependency only — the app itself stays dependency-free.
2026-07-25 14:58:01 +02:00
Duarte Santos 62a0b00fbb i18n: the new strings in all 11 language packs
Twelve keys for the plan-import notice, the mixed-unit warning, the
singular counts, the weigh-in button and the error boundary, anchored
next to the strings they belong with. Drops 'Skip today' and
'{0} routines · {1} exercises', which the code no longer uses, and
retunes the German streak line ('13 Wochen in Folge').

All packs stay at the same key count.
2026-07-24 23:45:43 +02:00
Duarte Santos 827c0f8505 UI fixes found while testing the workout flow
· The rest timer floats above the tab bar, so it covered the set rows
  underneath it — during a rest, the next set was behind the bar. The page
  now gets enough bottom padding while a rest runs to scroll clear of it.
· "Skip today", sitting right under "Save & start workout", reads like
  skipping the session rather than the weigh-in. It says "Start without
  weighing in".
· The calendar legend drew "Planned" in blue while planned days have
  always had a grey dot.
· Body weight showed "− 0" when it hadn't moved since the last weigh-in.
· In a superset both exercises are on screen at once, so their animations
  give way: 180px meant scrolling a full screen between two exercises you
  are meant to alternate.
2026-07-24 23:45:36 +02:00
Duarte Santos 43d5495007 Import from other apps: convert weights per row, not per file
The unit was decided once for the whole file: if any row said lb and none
said kg it converted, otherwise it did nothing. FitNotes writes the unit
next to every set, so a history recorded partly in pounds and partly in
kilos hit the 'otherwise' branch — the file was taken over unconverted
and "185 lb" was logged as 185 kg, while the summary claimed the file
does not say which unit it uses.

Each row now carries its own unit through to the conversion (falling back
to the file's, then to the profile's), and a mixed file says so in the
preview.

Also: the "exercises matched" tile counted matched rows, so three
exercises across five sets read as five. It counts distinct exercises
now, which is what the label says.
2026-07-24 23:45:17 +02:00
Duarte Santos 3d5b00cecd A shared plan file can no longer take the app down
Importing a plan whose exercise ids this build doesn't know — a
hand-edited file, an export from a build with a different dataset — put
those ids straight into a routine. The routine editor skipped them
silently (you could neither see nor delete them), and starting the
routine reached for ex.n on undefined: white screen, no tab bar, no way
back. The running workout is persisted, so it came back on every reload.

Three layers, so this class of bug can't reach the screen again:

  · parsePlan() drops ids that resolve to neither the library nor a
    custom exercise carried in the same file, and the import sheet says
    how many were left out.
  · exOr() renders an unresolvable id as a placeholder, so the routine
    editor shows it (and lets you remove it) instead of hiding it, and
    the workout view survives one.
  · an ErrorBoundary around the routes: it keeps the tab bar alive,
    offers a reload, and can discard a running workout that can't be
    drawn. It is keyed on the route, so switching tabs clears it.

Turning the schedule switch on now really replaces Mon–Sun, as the
switch has always claimed. It only wrote the days the shared plan filled,
so days it left empty kept your own routine and you silently ended up
training a mix of two plans.

Also here, because they sit in the same lines: the tags that carry a unit
or a whole sentence opt out of the capitalise rule ("Best: 85 Kg", "Last
Time You Hit All Reps"), and the workout header's "best" now includes the
working weight you confirmed, so it agrees with the sheet that asked for
it.
2026-07-24 23:45:04 +02:00
Duarte Santos c8a68e37e1 Numbers follow the UI language, volume stays in your own unit
fmtNum was pinned to en-CH, so every user in every one of the twelve
languages got Swiss apostrophes: "7'535 kg". It now uses the same locale
as the dates.

fmtVol turned anything over 10 000 into tonnes regardless of the profile's
unit — "18.8t" is meaningless for a pound profile, and inside one history
list "18.8t" next to "7'535 kg" is two numbers you can't compare. Volume
is now always shown in the unit you train in.

The weight slider's ceiling of 300 was a kg number applied to both units;
in pounds it cut off at 136 kg, below plenty of people's body weight and
well below an everyday squat. It now follows the unit.

Also: a shared exCount() so "1 exercises" reads "1 exercise", and
durPart() so imported workouts (which carry no clock) stop claiming
"0 min".
2026-07-24 23:44:20 +02:00
Duarte Santos 238b435c2b i18n: translate plan-sharing strings into all 11 languages
24 new plan-share/PDF strings added to every locale pack (513 keys each),
anchored on each pack's existing terms (routine/exercise/import/week).
2026-07-24 01:22:09 +02:00
Duarte Santos af9289dcd9 Plan sharing: export/import a plan file + printable PDF
New "Share your plan" action in the Plan header (lib/plan-share.js):
- Export plan file: a small JSON with just your routines, the week schedule and any
  custom exercises they use — a friend imports it into their own openGym. Import
  merges (adds routines with fresh ids, dedupes customs by name+body part, optional
  "use this schedule"), so nothing they already have is overwritten.
- Print / Save as PDF: a clean, one-page-per-plan printout rendered in a hidden
  iframe; break-inside:avoid keeps every exercise (and each routine that fits) whole,
  so an exercise never splits across a page.
2026-07-24 01:12:07 +02:00
Duarte Santos 211fb86480 Icons: full-strength glyphs in the routine icon picker
The pickable routine icons were painted at --label-2 (60%), so the whole picker
looked faded when creating/editing a routine. Bring them to full --label; the
selected cell stays accent-on-accent.
2026-07-23 23:28:47 +02:00
Duarte Santos 6f557399b1 Icons: render at full strength everywhere, drop the muted-grey chrome
Follow-up to the opacity removal: the remaining faded icons were muted by colour,
not opacity. Bring list chevrons (.chev) and row icons (.lrow-c) from --label-3 up
to full --label, and lift the empty-state icon to its caption strength (--label-2).
Semantic colours (accent/orange/yellow/green) are left untouched.
2026-07-23 23:23:43 +02:00
Duarte Santos 17c2324f74 Icons: drop the opacity fade on tab-bar and tile icons
The .3/.32 opacity made those icons look washed-out/see-through. Remove it; the
active/inactive tab distinction still reads via colour (label vs accent) and the
heavier stroke on the active tab.
2026-07-23 23:12:49 +02:00
Duarte Santos 41f17934a9 Icons: redraw abs and pullup so strokes stop crossing through each other
The hollow line icons showed overlapping strokes through their transparency:
- abs drew full-width crease lines through a full-height centre line (a see-through #);
  now a six-pack whose centre seam runs the gap between crease pairs, no crossings.
- pullup's head circle sat on the arm-V apex; lifted it clear so the body no longer
  reads as tangled lines behind a transparent head.
2026-07-23 23:08:50 +02:00
Duarte Santos df91727dcf Website: milestones timeline builds itself from published GitHub releases
No more hand-maintained history on the about page — site.js renders one
timeline entry per published release (title, date, first paragraph of
the notes, link). Static entries remain only as an offline fallback.
2026-07-23 15:58:06 +02:00
Duarte Santos ae399cd1dd Website: fix screenshot aspect ratio, embed the live demo, GitHub button in hero
The screenshot img tags carry width/height attributes; with only a CSS
width the height attribute won (240x2532 — stretched). height:auto fixes
it. New #demo section runs the GitHub-Pages demo in a phone frame right
on the page; nav gets a Demo link and the hero a GitHub star button.
2026-07-23 15:54:25 +02:00
Duarte Santos becd2357ff Project website + one icon everywhere
website/ holds the source of opengym.duarte-santos.ch — landing with live
GitHub stats, docs and the story behind the app; no build step. The
native app icons are now generated (capacitor-assets) from the same
blocky dumbbell as the PWA icon, traced into resources/icon.svg, so the
APK, home-screen PWA, and website favicon all match.
2026-07-23 15:49:21 +02:00
Duarte Santos 768dee50ca Release v1.2.2: history import, standalone mobile app, APK distribution
Consolidates everything since v1.2.1: the FitNotes/Strong/Hevy/Apple
Health importer, the Capacitor-based standalone mobile flavor, and the
store-free distribution story — signed Android APK from
opengym.duarte-santos.ch, docs corrected to match (no store listings;
iOS via self-hosted PWA or Xcode free signing).
2026-07-23 15:36:05 +02:00
Duarte Santos 4888fed0c4 Android: version 1.2.1 in the app manifest 2026-07-23 15:28:06 +02:00
Duarte Santos ee2be743b0 Standalone mobile app: Capacitor shells for iOS and Android
A second flavor of openGym (VITE_MOBILE=1) that runs entirely on the
phone: no account, no server, no sync. State is mirrored into a file in
the app's private storage (survives WebView storage eviction), the
workout-day reminder is a native local notification scheduled on planned
weekdays, and backups export through the OS share sheet. Exercise media
loads from the same CDN as the demo build. npm run build:mobile, then
Android Studio / Xcode — see docs/MOBILE.md. NOTICE.md gains an AGPL §7
app-store exception.
2026-07-23 15:14:36 +02:00
Duarte Santos 389315625c Import history from FitNotes, Strong, Hevy and Apple Health
Losing years of logging is the thing that stops people trying another
tracker, so Settings -> Data -> Import from another app now reads their
exports directly.

All of these ship the same thing in a different dialect: one row per set
with a date, an exercise name and some mix of weight/reps/distance/time.
So the parser builds a column map from the header rather than assuming
positions, and a new app is usually a few header aliases. Verified
against real exports from Strong (1903 sets) and Hevy, both FitNotes
column layouts, and an Apple Health body-mass extract.

Exercise matching is the part that decides whether this is useful.
Parenthetical qualifiers and BB/DB shorthand are normalised, names are
compared as an order-independent bag of words, and a curated table maps
the plain names people actually log onto the dataset's qualified ones -
without it, 'Squat' resolved to 'weighted squat' and 'Leg Press' to
'smith leg press'. Where a name stays genuinely ambiguous it is left
unmatched and becomes a custom exercise rather than guessed at: filing
years of training under the wrong lift is worse than a name the user can
see and fix. Nothing in the file is ever dropped.

A summary sheet shows workouts, sets, matches, misses and any unit
conversion before anything is written, and merging skips days that
already have data, so importing twice - or from two apps - never
duplicates a workout.
2026-07-23 14:50:36 +02:00
Duarte Santos fac45f9af9 Release v1.2.1: muscle map and live demo
Consolidates everything since v1.2.0 into one version: the muscle map
(Stats balance card, routine preview, finish screen, male/female body
diagram), the browser-only GitHub Pages demo, and the fix for the blank
screen when finishing a workout from its last exercise.

api/package.json tracks the release alongside the frontend.
2026-07-23 12:56:52 +02:00
Duarte Santos cd77cfdd84 Muscle map: see which muscles your training actually reaches
A front-and-back body diagram, shaded with the same accent ramp as the
activity heatmap, in three places: Stats gets a Muscle balance card over
a week / 30d / 90d / all-time window, the routine editor previews what a
session hits while you build it, and the finish screen shows what you
just trained. Settings switches between a male and female figure.

The Stats card's real job is the list underneath: the muscles that got
nothing in the period. Load is counted in effective sets — full weight
for an exercise's target muscle, partial for its supporting ones — not
kilograms, since 100 kg of leg press and 12 kg of lateral raise say
nothing about which muscle worked harder. Shading is relative within the
window, so it always reads as a balance rather than an absolute.

The dataset spells muscles inconsistently ('delts', 'deltoids' and
'shoulders' are one muscle); all 50 spellings it uses are normalised onto
the 18 the diagram draws, verified against the full catalogue so nothing
is dropped silently. Custom exercises fall back to their body part.

Geometry is converted from MuscleMap (MIT, see NOTICE.md), which ships
its paths as Swift source rather than .svg. At ~90 kB it is imported
dynamically, so the initial bundle is unchanged.

Also fixes a crash this surfaced but did not cause: finishing a workout
from its last exercise blanked the whole app, because the per-exercise
weight sheet read the running workout without checking it was still
there and finishing clears it while that sheet is on screen.
2026-07-23 12:51:24 +02:00
Duarte Santos e9bf38f39b Publish a browser-only demo to GitHub Pages
Self-hosting is a fair ask once someone knows they want the app, but it's a lot
to ask of someone deciding whether to look at it at all. A demo build (VITE_DEMO=1)
drops the parts that need the backend — passkeys, sync, admin — and boots straight
into guest mode with a seeded example profile, so every screen has real data behind
it: twelve weeks of Push/Pull/Legs with progression and the odd missed session,
twice-weekly weigh-ins trending toward a goal, PRs, and today's session moved onto
the current day so there's always something to press Start on.

The seed generator is imported dynamically and the demo-only UI folds away at build
time, so none of it lands in the bundle self-hosters ship. Exercise media (~140 MB)
isn't committed anywhere, so the demo build points VITE_IMG_BASE / VITE_GIF_BASE at
the upstream dataset on jsDelivr, pinned to a commit; unset, both still resolve to
img/ and gif/ next to the app exactly as before.

Deployed by a Pages workflow on every push to main.
2026-07-23 12:42:40 +02:00
Duarte Santos 3c5bcd5957 Refresh README, self-hosting docs and dependencies for v1.2.0
Screenshots were still from the old design — all five regenerated from a
seeded three-month history.

The feature list had been behind since v1.1.0: push notifications and the
workout-day reminder were never listed, nor were custom exercises, the
equipment filter or the admin dashboard. ADMIN_UIDS and INVITE_ONLY were
documented in .env.example but missing from the README config table, and
docs/SELF_HOSTING.md still claimed there was no admin/invite system by
design — it now explains how to turn one on.

api/package.json version was lagging at 1.1.1; it tracks the release now.
React and @vitejs/plugin-react picked up their patch releases (lockfile
only, no manifest change); api dependencies were already current and both
trees audit clean.
2026-07-23 12:07:10 +02:00
Duarte Santos b28a58930c Release v1.2.0: complete visual redesign
Rebuilt design system (one type scale, neutral surface ramp, hairline
separators), a 77-icon hand-drawn set replacing every emoji in the UI,
grouped routine-icon picker with the old emoji mapped forward, new tab
bar with a raised Start/Resume button, and a reorganised Home.

Chart fixes that came out of it: axis labels, gridlines and the target
line were painted with colour variables the new sheet no longer defines
and fell back to black-on-black; the hover readout is now placed from
its measured size so it can't be clipped at the edges, and it clears
when the pointer leaves the chart.
2026-07-23 11:55:52 +02:00
202 changed files with 22270 additions and 1341 deletions

No files matched your search

+10
View File
@@ -34,6 +34,16 @@ RP_NAME=openGym
#
# INVITE_ONLY=1
# ── Session length (optional) ──────────────────────────────────────────────
# How long a sign-in lasts, in days. Default 90 — long enough that people who
# train regularly never see a login screen, short enough that a stolen cookie
# doesn't stay good forever. Lower it for an instance on the open internet,
# raise it for a private one. Only affects new sign-ins; cookies already handed
# out keep the lifetime they were issued with. Users can end every session on
# every device themselves with "Sign out everywhere" in Settings.
#
# SESSION_DAYS=90
# ── Notifications (optional) ───────────────────────────────────────────────
# Push works out of the box — nothing to set. VAPID keys are generated on first
# run and saved to ./data/vapid.json. Each user's browser reports its own
+4
View File
@@ -0,0 +1,4 @@
# Puts a "Sponsor" button on the repo header. The GitHub entry only works once the account is
# enrolled in GitHub Sponsors (github.com/sponsors — identity check, Stripe payout account and
# a tax form); until then the button is simply not shown.
github: DuarteSantos8
+11 -2
View File
@@ -1,5 +1,14 @@
blank_issues_enabled: false
contact_links:
- name: Questions & contributing
- name: Question or self-hosting help
url: https://github.com/DuarteSantos8/openGym/discussions/categories/q-a
about: Login/passkey trouble, reverse proxies, Docker, "how do I…" — ask in Q&A, not in an issue.
- name: Idea or feature request to talk through
url: https://github.com/DuarteSantos8/openGym/discussions/categories/ideas
about: Not sure it belongs in the app yet? Float it in Ideas first — issues are for agreed work.
- name: Show your setup
url: https://github.com/DuarteSantos8/openGym/discussions/categories/show-and-tell
about: Running openGym somewhere interesting, or built something on top of it? Show it off.
- name: Contributing guide
url: https://github.com/DuarteSantos8/openGym/blob/main/CONTRIBUTING.md
about: Read the project layout, dev setup, and guidelines before opening an issue.
about: Project layout, dev setup and guidelines before you open a PR.
+102
View File
@@ -0,0 +1,102 @@
# Dependency updates, deliberately quiet.
#
# openGym is dependency-light on purpose: the frontend is React + Router + Zustand, and api/
# has two runtime dependencies. A default Dependabot setup would still open a PR per package
# per week, which on a solo project means the alerts stop being read — the opposite of what
# this is for. So: monthly, everything in an ecosystem grouped into a single PR, and a low
# cap on open PRs. Security advisories are unaffected by any of this; GitHub raises those
# regardless of schedule.
#
# Only manifests that actually exist here are listed. Deliberately NOT covered:
# - gradle (frontend/android) and cocoapods (frontend/ios) — Capacitor generates those shells
# and pins the native versions to the @capacitor/* npm packages. Bumping them independently
# desyncs the two and breaks the mobile build; they follow the npm update instead.
version: 2
updates:
# Frontend app — frontend/package.json
- package-ecosystem: npm
directory: /frontend
schedule:
interval: monthly
open-pull-requests-limit: 3
groups:
# Routine bumps arrive as one PR. Runtime and build tooling move together anyway (a Vite
# bump usually wants its plugin bumped), and splitting them doubles the review without
# splitting the risk.
frontend:
patterns: ['*']
update-types: ['minor', 'patch']
# Majors get their own PR. The first grouped run bundled a Capacitor 7 → 8 migration in
# with six siblings, where it read as housekeeping — and CI would have gone green on it,
# because the test workflow builds the web app and never touches the mobile flavour. A
# major that lands alone is at least obviously a decision.
frontend-major:
patterns: ['*']
update-types: ['major']
ignore:
# Capacitor 8 needs Node >= 22 (its own `engines` field) and the build host is on 20, and
# `frontend/android` + `frontend/ios` are committed, so a major also means migrating the
# native projects — Gradle/AGP, the Podfile. That is a deliberate piece of work, not a
# dependency bump. Drop this ignore once the build host is on Node 22 and you want it.
- dependency-name: '@capacitor/*'
update-types: ['version-update:semver-major']
# Backend — api/package.json (@simplewebauthn/server, web-push)
- package-ecosystem: npm
directory: /api
schedule:
interval: monthly
open-pull-requests-limit: 3
groups:
api:
patterns: ['*']
update-types: ['minor', 'patch']
# Two dependencies, but one of them verifies passkeys — a major there is worth reading on
# its own rather than alongside anything else.
api-major:
patterns: ['*']
update-types: ['major']
# Base images — api/Dockerfile (node:22-alpine)
- package-ecosystem: docker
directory: /api
schedule:
interval: monthly
open-pull-requests-limit: 1
ignore:
# Odd-numbered Node majors are "Current", never LTS — they stop getting fixes in about
# six months. Dependabot's first run offered 22 → 25, which for something other people
# self-host is a stability downgrade for nothing. Even majors (22 → 24 → 26) still get
# proposed, which is the move actually worth reviewing.
- dependency-name: node
versions: ['25.x', '27.x', '29.x', '31.x', '33.x']
# Base images — web/Dockerfile (node:22-alpine build stage + nginx:alpine)
- package-ecosystem: docker
directory: /web
schedule:
interval: monthly
open-pull-requests-limit: 1
ignore:
- dependency-name: node
versions: ['25.x', '27.x', '29.x', '31.x', '33.x']
# Workflow actions — everything under .github/workflows/
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
open-pull-requests-limit: 2
groups:
# These are all first-party actions/* and docker/* pinned to a major tag; they update
# in lockstep and none of them is worth a PR of its own.
actions:
patterns: ['*']
update-types: ['minor', 'patch']
# Action majors are usually a runner or Node-version change and usually harmless — but
# these workflows publish the ghcr images and deploy the live demo, so the blast radius
# is real. Separate PR, so a failure has an obvious cause.
actions-major:
patterns: ['*']
update-types: ['major']
+6 -6
View File
@@ -23,22 +23,22 @@ jobs:
context: .
file: ./web/Dockerfile
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Lowercase owner (registry names must be lowercase)
id: repo
run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/setup-qemu-action@v4
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v3
- uses: docker/login-action@v4.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
- uses: docker/metadata-action@v6
id: meta
with:
images: ghcr.io/${{ steps.repo.outputs.owner }}/opengym-${{ matrix.image }}
@@ -47,7 +47,7 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- uses: docker/build-push-action@v6
- uses: docker/build-push-action@v7
with:
context: ${{ matrix.context }}
file: ${{ matrix.file }}
+60
View File
@@ -0,0 +1,60 @@
# Publishes the browser-only demo to GitHub Pages: https://duartesantos8.github.io/openGym/
#
# Pages serves static files only, so this build has no backend — VITE_DEMO=1 makes the app
# boot straight into guest mode with a seeded example history (see frontend/src/lib/demo.js).
# The exercise images/GIFs (~140 MB) are never committed here; the demo build points at the
# upstream dataset on jsDelivr instead, pinned to a commit so the CDN can cache it forever.
name: Deploy demo to GitHub Pages
on:
push:
branches: [main]
paths:
- 'frontend/**'
- '.github/workflows/pages.yml'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
env:
DATASET: https://cdn.jsdelivr.net/gh/hasaneyldrm/exercises-dataset@7455efae41b330c265e7cd4b78dfa848e7ce5ebd
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json
- run: npm ci
working-directory: frontend
- run: npm run build
working-directory: frontend
env:
VITE_DEMO: '1'
VITE_IMG_BASE: ${{ env.DATASET }}/images/
VITE_GIF_BASE: ${{ env.DATASET }}/videos/
- uses: actions/configure-pages@v6
- uses: actions/upload-pages-artifact@v5
with:
path: frontend/dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- id: deploy
uses: actions/deploy-pages@v5
+65
View File
@@ -0,0 +1,65 @@
# Runs on pull requests too — the other two workflows only fire on push to main, so
# contributed changes used to reach main without anything ever having been run.
name: Tests
on:
pull_request:
paths:
- 'frontend/**'
- 'mcp/**'
- '.github/workflows/test.yml'
push:
branches: [main]
paths:
- 'frontend/**'
- 'mcp/**'
- '.github/workflows/test.yml'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# node:22-alpine in web/Dockerfile and api/Dockerfile — CI must match production.
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json
- run: npm ci
working-directory: frontend
- run: npm test
working-directory: frontend
# A broken import or bad JSX fails the build long before any test covers it.
- run: npm run build
working-directory: frontend
- run: node scripts/check-locales.mjs
working-directory: frontend
mcp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
cache-dependency-path: mcp/package-lock.json
- run: npm ci
working-directory: mcp
- run: npm test
working-directory: mcp
# The one check the vitest suite structurally cannot make. The MCP server is a bare node
# process, but vitest runs its tests through Vite — import.meta.glob, .jsx imports and
# ?raw all resolve happily there. That is how a Vite-only import reached a shared lib
# module with 33 green tests standing over a server that died on startup.
- run: npm run check:node-loadable
working-directory: mcp
+386
View File
@@ -1,5 +1,391 @@
# Changelog
## v1.2.5 — 2026-08-04
Nothing in the app itself changed. This release adds an optional side door: a small server that
lets an AI assistant you already run — Claude Desktop, Cursor, Cline — answer questions about
your own training, off the same files your instance already writes. If you don't use one, this
release is invisible to you.
### Ask an AI about your training, without the data leaving your box (#19)
- 🤖 **An MCP server (`mcp/`)** — opt-in, read-only, and not part of the Docker build. Your LLM
client spawns it as a local process, it reads `./data` directly, and it exits when the client
disconnects. No new container, no extra auth on the api, no third-party service, nothing over
the network. *"What did I bench last week?", "what's my estimated 1RM on deadlift?", "which
muscles have I been neglecting?"*
- **The answers match the Stats screen because they are the same numbers.** The server calls the
very functions in `frontend/src/lib/` the app already computes with, rather than reimplementing
them. Eight tools: routines, the week plan, workouts, one session in detail, body weight,
estimated 1RM and muscle balance.
- **Read-only on purpose.** Logging a workout from an assistant needs a long-lived token the api
does not have yet, plus a lock against the web UI's read-modify-write. Until both exist, the
server answers questions and does nothing else. It never reads passkey material, VAPID keys or
session state — only the profile it was pointed at.
- `docker-compose.yml` is untouched and nothing new enters the image, so an instance that ignores
this ships exactly what it shipped before. Setup is in [mcp/README.md](mcp/README.md).
### Under the hood
- The pure half of `i18n.js` — the language state, the constants, the readers — moved into
`i18n-core.js`, so the helpers under `frontend/src/lib/` can be loaded by a plain Node process
and not only by Vite. `i18n.js` keeps the Vite-only parts (the locale-pack loader, the React
hook) and re-exports the rest, so nothing that imports it had to change.
- The shared lib modules that only need `t` now take it from the core directly. A Vite-only
import inside a shared module is invisible under vitest, which transforms it, and fatal to the
MCP server, which does not — so the shared half stays clear of the bundler half by
construction rather than by remembering to.
- `npm run check:node-loadable` in `mcp/` walks the server's import graph under a bare `node`,
which is the one thing the test suite cannot do from inside Vite. CI runs it, alongside the
MCP tests — neither had ever run there before.
The MCP server was contributed by [@Pengboi](https://github.com/Pengboi) — the first feature in
openGym written by someone other than me. Thank you.
## v1.2.4 — 2026-08-01
The effort ratings you have been recording since v1.2.3 now answer questions, and bodyweight
training stops being treated as barbell training with the weight left at zero. Plus: creating a
profile from Settings works on an invite-only instance, which it never has.
### The effort ratings, read back as statistics
v1.2.3 let you rate how hard a set was. Nothing then read that rating back — it lived in the set
label and nowhere else. Stats now answers the question the number was recorded for.
- 📊 **An Effort card in Stats** over 30d / 90d / 1Y / all time: average effort, the share of sets
taken close to failure, and — always alongside them — how much of your training was rated at
all. Rating is optional and off by default, so a partly rated history is normal; an average
without its denominator would quietly speak for sets you never rated.
- **Week by week.** The weekly average with that week's set count in the tooltip, because the
pair is the reading: volume up with effort up is fatigue accumulating, volume up with effort
flat is the adaptation you were training for. Weeks resting on a single rated set are dropped
rather than drawn.
- **Where the sets land.** The spread across the scale, not just the middle of it. Half your sets
at failure and half in warm-up territory average out to a healthy-looking number; this is the
chart that shows it.
- 🔥 **Hard-sets mode on the muscle map.** The same body diagram, counting only sets taken near
failure — "where did the stimulus go" rather than "where did the volume go". A muscle can lead
on set count and still never be trained hard.
- **Effort on the exercise curve.** Each session's dot on the top-set chart fills in as less is
left in the tank, so the same weight moved with more in reserve stops reading as a flat line.
Exercises with enough ratings also get an Effort curve of their own.
- **One history, whichever scale you use.** Everything aggregates internally in RIR and converts
back for display, so a history that mixes your own RIR logs with imported RPE averages as one
series instead of two half-empty ones. RIR charts count downward on the axis, so harder sets
sit higher.
- Translated into all 12 UI languages.
### Bodyweight training, logged the way it is done
A push-up has no weight to type, and the app asked for one anyway — every set, on a quarter of
the catalogue. Three reports (#31, #32, #33) turned out to be the same gap: the app assumed
progress lived in the load. It doesn't, for the exercises most people actually start with.
- 💪 **Exercises know they are bodyweight.** Seeded from the equipment the dataset already
records, so push-ups, pull-ups, dips and 300-odd others arrive marked. The weight column is
not shown, the set row is one stepper instead of two, and the "confirm your working weight"
prompt at the end of an exercise stops asking about a weight that was never there. (#32)
- **Added weight when there is any.** A dip belt or a weighted vest is entered once in the
exercise settings and reads as an addition — "+10 × 8", not "10×8" — everywhere it is shown
back. With load on the belt the normal progression rules take over again, because now there
is something to add.
- 📈 **Reps and sets are the progression.** Clean session, one more rep. Set a top of the range
and reaching it adds a set and starts the reps over instead of climbing forever; at six sets
it says what it should have said all along, which is that it is time for weight or a harder
variation. No ceiling set keeps the old behaviour exactly. (#33)
- ↔️ **Reps per side.** For lunges, single-arm rows and every other unilateral movement. You
log what you did — 16, the total — and the app shows the split, "8 per side", so the set in
front of you is unambiguous without the rep count meaning one thing here and another there.
The target steps in twos, 16 → 18 → 20, because half of an odd total is a rep one side never
gets. (#31)
- Both settings travel with a shared plan, and are written to a plan file only when they
disagree with the catalogue — every existing plan, workout and backup is read unchanged and
none of it needs migrating.
- Translated into all 12 UI languages.
### Fixed
- **Creating a profile from Settings on an invite-only instance.** The sign-in screen asks for
the invite code when the server needs one; the same registration reached from Settings never
did, so it was refused with nothing on screen explaining why. It now asks on the same terms.
- **A long value no longer runs through its own label** in a settings row — "Follow the routine
(Linear progression)" overlapped "Rule" rather than shortening itself.
## v1.2.3 — 2026-07-31
How hard a set was, in whichever of the two scales you already think in — and the ratings your
old app recorded come across with the rest of your history. Plus: the phone stops locking itself
mid-workout, the rest timer can hand time back as well as take it, and Settings is grouped by
what each thing actually affects.
### The screen stays on while you train
- ☀️ **Keep screen awake — Settings → *During a workout*, on by default.** Locking, unlocking
and finding your place again between every set was the single most annoying thing about
logging on a phone. The screen now stays lit for as long as a workout is running and lets go
the moment you finish it, so nothing is held while you are not training.
- **It survives a tab switch.** Browsers release the lock whenever the page stops being visible,
which is exactly what happens when you glance at a message. The lock is taken again each time
the app comes back, rather than dying the first time you look away.
- **It follows the workout, not the screen you are on.** Checking Stats mid-session keeps the
screen awake.
- **Where it isn't available, it says so.** iOS grants no wake lock in Low Power Mode, and older
browsers have no Wake Lock API at all — the first is silent, the second shows the row disabled
rather than offering a switch that does nothing. Needs HTTPS, like every other modern browser
capability.
### Rest timer: take 15 seconds off, too
- ⏳ **A −15s button next to +15s.** The timer could only ever be extended or skipped outright;
now it goes both ways. Taking off more than is left finishes the rest rather than counting
into the negative — the same thing Skip does.
- **Rearranged so three controls fit.** The clock and the progress bar take the top row and the
controls sit underneath: −15 and +15 together in number-line order, Skip pushed to the far
edge so the button that ends the rest is not next to the one you tap to buy more time. On a
wide screen it stays on one line. Tap targets are bigger than they were.
- **The bar is nearly opaque.** The set rows underneath were reading through it and making the
clock hard to pick out.
### Settings, grouped by what it affects
- **General** (language, units) · **During a workout** (rest timer, keep screen awake, sounds,
effort per set) · **Notifications** · **Appearance** (theme, body diagram, accent) · **Data**.
- The old grouping mixed axes: "Units & timer" put a display preference next to two workout
behaviours, language sat under Appearance, and *Load starter plan* was buried between the
backup actions and the destructive reset. Data now reads in the order you would use it — fill
the plan, bring history over from another app, restore a backup, export one, wipe everything.
- Nothing was removed and no setting changed its meaning.
### Effort per set: RIR or RPE (#21)
- 🎯 **A third column on a working set, off by default.** Settings → *Effort per set* switches
it between **Off**, **RIR** and **RPE**. It only appears on weighted rep sets: a plank or a
treadmill row has nowhere to put it.
- **Two names for the same judgement.** RIR counts the reps you left in the tank; RPE reads the
same effort off a 10-point scale, so RPE ≈ 10 − RIR. The setting has an (i) that lays the two
scales side by side in a conversion table rather than explaining them in a paragraph.
- **Each set keeps the scale it was logged with.** Switching the setting changes what new sets
ask for and nothing else — history is never silently rewritten, and a set logged as RIR 2
still reads back as RIR 2 years later.
- **An unrated set stays unrated.** Blank and 0 are different things: RIR 0 says the set went to
failure. So `−` on an untouched cell leaves it empty, `+` starts at the bottom of the scale
and walks up in even steps, and stepping back off the bottom clears the cell again — a mistap
is always undoable.
- **Nothing else reads the value.** Progression rules and estimated 1RM are unaffected; the
rating is yours to look at, not an input to the maths.
- Upgrading keeps the column you had: a profile still carrying the old `showRir` flag — from
this device, a sync, or a backup restored later — comes across as RIR.
### Import brings your ratings with it
- 📥 **The RPE Hevy and Strong export is no longer dropped.** An `RPE` column is read into the
set, as is an `RIR` column if a file has one, and the import summary says how many sets
arrived with a rating — plus where to switch the column on if it's off.
- A blank cell stays unrated rather than becoming 0. A written-out `0` counts as a rating on the
RIR scale (a set to failure) but not on RPE, which starts at 1 — apps write 0 there to mean
"nothing here", and reading it as an effort would stamp one on every unrated set in the file.
- Ratings above the scale are capped instead of thrown away, and junk in the column is ignored
without losing the set.
- Backups already carried both fields and the setting, since a backup is the whole state — there
are now tests pinning that, so it can't quietly stop being true.
## v1.2.2 — 2026-07-25
Training that moves on its own: an exercise can now be logged by time instead of reps, the
next weight follows a progression rule you choose rather than a single hard-coded hint, and
every lift carries an estimated 1RM. Plus a standalone mobile app, a shareable plan, and an
importer for your history from other apps.
### Timed sets and a timer for the set itself (#16)
- ⏱️ **Reps or time, per exercise.** Planks, hangs, wall sits, dead hangs and loaded
carries no longer have to be filed under cardio to be timed. Each exercise in a routine
picks its own mode, and a timed set can still carry weight for a weighted plank or a
farmer's walk.
- ▶️ **A work timer, separate from the rest timer.** Start a timed set and it counts the
hold down, beeping and buzzing at zero exactly as the rest timer does, then checks the
set off itself. The two timers can never run at once — they mean opposite things.
- Finishing a hold early logs **the time you actually held**, not the target. A 38-second
hold against a 45-second target is recorded as 38 seconds.
- The mode travels everywhere it should: routine editor, workout, history, exercise
statistics (timed exercises chart their longest hold), the printable plan and the shared
plan file.
- Plans made before this release are read exactly as they always were — nothing to migrate.
### Progression rules you can read (#17)
- 📈 **Pick a rule per routine, override it per exercise.** Linear progression, **Greyskull
LP** (two straight sets plus an AMRAP final set, with double jumps and a 10 % reset),
double progression through a rep range, or adding time for timed work. Or none at all.
- 🧾 **Every target explains itself.** "Every rep last time — 2.5 kg more." "Missed reps
3 sessions running — reset to 55 kg and work back up." The rule is visible before you
train, not after.
- The session opens with the right weights already in the rows, instead of suggesting them
once you are standing at the bar.
- 🚫 **A bad session can't look like a good one.** Short reps count as a miss even when you
checked the set off; a set you never checked counts as a miss because you did not do it.
Nothing advances the load on a session that fell apart.
- Stalls and deloads are worked out from your log every time they are needed. Nothing is
written back into a finished workout and no counters are stored, so fixing a mistyped set
immediately produces the right next target.
- Lower-body lifts step up in larger jumps than upper-body ones by default, and any
exercise can set its own step.
- Bodyweight exercises progress in **reps**, because there is no load to add to a push-up
and no load to take off it either.
### Estimated 1RM (#18)
- 💪 **An estimated one-rep max for every lift**, in the exercise progress card (with its
own curve you can switch to) and in the exercise detail sheet.
- It always names the set it came from — "from 90 kg × 5 on 15 Jul" — because an estimate
off a heavy triple and one off a set of ten are very different claims.
- 🧮 **A calculator** for a set you have not done yet, so the number is reachable before
there is any history.
- Epley by default, and it **refuses to guess above 12 reps**, where the common formulas
disagree by double digits.
- A new best estimate is reported at the end of a workout separately from a weight PR —
same weight for more reps is real progress, but it is not a heavier lift.
### Share a plan
- 📤 **Send someone your plan.** Plan → *Share your plan* writes a small file with your
routines, the week schedule and any custom exercises they use — and nothing else. No
workouts, no weigh-ins, no settings.
- Importing **merges**: shared routines arrive as new ones with fresh ids, custom exercises
are matched by name so they are not duplicated, and your own plan is never overwritten.
Taking the week schedule with it is optional.
- 🖨️ **A printable plan** (Save as PDF) laid out so a single exercise never breaks across
a page.
### Fixes
- A shared plan file naming an exercise this build doesn't have can no longer take the app
down. Unknown ids are dropped on import, anything that slips through renders as a
placeholder you can delete, and an error boundary around the screens means a bad state is
recoverable by switching tabs instead of reloading.
- Importing from another app converts weights **per row**, not per file. FitNotes writes the
unit on each set, so a mixed export used to land 185 lb as 185 kg.
- Numbers follow the UI language instead of a hardcoded locale, which was putting Swiss
apostrophes ("7'535 kg") in front of everyone. Volume stays in your own unit rather than
switching to tonnes, which was wrong for pound profiles.
- Taking over a week schedule from a shared plan now really replaces Monday–Sunday instead
of only the days the shared file happened to fill.
- The body-weight slider's ceiling follows your unit (300 kg / 660 lb).
- "Best: 85 Kg" is capitalised correctly again.
### One codebase, two flavors
openGym is also a standalone mobile app — and it ships as a direct APK download, not
through app stores.
- 📱 **Standalone mobile app.** The same frontend now also builds as a native iPhone /
Android app (Capacitor) — the install-and-done flavor of openGym: no account, no server,
no sync. Everything stays on the phone.
- State is mirrored into a file in the app's private storage on every change, so your
log survives even when the OS evicts WebView storage (iOS does).
- The workout-day reminder becomes a **native notification** scheduled on the weekdays
your plan actually has a routine — no push server involved.
- Backups go out through the OS **share sheet** (Files, AirDrop, mail…).
- Exercise images/animations load from the same CDN as the live demo.
- `npm run build:mobile`, then open `android/` in Android Studio or `ios/` in Xcode —
see **docs/MOBILE.md**. `NOTICE.md` now carries an AGPL §7 app-store exception.
- 🤖 **Android APK, no Play Store.** The official build is a signed, sideloadable APK
(~4.5 MB) from [opengym.duarte-santos.ch](https://opengym.duarte-santos.ch) — deliberately
store-free. docs/MOBILE.md covers building and signing your own.
- 🍎 **iOS reality check.** Apple permits no installs outside the App Store, so there is no
iOS download; the docs explain the free options (self-hosted PWA on the home screen, or
running the native app onto your own iPhone from Xcode).
- 📥 **Import your history from another app.** Settings → Data → *Import from another app*
reads an export from **FitNotes** (both the Android and the FitNotes 2 iOS format),
**Strong** and **Hevy**, and pulls body-weight history out of an **Apple Health** export.
Anything else with a date, an exercise name and weight/reps columns is read too.
- Every row becomes a set, grouped into workouts by date, so your history arrives with
its real dates rather than as one lump. Hevy and Strong also carry session length, so
the activity heatmap fills in properly.
- Exercise names are matched against the 1,324-exercise library — parenthetical
qualifiers like "(Barbell)" and shorthand like BB/DB are normalised, and a curated
table covers the plain names people actually log ("Bench Press", "Squat", "RDL").
Where a name is genuinely ambiguous it is *not* guessed at: it becomes one of your own
exercises instead, because filing years of training under the wrong lift is worse than
an unmatched name you can see and fix.
- A summary shows what will happen — workouts, sets, how many exercises matched, which
ones didn't, and whether weights need converting — before anything is written.
- Importing is idempotent: days you already have data for are left alone, so running it
twice, or importing from two apps, never duplicates a workout.
## v1.2.1 — 2026-07-23
A muscle map across the app, and a live demo you can try without installing anything.
- 💪 **Muscle map.** Three places now show which muscles your training actually reaches, drawn on a
front-and-back body diagram shaded like the activity heatmap — more accent means more work.
- **Stats → Muscle balance** aggregates a week, 30 days, 90 days or everything, lists your
hardest-worked muscles with their set counts, and names the ones that got *nothing* in that
period. That last list is the point of the card: the gaps are what you'd otherwise never notice.
Tap any muscle to read its name and volume.
- **Routine editor** previews what a session hits as you build it, so a hole in the plan shows up
before you train around it for a month.
- **The finish screen** shows what you just trained.
- Load is counted in *effective sets* — a set counts fully for the exercise's target muscle and
partially for its supporting ones — not in kilograms, because 100 kg of leg press and 12 kg of
lateral raise say nothing about which muscle worked harder. Shading is relative within the
period you're looking at, so the map always reads as a balance rather than an absolute.
- Settings → Appearance → **Body diagram** switches between a male and female figure.
- The exercise dataset spells muscles inconsistently ("delts", "deltoids" and "shoulders" are one
muscle); all 50 spellings it uses are normalised onto the 18 the diagram can draw. Custom
exercises, which only carry a body part, fall back to it. The geometry is ~90 kB and loads on
demand, so the initial bundle is unchanged.
- 🐛 **Fixed: finishing a workout from its last exercise could blank the whole app.** The
per-exercise weight sheet read the running workout without checking it was still there, and
finishing clears it while that sheet is still on screen.
- ▶️ **Live demo** at [duartesantos8.github.io/openGym](https://duartesantos8.github.io/openGym/) —
a browser-only build (`VITE_DEMO=1`) published to GitHub Pages on every push to `main`. It boots
into guest mode with a seeded example profile (12 weeks of Push/Pull/Legs, weigh-ins, PRs) so
every screen has something to show, and it never talks to a server. Passkeys, sync and the admin
dashboard stay exclusive to self-hosted instances, which is where the backend lives.
- 🖼️ Builds can point the exercise media elsewhere via `VITE_IMG_BASE` / `VITE_GIF_BASE` — the demo
serves the ~140 MB dataset from a CDN instead of shipping it. The default (`img/` and `gif/` next
to the app) is unchanged.
## v1.2.0 — 2026-07-23
A complete visual redesign. Same app, same data — every screen redrawn.
### A designed interface, not an assembled one
- 🎨 **Rebuilt design system.** One type scale carrying hierarchy through size instead of making
everything bold, a neutral surface ramp instead of saturated blue-greys, hairline separators
instead of outlined boxes, and motion that acknowledges a press rather than animating for
decoration. Light and dark are both first-class, and the eight accent colours now pick their
label colour by measured contrast — the default green in light mode was failing WCAG AA on
every primary button before.
- ✏️ **A hand-drawn icon set** (77 icons, single stroke weight, drawn on one 24×24 grid) replaces
every emoji in the interface. Emoji render differently on each platform, sit on their own
baseline and can't take a theme colour, which is what made the old UI feel stitched together.
Icons inherit the surrounding text colour and optical size.
- 🏋️ **Routine icons.** Picking an icon for a routine now offers a grouped set — strength,
equipment, cardio, recovery — instead of an emoji keyboard. Routines you already made keep
their look: the old emoji are mapped forward automatically, so nothing to migrate and nothing
to redo.
- ▶️ **New tab bar** with a raised Start button that turns into a pulsing orange Resume while a
workout is running.
- 🏠 **Home reads as a plan for today** — week strip, today's session as one tappable row, body
weight, and your streak.
### Charts
- 📈 **Axis labels, gridlines and the target-weight line are visible again** in dark mode. They
were painted with colour variables that no longer existed, which silently fell back to black
on black — and to no stroke at all for the lines.
- 💬 **The hover readout stays on screen.** It used to be positioned with a fixed offset that
assumed one label width, so the first and last point pushed it under the chart's clip; it's now
placed from its measured size and kept inside the frame, dropping below the point when the
point sits high enough that the label would cover the value it reports.
- 🖱️ **It also goes away again** — moving off the chart now clears the readout, crosshair and
marker, which previously stayed until you hovered somewhere else.
## v1.1.3 — 2026-07-22
Admin dashboard for self-hosters (opt-in — off by default), equipment filtering, and
+26 -2
View File
@@ -7,10 +7,14 @@ to keep it that way — easy to read, easy to self-host.
```
frontend/ React + Vite app (src/views, src/components, src/store, src/lib). Builds to static files.
android/ + ios/ are the Capacitor shells for the standalone mobile app (docs/MOBILE.md).
api/ backend — server.js (Node, no framework), one dependency (@simplewebauthn/server).
web/ multi-stage Dockerfile (builds frontend → nginx) + nginx.conf (serves app, proxies /api).
media/ exercise img/gif (gitignored, fetched at runtime).
docs/ self-hosting guide.
mcp/ optional Model Context Protocol server — read-only stdio bridge for LLM apps
(Claude Desktop, Cursor, …) to query a user's workouts/1RM/muscle balance. Not in
the Docker build; only runs when an LLM client spawns it. See mcp/README.md.
```
## Running for development
@@ -20,25 +24,45 @@ cp .env.example .env
docker compose up -d --build # api + web + media on :8080
# frontend hot reload:
cd frontend && npm install && npm run dev
# training logic (progression rules, 1RM, how a session is read back):
cd frontend && npm test
```
## Guidelines
- **Keep it dependency-light.** The frontend uses React + Router + Zustand and nothing else;
new deps (front or back) are a hard sell. `api/` has exactly one dependency — keep it that way.
new deps (front or back) are a hard sell. `api/` has two (`@simplewebauthn/server` for passkeys,
`web-push` for notifications) — keep it near that.
- **Match the style.** Small components, clear names, comments only where the "why" isn't obvious.
State lives in the Zustand store (`src/store`); pure helpers in `src/lib`.
- **Don't commit** the exercise media (`media/`) or `data/` — they're gitignored.
- **Test the flow** you touched — click through the affected screens (and the workout flow) in a
browser before opening a PR.
- **Training logic gets a unit test.** Anything deciding what you lift next, or reading a logged
session back, belongs in a pure helper in `src/lib` with tests beside it (`npm test`). These
rules are easy to get subtly wrong and nearly impossible to verify by clicking — the
progression engine grew two real bugs that only a test pinned down.
## Good first issues
- Additional starter plans (upper/lower, full-body, 5×5…)
- More languages for the exercise instructions (the dataset ships several)
- Importers from other trackers (Strong, Hevy CSV → openGym JSON)
- Percentage / training-max programming (5/3/1-style) on top of the progression engine in
`src/lib/progression.js` — the policy interface is already there
- Accessibility passes on the workout and chart screens
## Where to ask what
| You have | Goes to |
| --- | --- |
| A question, or self-hosting that won't behave | [Discussions → Q&A](https://github.com/DuarteSantos8/openGym/discussions/categories/q-a) |
| An idea you're not sure about yet | [Discussions → Ideas](https://github.com/DuarteSantos8/openGym/discussions/categories/ideas) |
| A reproducible bug | [Issues](https://github.com/DuarteSantos8/openGym/issues) |
| A change you've already built | A pull request |
An answered question in Q&A is worth more than the same answer buried in a closed issue — the
next person searching "passkey login fails behind my reverse proxy" actually finds it.
## Reporting bugs
Open an issue with: what you did, what you expected, what happened, and your browser/OS. If it's
+41
View File
@@ -3,6 +3,47 @@
openGym — Copyright (C) 2026 Duarte Santos.
openGym's own code is licensed under the **GNU AGPL v3.0** (see [LICENSE](LICENSE)).
## App store exception
As an additional permission under section 7 of the AGPL v3.0, the copyright holder permits
distribution of the openGym mobile application through app store platforms (such as the
Apple App Store and Google Play) whose terms of service would otherwise be incompatible
with the AGPL, provided the corresponding source code remains available under the AGPL at
the project repository. This permission applies to the distribution channel only and does
not otherwise limit the license.
## Body diagram geometry
The muscle outlines the body maps are drawn from (`frontend/src/lib/body-paths.js`) are derived
from [**MuscleMap**](https://github.com/melihcolpan/MuscleMap) by Melih Colpan, used under the
**MIT License** and reproduced below. MuscleMap ships its path data as Swift source rather than
`.svg` files; the paths were converted to a JSON module, its sub-group shapes were dropped, and
nothing else about the artwork was changed.
```
MIT License
Copyright (c) 2026 Melih Colpan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
## Exercise data & media
The exercise names, instructions (English in `frontend/src/lib/exercises-data.js`, other
+81 -8
View File
@@ -37,6 +37,16 @@ No account on someone else's server, no subscription, no ads. Just `docker compo
</table>
</div>
<div align="center">
### [🌐 opengym.duarte-santos.ch](https://opengym.duarte-santos.ch) · [▶ Try the live demo](https://duartesantos8.github.io/openGym/)
No signup, nothing to install — it runs entirely in your browser on example data.<br>
<sub>There's no server behind the demo, so passkey sign-in, sync across devices and the
admin dashboard only exist in a self-hosted instance.</sub>
</div>
## Why
Most workout apps lock your data behind a login on their servers, nag you to upgrade, or
@@ -50,13 +60,29 @@ as a home-screen app, passkey sign-in, offline support, sync across your phone a
- 🏋️ **Weekly plan** — a routine per weekday, over a library of **1,324 exercises** (searchable, with animated demos)
- 🗓️ **Reschedule any day** — sick, missed a session, or fewer gym days this week? Move a workout to another day without touching your weekly plan
- ▶️ **Guided workouts** — it knows what day it is and starts today's session; asks your body weight first, pre-fills your weights from last time, rest timer, PR detection, per-exercise weight tracking
- ☀️ **The screen stays awake while you train** — no unlocking the phone and finding your place again between every set. On for as long as a workout is running, released the moment you finish it, and switchable off in Settings
- 🔗 **Supersets** — build them, and log them back-to-back with a rest only after the pair
- ⏱️ **Timed exercises** — planks, hangs, wall sits and loaded carries are logged by time, not reps, with a work timer that counts the set itself (separate from the rest timer) and logs the time you actually held. They can carry weight too
- 📈 **Progression that follows a rule** — pick one per routine, override it per exercise: linear, **Greyskull LP** (AMRAP top set, double jumps, 10 % resets), double progression through a rep range, or adding time. Your weights are already right when the session opens, and every target says *why* it's that number. Missed reps never advance the load, stalls trigger a deload, and bodyweight exercises progress in reps instead
- 💪 **Estimated 1RM** — per exercise, from your best eligible set (it names which one), with its own progress curve and a calculator for sets you haven't done. Won't guess above 12 reps
- 🎯 **Effort per set, in your scale** — an optional third column rating how hard a set was, as **RIR** (reps left in the tank) or **RPE** (the same judgement on a 10-point scale). Off by default; each set keeps the scale it was logged with, and nothing else reads the value — your progression and 1RM are unaffected
- 💪 **Bodyweight exercises, logged as bodyweight** — push-ups, pull-ups, dips and 300-odd others arrive knowing they carry no load, so there's no weight column and no working-weight prompt: one stepper, log the reps. Add a dip belt and it reads as an addition, and progression goes back to following the weight. Without one, reps climb — and past a ceiling you set, a set is added instead of a rep, up to the point where the honest advice is load or a harder variation
- ↔️ **Reps per side** — for lunges, single-arm rows and the rest. You log the total, the app shows the split ("8 per side"), and the target steps in twos so it never lands on a number one side can't have
- 🏃 **Cardio** — log time + speed, not just weight × reps
- 📤 **Share a plan** — send someone your routines and week schedule as a small file (no workouts, no weigh-ins), or print it as a clean PDF. Importing merges, so their plan is never overwritten
- 🔧 **Filter by equipment** — narrow the library to what you actually own; the options adapt to what you've picked, so every combination on screen has results behind it
- ✨ **Your own exercises** — a name and a body part is enough; they behave like built-in ones everywhere, with an optional description instead of an animation
- 🟩 **Activity heatmap** — a GitHub-style year view, shaded by time spent training
- 💪 **Muscle map** — a front-and-back body diagram shaded by how much work each muscle got, over a week, a month or all time. It names the muscles you *haven't* trained in that period, previews what a routine hits while you build it, and shows what you just trained when you finish. Male or female figure, your pick
- 🔔 **Push notifications** — rest-timer alerts even with the app closed, plus an optional reminder on days you have a workout planned but haven't logged one. Opt in per profile; keys are generated on first run, nothing to configure
- 🔑 **Passkeys, not passwords** — Face ID / Touch ID / fingerprint login; each profile keeps its own data, synced across devices
- 🎨 **Themes** — light/dark + 8 accent colors, saved to your profile
- 🛠️ **Admin dashboard** (optional) — for whoever runs the instance: who's training right now, per-user history, disable accounts, and invite-only signup. Off by default, so a fresh instance stays open with no admin
- 🎨 **Designed, not assembled** — light/dark themes and 8 accent colors saved to your profile, over a hand-drawn icon set instead of emoji, so it looks the same on every phone
- 🌍 **12 languages** — full UI translation (EN, DE, ES, FR, IT, PT, PL, TR, RU, ZH, KO, HI); exercise instructions localized in 10 of them, loaded on demand so the app stays fast
- 📥 **Bring your history with you** — import from **FitNotes** (Android and iOS), **Strong** and **Hevy**, or body weight straight out of an **Apple Health** export. Exercise names are matched against the library and anything unrecognised becomes one of your own exercises, so nothing in the file is dropped
- 📦 **Yours to keep** — one-tap JSON export/import, guest mode, **no telemetry**
- 🤖 **Ask an AI about your training** (optional) — an [MCP server](mcp/README.md) lets a client like Claude Desktop or Cursor read your history in your own words: *"what did I bench last week?"*. Read-only, spawned locally by the client, nothing leaves your box. Not in the Docker build — if you don't use an AI assistant, it isn't there
- 📱 **Standalone Android app** — the whole tracker as a sideloadable APK: no account, no server, data on the phone, native workout reminders ([download](https://opengym.duarte-santos.ch))
## Quick start (self-host)
@@ -78,6 +104,19 @@ a build step locally either way.
> Want it reachable from your phone over the internet with passkeys? You'll need an HTTPS
> domain — a two-line change in `.env`. See **[docs/SELF_HOSTING.md](docs/SELF_HOSTING.md)**.
## Mobile app (no server at all)
The same codebase also builds a **standalone mobile app** (Capacitor): no account, no sync,
no backend — everything stays on the phone, with native workout-day reminders and share-sheet
backups. Self-hosting gets you multi-device sync and profiles for friends & family; the
mobile app is the install-and-done flavor.
- **Android:** [**download the APK**](https://opengym.duarte-santos.ch) and sideload it —
openGym is deliberately not on the Play Store. Or build it yourself: **[docs/MOBILE.md](docs/MOBILE.md)**.
- **iPhone:** Apple doesn't allow installing apps outside the App Store, so there is no iOS
download. Self-host and add it to your home screen from Safari (it's a full PWA), or build
the native app onto your own device from Xcode — see **[docs/MOBILE.md](docs/MOBILE.md)**.
## How it works
```
@@ -108,19 +147,28 @@ server — they stay in your phone's secure hardware / your password manager.
All via `.env` (see `.env.example`):
| Variable | What it is | Default |
|------------|-----------------------------------|-------------------------|
| `RP_ID` | Hostname passkeys are bound to | `localhost` |
| `ORIGIN` | Full URL the app is served from | `http://localhost:8080` |
| `WEB_PORT` | Host port for the web UI | `8080` |
| `RP_NAME` | Name shown in the passkey prompt | `openGym` |
| Variable | What it is | Default |
|---------------|------------------------------------------------------|-------------------------|
| `RP_ID` | Hostname passkeys are bound to | `localhost` |
| `ORIGIN` | Full URL the app is served from | `http://localhost:8080` |
| `WEB_PORT` | Host port for the web UI | `8080` |
| `RP_NAME` | Name shown in the passkey prompt | `openGym` |
| `ADMIN_UIDS` | User ids that get the admin dashboard (comma-separated) | *(none)* |
| `INVITE_ONLY` | Require an invite code to create a profile | *(off)* |
Push notification keys are generated on first run and saved to `./data/vapid.json` — nothing to set.
## Roadmap
Rough, community-driven — ideas and PRs welcome:
- [x] Standalone mobile app — Android APK to sideload ([download](https://opengym.duarte-santos.ch)); on iOS as a self-hosted PWA (no store listings planned)
- [x] Automatic progression programs (linear, Greyskull LP, double progression) with stalls and deloads
- [x] Estimated 1RM per exercise
- [ ] Percentage / training-max programming (5/3/1-style) on top of the progression engine
- [ ] More starter plans (upper/lower, full-body, 5×5)
- [ ] Importers from Strong / Hevy (CSV → openGym JSON)
- [x] Importers from FitNotes / Strong / Hevy (including the RPE they record), and body weight from Apple Health
- [x] Effort per set — RIR or RPE, whichever scale you think in
- [ ] Body measurements (waist, arms…) alongside weight
- [ ] Per-exercise notes & plate calculator
- [ ] Exercise instructions in German & Portuguese (UI is translated; upstream dataset doesn't ship these yet)
@@ -132,11 +180,36 @@ WebAuthn · exercise data from [hasaneyldrm/exercises-dataset](https://github.co
No database server, no cloud dependencies — the frontend builds inside Docker, so self-hosting
stays a one-command `docker compose up`.
The training logic — progression rules, 1RM estimation, how a logged session is read back —
lives in pure functions under `frontend/src/lib/` with tests next to them: `npm test` in
`frontend/`. Vitest is a dev dependency; the app itself ships no runtime dependencies beyond
React, the router and Zustand.
The same pure helpers power an optional MCP server (`mcp/`) that lets an LLM client like
Claude Desktop read your data over stdio — see [mcp/README.md](mcp/README.md). Opt-in, not
in the Docker build.
## Community
- **[Q&A](https://github.com/DuarteSantos8/openGym/discussions/categories/q-a)** — self-hosting
help, passkey/login trouble, "how do I…". Most login problems turn out to be an `RP_ID`/`ORIGIN`
mismatch.
- **[Ideas](https://github.com/DuarteSantos8/openGym/discussions/categories/ideas)** — features
worth talking through before anyone writes code.
- **[Show and tell](https://github.com/DuarteSantos8/openGym/discussions/categories/show-and-tell)**
— your setup, your plan templates, whatever you built on top.
- **[Issues](https://github.com/DuarteSantos8/openGym/issues)** — bugs, and work that's already
been agreed on.
## Contributing
Issues and PRs welcome — see [CONTRIBUTING.md](CONTRIBUTING.md). Good first issues: more starter
plans, exercise-data languages, import from other trackers. **A ⭐ helps more people find it.**
openGym is free and stays free: AGPL, no subscription, no paid tier, nothing held back for
sponsors. If it replaced a paid tracker for you and you want to chip in, the Sponsor button at the
top of the page is there — a star, a bug report or a PR is worth just as much.
## License
[GNU AGPL v3.0](LICENSE) — free and open source. You can self-host, use, modify and share it;
+149
View File
@@ -0,0 +1,149 @@
# Security policy
openGym is a self-hosted app: you run the server, you hold the data. This file says which
versions get fixes, how to report something privately, and — the part most people actually
need — what the app protects you from and what it doesn't.
## Supported versions
Only the **latest release**. Releases are semver tags (`v1.0.0` → `v1.2.3`, see
[CHANGELOG.md](CHANGELOG.md)); there is no LTS or maintenance branch and older tags are never
patched. A fix ships in the next release and in the `latest` images on ghcr.io.
Updating a self-hosted instance:
```bash
git pull && docker compose pull && docker compose up -d
```
## Reporting a vulnerability
Use GitHub's private vulnerability reporting — repo **Security** tab → **Report a vulnerability**:
<https://github.com/DuarteSantos8/openGym/security/advisories/new>
> Private reporting has to be switched on in the repository settings for that link to work
> (Settings → Advanced Security → Private vulnerability reporting). If it 404s, open a normal
> issue saying only *"I need a private channel for a security report"* — no details, no repro —
> and it will be enabled.
Please don't put a working exploit in a public issue if it can be used against other people's
instances. Everything else (a crash you can only trigger on your own box, a scanner warning)
is fine as a normal issue.
Useful in a report: the version or commit, whether you're running the prebuilt images or a
source build, your `RP_ID`/`ORIGIN` and what sits in front of the app, steps to reproduce, and
what an attacker gets out of it.
**On response times:** this is a hobby project maintained by one person alongside school. There
is no SLA and no bounty. Expect days rather than hours, and longer during exam periods. If a
week goes by with no reply, comment on the advisory thread — it's more likely to be a missed
notification than a decision. If a report goes unfixed and you want to disclose publicly, say so
in the thread; there's no objection, and no request to sit on it indefinitely.
## In scope
- **`api/server.js`** — forging or replaying a session cookie, bypassing passkey verification,
reading or writing another user's data through `/api/data`, reaching `/api/admin/*` without
being an admin, or creating a profile without a valid code while `INVITE_ONLY=1`.
- **Frontend** — XSS in the React app, or anything that lets a page on another origin read or
change a signed-in user's data.
- **Shipped deployment config** — `docker-compose.yml`, `web/nginx.conf`, the two Dockerfiles:
a default that exposes something a self-hoster wouldn't expect to be exposed.
- **The published images** `ghcr.io/duartesantos8/opengym-api` and `-web`.
## Out of scope
- Anything that already assumes access to the host, to `./data`, or to the Docker socket. The
operator is trusted by design — see the security model below.
- Admins reading their users' workout history. That is the documented purpose of the admin
dashboard, not a leak.
- **Missing rate limiting**, brute force, or "I sent 100k requests and it got slow". The app
has no rate limiting at all and doesn't pretend to; that belongs in the reverse proxy you put
in front of it. Genuine amplification (one small request causing unbounded work) *is* in scope.
- **Missing security headers** (CSP, HSTS, X-Frame-Options) — `web/nginx.conf` sets none; TLS
and headers are the reverse proxy's job. A concrete attack that headers would have stopped is
still worth reporting.
- Instances served over plain `http://` on a LAN IP. Unsupported: passkeys don't work there and
the session cookie isn't marked `Secure`.
- Scanner output with no working exploit, and `npm audit` findings in build-time
devDependencies (Vite, Vitest, Capacitor CLI) that never reach a running instance.
- The GitHub Pages demo build — it has no backend at all, everything stays in that browser.
- Third-party content: the exercise image/GIF dataset and the CDN it's fetched from.
## Security model
Read this before hosting openGym for anyone other than yourself.
### What it does
- **Passkeys only.** No passwords, no email addresses, no reset flow. Registration and login are
verified server-side by `@simplewebauthn/server` against `expectedOrigin: ORIGIN` and
`expectedRPID: RP_ID`, and the authenticator's signature counter is stored and updated on every
login (`api/server.js:292-318`, `api/server.js:338-358`).
- **Sessions are a signed cookie.** `gymsid` carries `<uid>:<expiry>:<version>` plus an
HMAC-SHA256 tag over it, compared in constant time (`api/server.js:148-161`). The key is 32
random bytes generated on first run and written to `./data/secret` with mode `0600`
(`api/server.js:34-36`). The cookie is `HttpOnly` and `SameSite=Lax`, and gets `Secure` **only
when `ORIGIN` starts with `https:`** (`api/server.js:29`, `api/server.js:198-201`).
- **Any user can end every session they have.** `POST /api/logout/all` increments that account's
session version, and every authenticated request checks the version in the cookie against the
one on the user record (`api/server.js:167`, `api/server.js:187-188`), so every cookie ever
issued for the account — on every device, including a copy someone walked off with — stops
verifying at once. Passkeys are untouched; signing back in works immediately.
- **Data is isolated per user by the session's uid.** `GET`/`PUT /api/data` only ever touch
`state-<uid>.json` for the caller (`api/server.js:375-392`); no route lets a normal user name
another user.
- **Disabling an account takes effect immediately.** Every authenticated request and every login
is rejected for a disabled user (`api/server.js:184`, `api/server.js:357`).
### What it does not do
- **Nothing in `./data` is encrypted.** It holds `db.json` (users, passkey public keys, push
subscriptions, invite codes), one `state-<uid>.json` per user with their complete workout
history and body-weight log, `secret`, and `vapid.json`. Anyone who can read that folder — you,
whoever holds the backups, whoever gets into the host — can read every user's data, and with
`secret` can mint a valid session cookie for any account. **If you host openGym for other
people, they are trusting you exactly as much as they'd trust any server operator.**
- **Admins can read everything.** A user listed in `ADMIN_UIDS` (or flagged `admin: true` in
`db.json`) gets every user's full history and body weight, can disable accounts, and can create
or revoke invite codes (`api/server.js:460-540`). Off by default — a fresh instance has no admin.
- **Sessions can't be revoked one device at a time.** Revocation is per *account*, not per
session: `POST /api/logout/all` kills all of them at once and there is no device list to pick
from. `POST /api/logout` on its own only clears the cookie in that one browser
(`api/server.js:361`) — a copy taken beforehand keeps working. Sessions last **90 days** by
default, settable with `SESSION_DAYS` (`api/server.js:26`); each cookie carries the lifetime it
was issued with, so changing the setting doesn't reach cookies that are already out. Deleting
`./data/secret` and restarting still works as the instance-wide reset, and disabling an account
still locks out one user completely.
- **CSRF protection is `SameSite=Lax` and nothing else.** There are no CSRF tokens.
- **User verification is preferred, not required.** Both handshakes pass
`requireUserVerification: false` (`api/server.js:297`, `api/server.js:343`), so a passkey
released without a biometric or PIN is still accepted. In practice: unlocked device ≈ account
access.
- **One passkey per profile, and no recovery.** Every successful registration creates a *new*
profile (`api/server.js:309-319`); there is no route to attach a second passkey to an existing
one, and no email or reset path. Lose the passkey and that profile is unreachable — only direct
surgery on `./data` gets it back.
- **Disabling someone isn't a ban.** They can still register a fresh profile with a new passkey
unless `INVITE_ONLY=1` is set.
- **HTTPS is required and the app doesn't provide it.** The API container speaks plain HTTP and
nginx listens on `:80` (`web/nginx.conf`); TLS is your reverse proxy's job. Without it,
browsers won't do passkeys at all (except on `http://localhost`) and the session cookie is sent
in the clear.
- **No rate limiting anywhere.** Nothing throttles logins, registrations or writes, and
`POST /api/register/options` still answers whether an invite code is valid
(`api/server.js:272`), so an invite-only instance on the open internet should have a rate limit
in front of it. New invite codes are 16 hex characters — 64 bits (`api/server.js:525`) — which
makes guessing one impractical even unthrottled; codes generated by earlier versions are 8
characters / 32 bits and still work, so revoke and reissue any that are still unused. The only
hard limit
in the app is a 5 MB request body (`api/server.js:27`).
- **A few endpoints answer without a session:** `/api/health` (which includes the total user
count), `/api/config` (whether invite-only is on), `/api/push/public-key`, and the
register/login handshakes.
- **Changing `RP_ID` invalidates every existing passkey.** They were bound to the old hostname
and will fail verification against the new one. The data stays on disk but is unreachable until
each user registers again — as a *new* profile. Choose your hostname before anyone registers.
- **Guest mode never reaches the backend.** That data lives unencrypted in the browser's
`localStorage` and is gone when the browser storage is cleared.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "gym-api",
"version": "1.1.1",
"version": "1.2.5",
"private": true,
"type": "module",
"main": "server.js",
+41 -10
View File
@@ -19,7 +19,11 @@ const RP_NAME = process.env.RP_NAME || 'openGym';
// code the admin generates. Both default off so a fresh self-hosted instance stays open.
const ADMIN_UIDS = (process.env.ADMIN_UIDS || '').split(',').map(s => s.trim()).filter(Boolean);
const INVITE_ONLY = /^(1|true|yes|on)$/i.test(process.env.INVITE_ONLY || '');
const SESSION_DAYS = 365;
// 90 days keeps someone who trains a few times a week permanently signed in without a stolen
// cookie staying good for a year. Overridable because a family instance and one on the open
// internet don't want the same number. Only affects cookies minted from now on — the expiry is
// baked into each cookie when it's issued, so lowering this never cuts an existing session short.
const SESSION_DAYS = Math.max(1, +(process.env.SESSION_DAYS || 90) || 90);
const MAX_BODY = 5 * 1024 * 1024;
// Secure cookies require HTTPS; over plain http://localhost the flag would drop the cookie
const SECURE = /^https:/i.test(ORIGIN) ? ' Secure;' : '';
@@ -155,9 +159,15 @@ function verifySig(token) {
} catch { return null; }
return payload;
}
function makeSession(uid) {
// Session payload is `<uid>:<expiry>:<version>`, where the version is the user's `sv` counter.
// Bumping `sv` (POST /api/logout/all) makes every cookie ever handed out for that account stop
// verifying, which is the only revocation there was before short of deleting ./data/secret and
// signing out the whole instance. Cookies minted before `sv` existed have no third field and are
// read as version 0, matching a user who has never bumped — they stay valid until they expire.
const sessionVersion = user => user.sv || 0;
function makeSession(user) {
const exp = Date.now() + SESSION_DAYS * 86400000;
return sign(uid + ':' + exp);
return sign(user.id + ':' + exp + ':' + sessionVersion(user));
}
function readSession(req) {
const cookies = Object.fromEntries((req.headers.cookie || '').split(';').map(c => {
@@ -167,10 +177,15 @@ function readSession(req) {
if (!tok) return null;
const payload = verifySig(tok);
if (!payload) return null;
const [uid, exp] = payload.split(':');
const [uid, exp, ver] = payload.split(':');
if (!uid || +exp < Date.now()) return null;
const user = db.users.find(u => u.id === uid) || null;
if (user && user.disabled) return null; // disabled accounts are locked out everywhere
if (!user) return null;
if (user.disabled) return null; // disabled accounts are locked out everywhere
// Missing third field = pre-versioning cookie = version 0. Anything non-numeric is a malformed
// payload (it still had to pass the HMAC, so this is belt-and-braces) and is refused outright.
const claimed = ver === undefined ? 0 : Number(ver);
if (!Number.isInteger(claimed) || claimed !== sessionVersion(user)) return null;
return user;
}
// Guard for /api/admin/* — resolves the caller and 401/403s if they aren't an admin.
@@ -180,8 +195,8 @@ function requireAdmin(req, res) {
if (!isAdmin(user)) { json(res, 403, { error: 'forbidden' }); return null; }
return user;
}
function sessionCookie(uid) {
return `gymsid=${makeSession(uid)}; Path=/; Max-Age=${SESSION_DAYS * 86400}; HttpOnly;${SECURE} SameSite=Lax`;
function sessionCookie(user) {
return `gymsid=${makeSession(user)}; Path=/; Max-Age=${SESSION_DAYS * 86400}; HttpOnly;${SECURE} SameSite=Lax`;
}
const clearCookie = `gymsid=; Path=/; Max-Age=0; HttpOnly;${SECURE} SameSite=Lax`;
@@ -301,7 +316,7 @@ const routes = {
transports: body.credential?.response?.transports || []
});
saveDb();
json(res, 200, { user: { id: user.id, name: user.name, admin: isAdmin(user) } }, { 'Set-Cookie': sessionCookie(user.id) });
json(res, 200, { user: { id: user.id, name: user.name, admin: isAdmin(user) } }, { 'Set-Cookie': sessionCookie(user) });
},
'POST /api/login/options': async (req, res) => {
@@ -340,11 +355,23 @@ const routes = {
const user = db.users.find(u => u.id === cred.userId);
if (!user) return json(res, 500, { error: 'user missing' });
if (user.disabled) return json(res, 403, { error: 'this account has been disabled' });
json(res, 200, { user: { id: user.id, name: user.name, admin: isAdmin(user) } }, { 'Set-Cookie': sessionCookie(user.id) });
json(res, 200, { user: { id: user.id, name: user.name, admin: isAdmin(user) } }, { 'Set-Cookie': sessionCookie(user) });
},
'POST /api/logout': async (req, res) => json(res, 200, { ok: true }, { 'Set-Cookie': clearCookie }),
// "Sign out everywhere" — bumps this user's session version, which invalidates every cookie
// ever issued for the account, on every device, including a copy someone else walked off with.
// The caller's own cookie is cleared here too, so the browser doing it doesn't sit on a token
// it no longer accepts. Passkeys are untouched: signing back in works immediately.
'POST /api/logout/all': async (req, res) => {
const user = readSession(req);
if (!user) return json(res, 401, { error: 'not signed in' });
user.sv = sessionVersion(user) + 1;
saveDb();
json(res, 200, { ok: true }, { 'Set-Cookie': clearCookie });
},
'GET /api/data': async (req, res) => {
const user = readSession(req);
if (!user) return json(res, 401, { error: 'not signed in' });
@@ -491,7 +518,11 @@ const routes = {
const admin = requireAdmin(req, res); if (!admin) return;
const body = await readBody(req);
let code;
do { code = crypto.randomBytes(4).toString('hex').toUpperCase(); } while (db.invites.some(i => i.code === code));
// 16 hex chars = 64 bits, up from 8 chars / 32 bits. The app has no rate limiting by design
// (that's the reverse proxy's job) and /api/register/options tells a caller whether a code is
// good, so the code itself has to be the thing that isn't worth guessing. Codes already in
// db.json keep working — validation is an exact string compare, never a length or format check.
do { code = crypto.randomBytes(8).toString('hex').toUpperCase(); } while (db.invites.some(i => i.code === code));
const invite = { code, note: String(body.note || '').slice(0, 60), createdBy: admin.id, created: new Date().toISOString() };
db.invites.push(invite);
saveDb();
Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

After

Width:  |  Height:  |  Size: 381 KiB

+104
View File
@@ -0,0 +1,104 @@
# Building the mobile app (iOS / Android)
openGym ships in two flavors from the same codebase:
| | **Self-hosted** (this repo's default) | **Mobile app** (`VITE_MOBILE=1`) |
|---|---|---|
| Runs | in any browser, against your own server | natively on iPhone / Android (Capacitor shell) |
| Accounts | passkey sign-in, one profile per person | none — the phone *is* the account |
| Data | synced to your server, readable on desktop | stays on the device (file in the app's private storage) |
| Reminders | Web Push from your server | native local notifications, no server involved |
| Exercise media | served by your server (`img/`, `gif/`) | loaded from the jsDelivr CDN |
The mobile flavor never talks to a backend: no sign-in screen, no sync, no telemetry.
State is mirrored from `localStorage` into `opengym-state.json` in the app's private data
directory on every change (iOS is allowed to evict WebView storage under pressure — the
file mirror is the durable copy and is restored on launch). Backups go out through the
OS share sheet instead of a browser download.
## Prerequisites
- Node 20+
- **Android:** Android Studio (bundles the SDK). Java 21 for Gradle.
- **iOS:** a Mac with Xcode 15+ and CocoaPods (`brew install cocoapods`). A free Apple ID
is enough to run the app on your own iPhone (see below); paid membership is only needed
for App Store distribution, which openGym doesn't do.
## Build & run
```sh
cd frontend
npm install
npm run build:mobile # VITE_MOBILE build + `cap sync` into android/ and ios/
npx cap open android # opens Android Studio → run on emulator or device
npx cap open ios # opens Xcode (Mac only) → set your signing team, then run
```
`npm run build:mobile` bakes the CDN media base into the bundle and copies the web build
into both native projects — re-run it after every web-code change before building natively.
> **Heads-up:** after `build:mobile`, `frontend/dist` contains the *mobile* bundle.
> Run a plain `npm run build` again before deploying `dist` to a server.
## App icons & splash screens
`frontend/resources/icon.svg` is the 1024×1024 source (the app's dumbbell glyph on the
app background). Generate all platform assets from it on a machine with the tooling:
```sh
cd frontend
npx @capacitor/assets generate --iconBackgroundColor '#0c0e12' --splashBackgroundColor '#0c0e12'
```
(If the generator won't take the SVG directly, export it to `resources/icon.png` at
1024×1024 first — any image tool can do it.)
## Distribution — deliberately no app stores
openGym's mobile app is not on the Play Store or App Store, and that's a choice: no store
accounts, no store rules, no yearly fees between you and an open-source app.
### Android — sideload the APK
The official signed APK is at **[opengym.duarte-santos.ch](https://opengym.duarte-santos.ch)**.
Android asks you to allow installs from the browser the first time — that's standard for any
app outside the Play Store.
To build and sign your own:
```sh
cd frontend && npm run build:mobile
cd android && ./gradlew assembleRelease # → app/build/outputs/apk/release/app-release-unsigned.apk
# one-time: create a keystore. KEEP IT — updates must be signed with the same key,
# or Android refuses to install the new version over the old one.
keytool -genkeypair -keystore my.keystore -alias opengym -keyalg RSA -validity 10950
# align + sign (zipalign/apksigner ship with the Android SDK build-tools)
zipalign -f -p 4 app-release-unsigned.apk aligned.apk
apksigner sign --ks my.keystore --ks-key-alias opengym --out openGym.apk aligned.apk
```
### iPhone — what's actually possible
Apple does not allow installing apps outside the App Store, so there is no `.ipa` download
that would simply install. Your free options:
- **Self-host + PWA** (recommended): open your instance in Safari → Share → *Add to Home
Screen*. Full-screen app, no expiry, plus sync and passkeys.
- **Xcode free signing:** open `ios/` in Xcode with a free Apple ID as the team and run it
onto your own iPhone. Apple expires the signature after 7 days; re-run from Xcode to renew.
- **AltStore:** automates that 7-day re-signing over Wi-Fi via a Mac companion app.
### Release notes for maintainers
- Bump `versionName`/`versionCode` in `android/app/build.gradle` per release; keep them in
step with `frontend/package.json`. `versionCode` must strictly increase or updates won't
install over an existing APK.
- **License:** openGym is AGPL-3.0, which by itself sits badly with app-store terms of
service. `NOTICE.md` carries an app-store exception (an additional permission under
AGPL §7) granted by the copyright holder — relevant only if store distribution ever happens.
- The app requests notification permission only when the workout-day reminder is switched
on, and (on Android) declares `SCHEDULE_EXACT_ALARM` so the reminder fires to the minute
where the user allows it.
+24 -3
View File
@@ -87,9 +87,25 @@ Visit `https://gym.example.com`, create your profile, and add it to your home sc
## 4. Multiple users
Anyone who can reach the URL can create their own profile — each gets isolated data. There's no
admin/invite system by design; if you want it private, keep it behind your VPN, an auth proxy
(Authelia, Cloudflare Access…), or just don't share the URL.
Anyone who can reach the URL can create their own profile — each gets isolated data. That's the
default: open signup, no admin.
If you'd rather control who gets in, two optional settings in `.env` turn that around:
```bash
ADMIN_UIDS=youruserid # comma-separated; these users get the admin dashboard
INVITE_ONLY=1 # new profiles need an invite code
```
Register your own passkey profile first, then find your id in `./data/db.json` under `users[].id`
and put it in `ADMIN_UIDS`. You'll get an **Admin dashboard** link in Settings: who's training
right now, each user's workout history and body weight, the ability to disable an account (signed
out and locked out everywhere until you re-enable it), and — with `INVITE_ONLY=1` — generating and
revoking invite codes. Existing accounts keep working when you switch invite-only on. Admin access
is gated by your passkey and enforced server-side, so it needs no separate login.
Prefer to keep the whole thing off the open internet? A VPN or an auth proxy (Authelia, Cloudflare
Access…) in front still works, and composes with the above.
## 5. Backups
@@ -114,6 +130,11 @@ first run and saved to `./data/vapid.json`, and each user's browser reports its
automatically when they turn the reminder on — it fires at their local time, and follows them if
they travel, regardless of what timezone the server itself runs in.
**Keep screen awake** (Settings → *During a workout*) has the same transport requirement: the
Wake Lock API is only available over HTTPS or on `http://localhost`, so on a plain-LAN-IP
instance the switch shows as unsupported. Nothing to configure server-side either way, and iOS
refuses the lock while the phone is in Low Power Mode.
## 7. Updating
Running prebuilt images:
+101
View File
@@ -0,0 +1,101 @@
# Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
# Built application files
*.apk
*.aar
*.ap_
*.aab
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml
# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/
# Google Services (e.g. APIs or Firebase)
# google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md
# Version control
vcs.xml
# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
# Android Profiling
*.hprof
# Cordova plugins for Capacitor
capacitor-cordova-android-plugins
# Copied web assets
app/src/main/assets/public
# Generated Config files
app/src/main/assets/capacitor.config.json
app/src/main/assets/capacitor.plugins.json
app/src/main/res/xml/config.xml
+2
View File
@@ -0,0 +1,2 @@
/build/*
!/build/.npmkeep
+54
View File
@@ -0,0 +1,54 @@
apply plugin: 'com.android.application'
android {
namespace "ch.duartesantos.opengym"
compileSdk rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "ch.duartesantos.opengym"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 6
versionName "1.2.5"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
implementation project(':capacitor-android')
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation project(':capacitor-cordova-android-plugins')
}
apply from: 'capacitor.build.gradle'
try {
def servicesJSON = file('google-services.json')
if (servicesJSON.text) {
apply plugin: 'com.google.gms.google-services'
}
} catch(Exception e) {
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}
@@ -0,0 +1,21 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
}
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
implementation project(':capacitor-filesystem')
implementation project(':capacitor-local-notifications')
implementation project(':capacitor-share')
}
if (hasProperty('postBuildExtras')) {
postBuildExtras()
}
+21
View File
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
@@ -0,0 +1,26 @@
package com.getcapacitor.myapp;
import static org.junit.Assert.*;
import android.content.Context;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.getcapacitor.app", appContext.getPackageName());
}
}
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8" ?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode|navigation"
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:theme="@style/AppTheme.NoActionBarLaunch"
android:launchMode="singleTask"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
</provider>
</application>
<!-- Permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Workout-day reminder: lets the local-notifications plugin fire at the exact minute
on Android 12+. Where it isn't granted, scheduling silently falls back to inexact
alarms — the reminder still arrives, just not to the minute. -->
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
</manifest>
@@ -0,0 +1,5 @@
package ch.duartesantos.opengym;
import com.getcapacitor.BridgeActivity;
public class MainActivity extends BridgeActivity {}
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

@@ -0,0 +1,34 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>
@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillColor="#26A69A"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
</vector>
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<WebView
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background>
<inset android:drawable="@mipmap/ic_launcher_background" android:inset="16.7%" />
</background>
<foreground>
<inset android:drawable="@mipmap/ic_launcher_foreground" android:inset="16.7%" />
</foreground>
</adaptive-icon>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background>
<inset android:drawable="@mipmap/ic_launcher_background" android:inset="16.7%" />
</background>
<foreground>
<inset android:drawable="@mipmap/ic_launcher_foreground" android:inset="16.7%" />
</foreground>
</adaptive-icon>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 913 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="app_name">openGym</string>
<string name="title_activity_main">openGym</string>
<string name="package_name">ch.duartesantos.opengym</string>
<string name="custom_url_scheme">ch.duartesantos.opengym</string>
</resources>
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:background">@null</item>
</style>
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
<item name="android:background">@drawable/splash</item>
</style>
</resources>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="my_images" path="." />
<cache-path name="my_cache_images" path="." />
</paths>
@@ -0,0 +1,18 @@
package com.getcapacitor.myapp;
import static org.junit.Assert.*;
import org.junit.Test;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
+29
View File
@@ -0,0 +1,29 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.7.2'
classpath 'com.google.gms:google-services:4.4.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply from: "variables.gradle"
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
@@ -0,0 +1,12 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
include ':capacitor-filesystem'
project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android')
include ':capacitor-local-notifications'
project(':capacitor-local-notifications').projectDir = new File('../node_modules/@capacitor/local-notifications/android')
include ':capacitor-share'
project(':capacitor-share').projectDir = new File('../node_modules/@capacitor/share/android')
+22
View File
@@ -0,0 +1,22 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
Binary file not shown.
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored Executable
+252
View File
@@ -0,0 +1,252 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
+94
View File
@@ -0,0 +1,94 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
+5
View File
@@ -0,0 +1,5 @@
include ':app'
include ':capacitor-cordova-android-plugins'
project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/')
apply from: 'capacitor.settings.gradle'
+16
View File
@@ -0,0 +1,16 @@
ext {
minSdkVersion = 23
compileSdkVersion = 35
targetSdkVersion = 35
androidxActivityVersion = '1.9.2'
androidxAppCompatVersion = '1.7.0'
androidxCoordinatorLayoutVersion = '1.2.0'
androidxCoreVersion = '1.15.0'
androidxFragmentVersion = '1.8.4'
coreSplashScreenVersion = '1.0.1'
androidxWebkitVersion = '1.12.1'
junitVersion = '4.13.2'
androidxJunitVersion = '1.2.1'
androidxEspressoCoreVersion = '3.6.1'
cordovaAndroidVersion = '10.1.1'
}
+9
View File
@@ -0,0 +1,9 @@
{
"appId": "ch.duartesantos.opengym",
"appName": "openGym",
"webDir": "dist",
"backgroundColor": "#0c0e12",
"android": {
"allowMixedContent": false
}
}
+13
View File
@@ -0,0 +1,13 @@
App/build
App/Pods
App/output
App/App/public
DerivedData
xcuserdata
# Cordova plugins for Capacitor
capacitor-cordova-ios-plugins
# Generated Config files
App/App/capacitor.config.json
App/App/config.xml
Loaded 100 of 202 files, more files were not shown because too many files have changed in this diff. Show more