From 5de5147c5e28f18a78d3af3a4135e5da13ebe205 Mon Sep 17 00:00:00 2001
From: Duarte Santos <231837+duartesantos@noreply.gitea.com>
Date: Wed, 19 Aug 2026 06:29:49 +0000
Subject: [PATCH 01/95] funding buymeacoffee
---
.github/FUNDING.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index 83b05ed..26a1a4f 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -2,3 +2,4 @@
# 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
+buy_me_a_coffee: duartesantos
\ No newline at end of file
From e69673d3cd77e5f4e6477e1f6d95d29e6d1d1620 Mon Sep 17 00:00:00 2001
From: Duarte Santos <231837+duartesantos@noreply.gitea.com>
Date: Wed, 19 Aug 2026 06:42:52 +0000
Subject: [PATCH 02/95] funding buymeacoffee
---
README.md | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/README.md b/README.md
index b4d8d22..fd12e3e 100644
--- a/README.md
+++ b/README.md
@@ -221,6 +221,12 @@ openGym is free and stays free: AGPL, no subscription, no paid tier, nothing hel
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;
From 19a441d93e0b27518c72fdf2dc4de37441b940c2 Mon Sep 17 00:00:00 2001
From: Duarte Santos
Date: Wed, 19 Aug 2026 16:29:57 +0200
Subject: [PATCH 03/95] Android-Back: @capacitor/app verdrahtet, Zurueck-Geste
beendet die App nicht mehr
Capacitor 7 behandelt Zurueck gar nicht selbst, das macht @capacitor/app -- das
Plugin fehlte, also lief jede Zurueck-Geste an der WebView vorbei direkt in
finish(). Die History-Eintraege pro Sheet (#63) haben nur im Browser gewirkt.
Neu: lib/back.js entscheidet Sheet -> Seite -> zweimal Zurueck zum Beenden
(exitApp, weil das Plugin mit registriertem Listener nie mehr selbst beendet),
gesperrte Sheets schlucken Zurueck weiterhin. Version auf 1.2.8/versionCode 9.
---
CHANGELOG.md | 12 +++
frontend/android/app/build.gradle | 4 +-
frontend/android/app/capacitor.build.gradle | 1 +
frontend/android/capacitor.settings.gradle | 3 +
frontend/ios/App/Podfile | 1 +
frontend/package-lock.json | 13 ++-
frontend/package.json | 3 +-
frontend/src/App.jsx | 7 ++
frontend/src/lib/back.js | 62 ++++++++++++
frontend/src/lib/back.test.js | 103 ++++++++++++++++++++
frontend/src/locales/de.js | 1 +
frontend/src/locales/es.js | 1 +
frontend/src/locales/fr.js | 1 +
frontend/src/locales/hi.js | 1 +
frontend/src/locales/it.js | 1 +
frontend/src/locales/ko.js | 1 +
frontend/src/locales/pl.js | 1 +
frontend/src/locales/pt.js | 1 +
frontend/src/locales/ru.js | 1 +
frontend/src/locales/tr.js | 1 +
frontend/src/locales/zh.js | 1 +
21 files changed, 215 insertions(+), 5 deletions(-)
create mode 100644 frontend/src/lib/back.js
create mode 100644 frontend/src/lib/back.test.js
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b1417a9..7e4cc47 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,17 @@
# Changelog
+## Unreleased
+
+### Fixes
+
+- ⬅️ **The back gesture no longer quits the app** (Android). The packaged app never listened for
+ the system back event at all — Capacitor leaves that to `@capacitor/app`, which was not
+ installed — so a back swipe went straight past the WebView and finished the activity from
+ wherever you were. The per-sheet history entries added in [#63] only ever did anything in a
+ browser tab. Back now dismisses the open sheet, then walks back through the screens you came
+ from, and only leaves the app after a second press at the root ("Press back again to exit").
+ A sheet that is locked mid-task still swallows back, as it does in the browser.
+
## v1.2.7 — 2026-08-18
The muscle map answers a third question. Balance showed where the volume went and Fatigue what was
diff --git a/frontend/android/app/build.gradle b/frontend/android/app/build.gradle
index 3e7e59c..d21d7a0 100644
--- a/frontend/android/app/build.gradle
+++ b/frontend/android/app/build.gradle
@@ -7,8 +7,8 @@ android {
applicationId "ch.duartesantos.opengym"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 8
- versionName "1.2.7"
+ versionCode 9
+ versionName "1.2.8"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
diff --git a/frontend/android/app/capacitor.build.gradle b/frontend/android/app/capacitor.build.gradle
index 9081f94..af1bea9 100644
--- a/frontend/android/app/capacitor.build.gradle
+++ b/frontend/android/app/capacitor.build.gradle
@@ -9,6 +9,7 @@ android {
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
dependencies {
+ implementation project(':capacitor-app')
implementation project(':capacitor-filesystem')
implementation project(':capacitor-local-notifications')
implementation project(':capacitor-share')
diff --git a/frontend/android/capacitor.settings.gradle b/frontend/android/capacitor.settings.gradle
index 874805f..d757f12 100644
--- a/frontend/android/capacitor.settings.gradle
+++ b/frontend/android/capacitor.settings.gradle
@@ -2,6 +2,9 @@
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
+include ':capacitor-app'
+project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')
+
include ':capacitor-filesystem'
project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android')
diff --git a/frontend/ios/App/Podfile b/frontend/ios/App/Podfile
index 8ce7ece..4faddd0 100644
--- a/frontend/ios/App/Podfile
+++ b/frontend/ios/App/Podfile
@@ -11,6 +11,7 @@ install! 'cocoapods', :disable_input_output_paths => true
def capacitor_pods
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
+ pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
pod 'CapacitorLocalNotifications', :path => '../../node_modules/@capacitor/local-notifications'
pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share'
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index c693161..803c0f4 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -1,14 +1,15 @@
{
"name": "opengym-frontend",
- "version": "1.2.6",
+ "version": "1.2.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "opengym-frontend",
- "version": "1.2.6",
+ "version": "1.2.7",
"license": "AGPL-3.0-or-later",
"dependencies": {
+ "@capacitor/app": "^7.1.2",
"@capacitor/core": "^7.6.8",
"@capacitor/filesystem": "^7.1.8",
"@capacitor/local-notifications": "^7.0.7",
@@ -62,6 +63,14 @@
"@capacitor/core": "^7.6.0"
}
},
+ "node_modules/@capacitor/app": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/@capacitor/app/-/app-7.1.2.tgz",
+ "integrity": "sha512-d4I/oF/PRu4megL7/IGKYfe5j7yzSON1FRFgq6kH+m5kH6g7V+wyjHRLauCzGNjdRx4S+nWOumINds0qcRBtKg==",
+ "peerDependencies": {
+ "@capacitor/core": ">=7.0.0"
+ }
+ },
"node_modules/@capacitor/assets": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/@capacitor/assets/-/assets-3.0.5.tgz",
diff --git a/frontend/package.json b/frontend/package.json
index 836339b..978d10a 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -1,7 +1,7 @@
{
"name": "opengym-frontend",
"private": true,
- "version": "1.2.7",
+ "version": "1.2.8",
"type": "module",
"scripts": {
"dev": "vite",
@@ -14,6 +14,7 @@
},
"license": "AGPL-3.0-or-later",
"dependencies": {
+ "@capacitor/app": "^7.1.2",
"@capacitor/core": "^7.6.8",
"@capacitor/filesystem": "^7.1.8",
"@capacitor/local-notifications": "^7.0.7",
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index e7c8c52..b413db0 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -6,6 +6,7 @@ import { bindUI } from './components/ui.jsx'
import { ACCENTS } from './lib/format.js'
import { setLang, useLang } from './lib/i18n.js'
import { setNav } from './lib/nav.js'
+import { initBackButton } from './lib/back.js'
import { useWakeLock } from './lib/wakelock.js'
import { startFlow } from './sheets.jsx'
import Icon from './components/Icon.jsx'
@@ -92,5 +93,11 @@ function Shell() {
export default function App() {
const boot = useStore(s => s.boot)
useEffect(() => { boot() }, [boot])
+ // Android system back — sheet, then page, then press-again-to-exit (see lib/back.js)
+ useEffect(() => {
+ let stop = null, gone = false
+ initBackButton().then(fn => { if (gone) fn(); else stop = fn })
+ return () => { gone = true; stop?.() }
+ }, [])
return
}
diff --git a/frontend/src/lib/back.js b/frontend/src/lib/back.js
new file mode 100644
index 0000000..6bacd86
--- /dev/null
+++ b/frontend/src/lib/back.js
@@ -0,0 +1,62 @@
+// Android system back (the gesture and the hardware/nav button are the same event).
+//
+// Capacitor's BridgeActivity does not handle back at all — without a JS listener the
+// activity simply finishes, so a back swipe quit the app from anywhere, whatever the
+// WebView history said. That made the sheet history entries from #63 dead weight in the
+// packaged app: they only ever worked in a browser tab, where the browser walks history
+// itself.
+//
+// Once a `backButton` listener exists, the plugin stops falling through to finish() —
+// back can then ONLY leave the app through App.exitApp(), which is why the last step is
+// an explicit press-again-to-exit rather than a silent no-op.
+import { MOBILE } from './mobile.js'
+import { useUI } from '../store/useUI.js'
+import { t } from './i18n.js'
+
+// How long a first back press stays armed as "press again to exit" (the toast shows 2.2s).
+export const EXIT_WINDOW = 2000
+
+// What a back press means, given what is on screen. Pure, so the table below is testable.
+export function decideBack({ top, canGoBack, exitArmed }) {
+ if (top) return top.locked ? 'ignore' : 'sheet' // a locked sheet swallows back on purpose
+ if (canGoBack) return 'history' // a page/tab we pushed ourselves
+ return exitArmed ? 'exit' : 'arm-exit'
+}
+
+export function makeBackHandler({ getSheets, closeSheet, toast, goBack, exit, now = Date.now }) {
+ let armedAt = -Infinity
+ return (ev = {}) => {
+ const sheets = getSheets()
+ const action = decideBack({
+ top: sheets[sheets.length - 1],
+ canGoBack: !!ev.canGoBack,
+ exitArmed: now() - armedAt < EXIT_WINDOW,
+ })
+ if (action !== 'arm-exit') armedAt = -Infinity
+ if (action === 'sheet') closeSheet(sheets[sheets.length - 1].id)
+ else if (action === 'history') goBack()
+ else if (action === 'arm-exit') { armedAt = now(); toast(t('Press back again to exit')) }
+ else if (action === 'exit') exit()
+ return action
+ }
+}
+
+// Registers the listener for the native shell. No-op in web builds, where the browser
+// (or the PWA shell) walks history on its own and there is no plugin to talk to.
+export async function initBackButton() {
+ if (!MOBILE) return () => {}
+ try {
+ const { App } = await import('@capacitor/app')
+ const handler = makeBackHandler({
+ getSheets: () => useUI.getState().sheets,
+ closeSheet: id => useUI.getState().closeSheet(id),
+ toast: msg => useUI.getState().toast(msg),
+ goBack: () => window.history.back(),
+ exit: () => App.exitApp(),
+ })
+ const sub = await App.addListener('backButton', handler)
+ return () => sub.remove()
+ } catch (e) {
+ return () => {} // no plugin (older install): leave back to the default behaviour
+ }
+}
diff --git a/frontend/src/lib/back.test.js b/frontend/src/lib/back.test.js
new file mode 100644
index 0000000..f020358
--- /dev/null
+++ b/frontend/src/lib/back.test.js
@@ -0,0 +1,103 @@
+// @vitest-environment happy-dom
+import { describe, expect, it } from 'vitest'
+import { decideBack, makeBackHandler, EXIT_WINDOW } from './back.js'
+
+// Back on Android has to serve three layers with one event: the sheet stack on top, the
+// page history under it, and — because a registered listener stops the plugin from ever
+// finishing the activity itself — a deliberate way out of the app at the bottom.
+describe('decideBack', () => {
+ it('dismisses the top sheet before touching history', () => {
+ expect(decideBack({ top: { id: 's1' }, canGoBack: true, exitArmed: false })).toBe('sheet')
+ })
+
+ it('lets a locked sheet swallow the press', () => {
+ expect(decideBack({ top: { id: 's1', locked: true }, canGoBack: true, exitArmed: true })).toBe('ignore')
+ })
+
+ it('walks history when nothing is open', () => {
+ expect(decideBack({ top: undefined, canGoBack: true, exitArmed: false })).toBe('history')
+ })
+
+ it('arms the exit at the bottom of the stack, and exits on the second press', () => {
+ expect(decideBack({ top: undefined, canGoBack: false, exitArmed: false })).toBe('arm-exit')
+ expect(decideBack({ top: undefined, canGoBack: false, exitArmed: true })).toBe('exit')
+ })
+})
+
+function harness() {
+ const calls = { closed: [], toasts: [], back: 0, exit: 0 }
+ let sheets = []
+ let now = 1000
+ const handler = makeBackHandler({
+ getSheets: () => sheets,
+ closeSheet: id => { calls.closed.push(id); sheets = sheets.filter(s => s.id !== id) },
+ toast: m => calls.toasts.push(m),
+ goBack: () => { calls.back++ },
+ exit: () => { calls.exit++ },
+ now: () => now,
+ })
+ return { calls, handler, setSheets: s => { sheets = s }, tick: ms => { now += ms } }
+}
+
+describe('makeBackHandler', () => {
+ it('closes stacked sheets one press at a time', () => {
+ const h = harness()
+ h.setSheets([{ id: 'a' }, { id: 'b' }])
+ expect(h.handler({ canGoBack: true })).toBe('sheet')
+ expect(h.handler({ canGoBack: true })).toBe('sheet')
+ expect(h.calls.closed).toEqual(['b', 'a'])
+ expect(h.calls.back).toBe(0)
+ })
+
+ it('does not close a locked sheet, and does not arm the exit behind it', () => {
+ const h = harness()
+ h.setSheets([{ id: 'a', locked: true }])
+ expect(h.handler({ canGoBack: false })).toBe('ignore')
+ expect(h.calls.closed).toEqual([])
+ expect(h.calls.toasts).toEqual([])
+ expect(h.calls.exit).toBe(0)
+ })
+
+ it('goes back a page while the WebView still has app history', () => {
+ const h = harness()
+ expect(h.handler({ canGoBack: true })).toBe('history')
+ expect(h.calls.back).toBe(1)
+ expect(h.calls.exit).toBe(0)
+ })
+
+ // The whole point of the fix: one press at the root must never be the end of the app.
+ it('warns once, then exits on a second press inside the window', () => {
+ const h = harness()
+ expect(h.handler({ canGoBack: false })).toBe('arm-exit')
+ expect(h.calls.toasts).toHaveLength(1)
+ expect(h.calls.exit).toBe(0)
+ h.tick(EXIT_WINDOW - 1)
+ expect(h.handler({ canGoBack: false })).toBe('exit')
+ expect(h.calls.exit).toBe(1)
+ })
+
+ it('re-arms rather than exiting once the window has passed', () => {
+ const h = harness()
+ h.handler({ canGoBack: false })
+ h.tick(EXIT_WINDOW + 1)
+ expect(h.handler({ canGoBack: false })).toBe('arm-exit')
+ expect(h.calls.exit).toBe(0)
+ expect(h.calls.toasts).toHaveLength(2)
+ })
+
+ // A sheet opened (or a page pushed) after the warning means the user is still using the
+ // app — the next back belongs to that sheet, and the one after must warn again.
+ it('disarms the exit as soon as another press does real work', () => {
+ const h = harness()
+ h.handler({ canGoBack: false })
+ h.setSheets([{ id: 'a' }])
+ expect(h.handler({ canGoBack: true })).toBe('sheet')
+ expect(h.handler({ canGoBack: false })).toBe('arm-exit')
+ expect(h.calls.exit).toBe(0)
+ })
+
+ it('treats a missing event payload as no history', () => {
+ const h = harness()
+ expect(h.handler()).toBe('arm-exit')
+ })
+})
diff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.js
index e4cfd67..b726cb1 100644
--- a/frontend/src/locales/de.js
+++ b/frontend/src/locales/de.js
@@ -3,6 +3,7 @@ export default {
// --- generic ---
'Confirm': 'Bestätigen',
'Cancel': 'Abbrechen',
+ 'Press back again to exit': 'Zum Beenden erneut zurück drücken',
'Delete': 'Löschen',
'Save': 'Speichern',
'Import': 'Importieren',
diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.js
index 5523adc..99b88cc 100644
--- a/frontend/src/locales/es.js
+++ b/frontend/src/locales/es.js
@@ -2,6 +2,7 @@
export default {
'Confirm': 'Confirmar',
'Cancel': 'Cancelar',
+ 'Press back again to exit': 'Pulsa atrás otra vez para salir',
'Delete': 'Eliminar',
'Save': 'Guardar',
'Import': 'Importar',
diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.js
index 84891d2..1324543 100644
--- a/frontend/src/locales/fr.js
+++ b/frontend/src/locales/fr.js
@@ -2,6 +2,7 @@
export default {
'Confirm': 'Confirmer',
'Cancel': 'Annuler',
+ 'Press back again to exit': 'Appuyez de nouveau pour quitter',
'Delete': 'Supprimer',
'Save': 'Enregistrer',
'Import': 'Importer',
diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.js
index 7073e22..119d3e9 100644
--- a/frontend/src/locales/hi.js
+++ b/frontend/src/locales/hi.js
@@ -2,6 +2,7 @@
export default {
'Confirm': 'पुष्टि करें',
'Cancel': 'रद्द करें',
+ 'Press back again to exit': 'बाहर निकलने के लिए फिर से बैक दबाएँ',
'Delete': 'हटाएँ',
'Save': 'सहेजें',
'Import': 'आयात करें',
diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.js
index b1cee0c..2aeed2e 100644
--- a/frontend/src/locales/it.js
+++ b/frontend/src/locales/it.js
@@ -2,6 +2,7 @@
export default {
'Confirm': 'Conferma',
'Cancel': 'Annulla',
+ 'Press back again to exit': 'Premi di nuovo indietro per uscire',
'Delete': 'Elimina',
'Save': 'Salva',
'Import': 'Importa',
diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.js
index 78f4cb7..7a3ff84 100644
--- a/frontend/src/locales/ko.js
+++ b/frontend/src/locales/ko.js
@@ -2,6 +2,7 @@
export default {
'Confirm': '확인',
'Cancel': '취소',
+ 'Press back again to exit': '뒤로를 한 번 더 누르면 종료됩니다',
'Delete': '삭제',
'Save': '저장',
'Import': '가져오기',
diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.js
index cbacd99..27634f7 100644
--- a/frontend/src/locales/pl.js
+++ b/frontend/src/locales/pl.js
@@ -2,6 +2,7 @@
export default {
'Confirm': 'Potwierdź',
'Cancel': 'Anuluj',
+ 'Press back again to exit': 'Naciśnij wstecz ponownie, aby wyjść',
'Delete': 'Usuń',
'Save': 'Zapisz',
'Import': 'Importuj',
diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.js
index 7c30289..c46e111 100644
--- a/frontend/src/locales/pt.js
+++ b/frontend/src/locales/pt.js
@@ -2,6 +2,7 @@
export default {
'Confirm': 'Confirmar',
'Cancel': 'Cancelar',
+ 'Press back again to exit': 'Prima novamente para sair',
'Delete': 'Eliminar',
'Save': 'Guardar',
'Import': 'Importar',
diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.js
index c8a871b..720dacd 100644
--- a/frontend/src/locales/ru.js
+++ b/frontend/src/locales/ru.js
@@ -2,6 +2,7 @@
export default {
'Confirm': 'Подтвердить',
'Cancel': 'Отмена',
+ 'Press back again to exit': 'Нажмите «Назад» ещё раз, чтобы выйти',
'Delete': 'Удалить',
'Save': 'Сохранить',
'Import': 'Импорт',
diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.js
index 6fc2dff..9539877 100644
--- a/frontend/src/locales/tr.js
+++ b/frontend/src/locales/tr.js
@@ -2,6 +2,7 @@
export default {
'Confirm': 'Onayla',
'Cancel': 'İptal',
+ 'Press back again to exit': 'Çıkmak için geri tuşuna tekrar basın',
'Delete': 'Sil',
'Save': 'Kaydet',
'Import': 'İçe aktar',
diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.js
index 028e380..3ec38c3 100644
--- a/frontend/src/locales/zh.js
+++ b/frontend/src/locales/zh.js
@@ -2,6 +2,7 @@
export default {
'Confirm': '确认',
'Cancel': '取消',
+ 'Press back again to exit': '再按一次返回退出',
'Delete': '删除',
'Save': '保存',
'Import': '导入',
From 4b25a8035672c680c61be7d20e0426003b8e6a10 Mon Sep 17 00:00:00 2001
From: Duarte Santos
Date: Thu, 20 Aug 2026 15:44:59 +0200
Subject: [PATCH 04/95] Analytics: Umami auf der Website, im Frontend nur wenn
beim Build gesetzt
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
website/: fester Umami-Tag fuer opengym.duarte-santos.ch (Landing/About/Docs).
frontend/: vite-Plugin injiziert den Tag NUR wenn VITE_UMAMI_SRC und VITE_UMAMI_ID
beim Build gesetzt sind — ein normales 'npm run build' und damit jede
selbstgehostete Instanz bleibt telemetriefrei.
(Die Download-Zeile auf v1.2.7 lag schon uncommitted im Baum und faehrt mit.)
---
frontend/vite.config.js | 20 +++++++++++++++++++-
website/about.html | 2 ++
website/docs.html | 2 ++
website/index.html | 4 +++-
4 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/frontend/vite.config.js b/frontend/vite.config.js
index e57eaa4..0aa29c5 100644
--- a/frontend/vite.config.js
+++ b/frontend/vite.config.js
@@ -4,8 +4,26 @@ import react from '@vitejs/plugin-react'
const backend = process.env.API_TARGET || 'http://127.0.0.1:3000'
const media = process.env.MEDIA_TARGET || 'http://127.0.0.1:8888'
+// Optional web analytics (Umami). Injected only when BOTH vars are set at build time,
+// so a plain `npm run build` — and every self-hosted install — stays telemetry-free.
+// Set for the public instance: VITE_UMAMI_SRC=https://stats.example/script.js VITE_UMAMI_ID=
+const umamiSrc = process.env.VITE_UMAMI_SRC
+const umamiId = process.env.VITE_UMAMI_ID
+
+const umami = {
+ name: 'opengym-umami',
+ transformIndexHtml() {
+ if (!umamiSrc || !umamiId) return
+ return [{
+ tag: 'script',
+ attrs: { defer: true, src: umamiSrc, 'data-website-id': umamiId },
+ injectTo: 'head'
+ }]
+ }
+}
+
export default defineConfig({
- plugins: [react()],
+ plugins: [react(), umami],
base: './',
server: {
proxy: {
diff --git a/website/about.html b/website/about.html
index 63f4b31..7519027 100644
--- a/website/about.html
+++ b/website/about.html
@@ -10,6 +10,8 @@
+
+
diff --git a/website/docs.html b/website/docs.html
index 4cadfdd..acebdfa 100644
--- a/website/docs.html
+++ b/website/docs.html
@@ -10,6 +10,8 @@
+
+
diff --git a/website/index.html b/website/index.html
index affb3da..08c4273 100644
--- a/website/index.html
+++ b/website/index.html
@@ -15,6 +15,8 @@
+
+
@@ -26,11 +26,31 @@
DemoDocsAbout
- GitHub
+ Gitea
+ DiscordDownload
+
+
+
⚠️ Important notice
+
My GitHub account has been suspended — the openGym repo is gone with it
+
github.com/DuarteSantos8/openGym is offline. The repository, the releases and the
+ GitHub-Pages demo are all unreachable — not by choice. openGym itself is unaffected:
+ the app, the APK on this page and every self-hosted install keep working exactly as before.
+
Until I get the account back, the code lives here — and the Discord is where I will announce
+ the moment it is resolved:
My GitHub account has been suspended — the openGym repo is gone with it
+
github.com/DuarteSantos8/openGym is offline. The repository, the releases and the
+ GitHub-Pages demo are all unreachable — not by choice. openGym itself is unaffected:
+ the app, the APK on this page and every self-hosted install keep working exactly as before.
+
Until I get the account back, the code lives here — and the Discord is where I will announce
+ the moment it is resolved:
Build it onto your own iPhone: with a Mac and Xcode, the native app runs on
your device with a free Apple ID (Apple expires the signature after 7 days; re-run
from Xcode to renew). See
- docs/MOBILE.md.
-
Just looking? The live demo
- runs in any browser with example data.
Just looking? The in-browser demo was hosted on GitHub Pages and is offline
+ while my GitHub account is suspended — the Android app above needs no account either.
Self-host with Docker
The self-hosted flavor adds passkey profiles, sync across devices, and (optionally) an
admin dashboard. You need Docker
with Compose:
git clone https://gitea.com/DuarteSantos/openGym
cd openGym
cp .env.example .env
docker compose pull # prebuilt images (amd64 + arm64) — skip to build from source
@@ -91,7 +111,7 @@ docker compose up -d
Want it reachable from your phone with passkeys? You'll need an HTTPS
domain — a two-line change in .env. The full guide, including reverse-proxy
examples and the invite-only/admin options, is in
- docs/SELF_HOSTING.md.
All of these live in .env; the defaults are what you get if you touch nothing.
@@ -113,7 +133,7 @@ docker compose up -d
It runs on your machine, is spawned by the client, and reads your exported data directly.
Nothing is sent anywhere, and it is not part of the Docker build — if you don't use
an AI assistant, it simply isn't there. Setup is a few lines of client config:
- mcp/README.md.
Coming from another tracker? Settings → Data → Import from another app reads:
@@ -143,7 +163,7 @@ docker compose up -d
inside the container — no local Node needed.
Android APK / iOS app: the Capacitor projects live in frontend/android
and frontend/ios — build, signing and distribution notes are in
- docs/MOBILE.md.