Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
Gym check-in: Settings switch to turn the feature off
Duarte Santos0af9f5552816
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsxindex ae2c41cc7..bf5ed483a 100644--- a/frontend/src/App.jsx+++ b/frontend/src/App.jsx@@ -116,9 +116,9 @@ function Shell() {<Routes><Route path="/home" element={<Home />} />{/* Gym check-in is mobile-only — it needs the native scanner and showing a QR to- a turnstile makes no sense in a browser tab. Off mobile the route falls through- to the catch-all redirect below. */}- {MOBILE && <Route path="/checkin" element={<CheckIn />} />}+ a turnstile makes no sense in a browser tab. Off mobile (or switched off in+ Settings) the route falls through to the catch-all redirect below. */}+ {MOBILE && S.checkIn !== false && <Route path="/checkin" element={<CheckIn />} />}<Route path="/plan" element={<Plan />} /><Route path="/plan/r/:id" element={<RoutineEdit />} /><Route path="/workout" element={<Workout />} />diff --git a/frontend/src/lib/pt-br-locale.test.js b/frontend/src/lib/pt-br-locale.test.jsindex a263acddd..03b4549f4 100644--- a/frontend/src/lib/pt-br-locale.test.js+++ b/frontend/src/lib/pt-br-locale.test.js@@ -27,7 +27,7 @@ describe('Brazilian Portuguese locale', () => {.sort(byCodeUnit)const fingerprint = createHash('sha256').update(JSON.stringify(inherited)).digest('hex')- expect(Object.keys(PT_BR_OVERRIDES)).toHaveLength(598)+ expect(Object.keys(PT_BR_OVERRIDES)).toHaveLength(600)expect(inherited).toHaveLength(565)// If this fails, review the changed keys and wording before accepting a new hash. From// frontend/: node scripts/pt-br-inheritance-fingerprint.mjs --listdiff --git a/frontend/src/locales/de.js b/frontend/src/locales/de.jsindex b8b9335cd..be72df2d9 100644--- a/frontend/src/locales/de.js+++ b/frontend/src/locales/de.js@@ -1124,4 +1124,6 @@ export default {'Camera permission is needed to scan. Enable it in Settings.': 'Zum Scannen wird die Kamera-Berechtigung benötigt. Aktiviere sie in den Einstellungen.','Scanning is not available on this device.': 'Scannen ist auf diesem Gerät nicht verfügbar.','Could not start the scanner': 'Scanner konnte nicht gestartet werden',+ 'Gym check-in': 'Gym-Check-in',+ 'Show a card on Home with your membership QR codes.': 'Zeigt auf Start eine Karte mit deinen Mitglieds-QR-Codes.',}diff --git a/frontend/src/locales/es.js b/frontend/src/locales/es.jsindex 7c429bbbc..f0e4d654d 100644--- a/frontend/src/locales/es.js+++ b/frontend/src/locales/es.js@@ -1105,4 +1105,6 @@ export default {'Camera permission is needed to scan. Enable it in Settings.': 'Se necesita permiso de cámara para escanear. Actívalo en Ajustes.','Scanning is not available on this device.': 'El escaneo no está disponible en este dispositivo.','Could not start the scanner': 'No se pudo iniciar el escáner',+ 'Gym check-in': 'Check-in del gimnasio',+ 'Show a card on Home with your membership QR codes.': 'Muestra en Inicio una tarjeta con tus códigos QR de socio.',}diff --git a/frontend/src/locales/fr.js b/frontend/src/locales/fr.jsindex 3ab6a7d88..a499e852c 100644--- a/frontend/src/locales/fr.js+++ b/frontend/src/locales/fr.js@@ -1105,4 +1105,6 @@ export default {'Camera permission is needed to scan. Enable it in Settings.': 'L’autorisation caméra est nécessaire pour scanner. Active-la dans les Réglages.','Scanning is not available on this device.': 'Le scan n’est pas disponible sur cet appareil.','Could not start the scanner': 'Impossible de démarrer le scanner',+ 'Gym check-in': 'Enregistrement à la salle',+ 'Show a card on Home with your membership QR codes.': 'Affiche sur l’Accueil une carte avec vos codes QR d’abonné.',}diff --git a/frontend/src/locales/hi.js b/frontend/src/locales/hi.jsindex 49a7d1675..ab24120ce 100644--- a/frontend/src/locales/hi.js+++ b/frontend/src/locales/hi.js@@ -1105,4 +1105,6 @@ export default {'Camera permission is needed to scan. Enable it in Settings.': 'स्कैन करने के लिए कैमरा अनुमति चाहिए। इसे सेटिंग्स में चालू करें।','Scanning is not available on this device.': 'इस डिवाइस पर स्कैनिंग उपलब्ध नहीं है।','Could not start the scanner': 'स्कैनर शुरू नहीं हो सका',+ 'Gym check-in': 'जिम चेक-इन',+ 'Show a card on Home with your membership QR codes.': 'होम पर आपके सदस्यता QR कोड वाला कार्ड दिखाता है।',}diff --git a/frontend/src/locales/hu.js b/frontend/src/locales/hu.jsindex 0479a0487..649ca2987 100644--- a/frontend/src/locales/hu.js+++ b/frontend/src/locales/hu.js@@ -1108,4 +1108,6 @@ export default {'What should change?': 'Mi változzon?','Coach is thinking…': 'Az Edző gondolkodik…','Message the Coach…': 'Üzenet az Edzőnek…',+ 'Gym check-in': 'Bejelentkezés a teremben',+ 'Show a card on Home with your membership QR codes.': 'A Kezdőlapon egy kártyát mutat a tagsági QR-kódjaiddal.',}diff --git a/frontend/src/locales/it.js b/frontend/src/locales/it.jsindex be3c8cb72..c58bf9bd6 100644--- a/frontend/src/locales/it.js+++ b/frontend/src/locales/it.js@@ -1105,4 +1105,6 @@ export default {'Camera permission is needed to scan. Enable it in Settings.': 'Per scansionare serve l’autorizzazione alla fotocamera. Attivala nelle Impostazioni.','Scanning is not available on this device.': 'La scansione non è disponibile su questo dispositivo.','Could not start the scanner': 'Impossibile avviare lo scanner',+ 'Gym check-in': 'Check-in in palestra',+ 'Show a card on Home with your membership QR codes.': 'Mostra nella Home una scheda con i tuoi codici QR di iscrizione.',}diff --git a/frontend/src/locales/ko.js b/frontend/src/locales/ko.jsindex 6814e369f..881ecf62b 100644--- a/frontend/src/locales/ko.js+++ b/frontend/src/locales/ko.js@@ -1105,4 +1105,6 @@ export default {'Camera permission is needed to scan. Enable it in Settings.': '스캔하려면 카메라 권한이 필요합니다. 설정에서 켜세요.','Scanning is not available on this device.': '이 기기에서는 스캔을 사용할 수 없습니다.','Could not start the scanner': '스캐너를 시작할 수 없습니다',+ 'Gym check-in': '헬스장 체크인',+ 'Show a card on Home with your membership QR codes.': '홈 화면에 회원 QR 코드 카드를 표시합니다.',}diff --git a/frontend/src/locales/pl.js b/frontend/src/locales/pl.jsindex 31db24d10..017f900d8 100644--- a/frontend/src/locales/pl.js+++ b/frontend/src/locales/pl.js@@ -1105,4 +1105,6 @@ export default {'Camera permission is needed to scan. Enable it in Settings.': 'Do skanowania potrzebne jest pozwolenie na aparat. Włącz je w Ustawieniach.','Scanning is not available on this device.': 'Skanowanie nie jest dostępne na tym urządzeniu.','Could not start the scanner': 'Nie udało się uruchomić skanera',+ 'Gym check-in': 'Zameldowanie na siłowni',+ 'Show a card on Home with your membership QR codes.': 'Pokazuje na Starcie kartę z Twoimi kodami QR członkowskimi.',}diff --git a/frontend/src/locales/pt-BR.js b/frontend/src/locales/pt-BR.jsindex 42be41a41..c7d366db9 100644--- a/frontend/src/locales/pt-BR.js+++ b/frontend/src/locales/pt-BR.js@@ -621,7 +621,9 @@ export const PT_BR_OVERRIDES = {'Could not read that image': 'Não foi possível ler essa imagem','Camera permission is needed to scan. Enable it in Settings.': 'É necessária a permissão da câmera para escanear. Ative-a nos Ajustes.','Scanning is not available on this device.': 'O escaneamento não está disponível neste dispositivo.',- 'Could not start the scanner': 'Não foi possível iniciar o scanner'+ 'Could not start the scanner': 'Não foi possível iniciar o scanner',+ 'Gym check-in': 'Check-in na academia',+ 'Show a card on Home with your membership QR codes.': 'Mostra no Início um cartão com seus códigos QR de sócio.',}export default { ...pt, ...PT_BR_OVERRIDES }diff --git a/frontend/src/locales/pt.js b/frontend/src/locales/pt.jsindex 7ca5c1c14..aafc1ea90 100644--- a/frontend/src/locales/pt.js+++ b/frontend/src/locales/pt.js@@ -1105,4 +1105,6 @@ export default {'Camera permission is needed to scan. Enable it in Settings.': 'É necessária a permissão da câmara para digitalizar. Ativa-a nas Definições.','Scanning is not available on this device.': 'A digitalização não está disponível neste dispositivo.','Could not start the scanner': 'Não foi possível iniciar o scanner',+ 'Gym check-in': 'Check-in no ginásio',+ 'Show a card on Home with your membership QR codes.': 'Mostra no Início um cartão com os teus códigos QR de sócio.',}diff --git a/frontend/src/locales/ru.js b/frontend/src/locales/ru.jsindex c7e11d73d..1f19344b5 100644--- a/frontend/src/locales/ru.js+++ b/frontend/src/locales/ru.js@@ -1105,4 +1105,6 @@ export default {'Camera permission is needed to scan. Enable it in Settings.': 'Для сканирования нужен доступ к камере. Включите его в настройках.','Scanning is not available on this device.': 'Сканирование недоступно на этом устройстве.','Could not start the scanner': 'Не удалось запустить сканер',+ 'Gym check-in': 'Отметка в зале',+ 'Show a card on Home with your membership QR codes.': 'Показывает на Главной карточку с вашими QR-кодами абонемента.',}diff --git a/frontend/src/locales/th.js b/frontend/src/locales/th.jsindex 2a6ba6776..83a57ca05 100644--- a/frontend/src/locales/th.js+++ b/frontend/src/locales/th.js@@ -1116,4 +1116,6 @@ export default {'What should change?': 'ควรเปลี่ยนอะไร','Coach is thinking…': 'โค้ชกำลังคิด…','Message the Coach…': 'ส่งข้อความถึงโค้ช…',+ 'Gym check-in': 'เช็คอินที่ยิม',+ 'Show a card on Home with your membership QR codes.': 'แสดงการ์ดพร้อม QR โค้ดสมาชิกของคุณบนหน้าหลัก',}diff --git a/frontend/src/locales/tr.js b/frontend/src/locales/tr.jsindex 36c107c89..92a7b16f4 100644--- a/frontend/src/locales/tr.js+++ b/frontend/src/locales/tr.js@@ -1105,4 +1105,6 @@ export default {'Camera permission is needed to scan. Enable it in Settings.': 'Taramak için kamera izni gerekir. Ayarlar’dan etkinleştir.','Scanning is not available on this device.': 'Tarama bu cihazda kullanılamıyor.','Could not start the scanner': 'Tarayıcı başlatılamadı',+ 'Gym check-in': 'Salon girişi',+ 'Show a card on Home with your membership QR codes.': 'Ana sayfada üyelik QR kodlarınızı içeren bir kart gösterir.',}diff --git a/frontend/src/locales/zh.js b/frontend/src/locales/zh.jsindex 931b1542f..a4f786826 100644--- a/frontend/src/locales/zh.js+++ b/frontend/src/locales/zh.js@@ -1105,4 +1105,6 @@ export default {'Camera permission is needed to scan. Enable it in Settings.': '扫描需要相机权限。请在设置中开启。','Scanning is not available on this device.': '此设备不支持扫描。','Could not start the scanner': '无法启动扫描器',+ 'Gym check-in': '健身房签到',+ 'Show a card on Home with your membership QR codes.': '在首页显示一张包含会员二维码的卡片。',}diff --git a/frontend/src/store/useStore.gymcards.test.jsx b/frontend/src/store/useStore.gymcards.test.jsxindex 8f0fe5240..d3fcab994 100644--- a/frontend/src/store/useStore.gymcards.test.jsx+++ b/frontend/src/store/useStore.gymcards.test.jsx@@ -67,3 +67,21 @@ describe('gymCards state', () => {expect(useStore.getState().S.gymCards.map(c => c.id)).toEqual(['1', '2', '3'])})})++// The Settings switch. On by default; an older profile that predates the key must read as on+// too, and off only hides the feature — the cards themselves survive the round trip.+describe('checkIn switch', () => {+ it('is on for a fresh profile', () => {+ expect(useStore.getState().S.checkIn).toBe(true)+ })++ it('turning it off keeps the saved cards', () => {+ useStore.getState().update(s => {+ s.gymCards.push({ id: 'c1', label: 'FitZone', value: 'ABC123', fmt: 'qrcode' })+ s.checkIn = false+ }, false)+ const S = useStore.getState().S+ expect(S.checkIn).toBe(false)+ expect(S.gymCards).toHaveLength(1)+ })+})diff --git a/frontend/src/store/useStore.js b/frontend/src/store/useStore.jsindex 802e8f28b..09abeecfc 100644--- a/frontend/src/store/useStore.js+++ b/frontend/src/store/useStore.js@@ -42,6 +42,10 @@ export const DEF = {// kind of code the gym issued. Just data, so it syncs and backs up like everything else.// [{ id, label, value, fmt }]gymCards: [],+ // Whether the check-in feature is on at all (Settings toggle, mobile-only). Off hides the Home+ // card and the /checkin route; the saved gymCards stay so turning it back on restores them.+ // Defaults on; an older profile without the key reads as on (`!== false`).+ checkIn: true,}const clone = o => JSON.parse(JSON.stringify(o))diff --git a/frontend/src/views/Home.jsx b/frontend/src/views/Home.jsxindex c597218f2..0cf46b4c8 100644--- a/frontend/src/views/Home.jsx+++ b/frontend/src/views/Home.jsx@@ -96,8 +96,9 @@ export default function Home() {</div>{/* Mobile-only: jump to the gym check-in cards (QR membership codes). Shown here as a quick- tap on arrival at the gym; the whole feature folds away in web/demo builds via MOBILE. */}- {MOBILE && (+ tap on arrival at the gym; the whole feature folds away in web/demo builds via MOBILE,+ and per user via the "Gym check-in" switch in Settings. */}+ {MOBILE && S.checkIn !== false && (<div className="card tappable" style={{ cursor: 'pointer' }} {...tappable(() => nav('/checkin'))}><div className="row between"><div className="row" style={{ gap: 9 }}>diff --git a/frontend/src/views/Settings.jsx b/frontend/src/views/Settings.jsxindex 5b94d067d..7d12f2db5 100644--- a/frontend/src/views/Settings.jsx+++ b/frontend/src/views/Settings.jsx@@ -140,6 +140,12 @@ export default function Settings() {options={[{ value: MONDAY, label: t('Monday') }, { value: SUNDAY, label: t('Sunday') }]}value={weekStartOf(S)} onChange={v => update(s => { s.weekStart = v })} /></Row>+ {/* Membership QR codes on Home (views/CheckIn.jsx). Only the app can scan and show them+ at a turnstile, so the switch exists only there; off = no Home card, no route. */}+ {MOBILE && <Row icon="qr" iconTint="var(--blue)" title={t('Gym check-in')}+ subtitle={t('Show a card on Home with your membership QR codes.')}>+ <Switch checked={S.checkIn !== false} onChange={v => update(s => { s.checkIn = v })} />+ </Row>}</Section>{/* ---------- during a workout ---------- */}