In-app training assistant (PWA)
To the encrypted notes app we added a full-featured training assistant โ as a second tab next to your notes. You log your weight and see its trend, load a block training plan, and in "guide my workout" mode the app walks you through set by set: it counts down rest breaks, records the real duration of every set and pause, and compares what you did against the plan. All the analytics โ tonnage per muscle group, plan-vs-actual completion โ are computed from data you already have. The key architectural trick: all training data lives in the same E2E-encrypted store as your notes, so encryption, sync, offline and conflict detection come for free โ without adding a single line to the backend.
How it works โ step by step
Weight and trend
You log your weight (kg plus optional parameters) and the app draws a trend chart over time.
Block plan
You load a plan with block periodization (3โ4 week blocks with a deload) and double progression.
Start the session
"Start workout" picks today's session from the plan; you finish the warm-up manually.
Set by set
The app shows the prescribed sets; after each one you enter the real weight and reps (RPE optional).
Rest timers
Auto rest countdown with sound and vibration on your phone; the real time is logged separately.
Controls mid-session
Skip a set or exercise, a "technical break" counted separately, and "finish early".
Summary
Duration, total rest, sets and tonnage per muscle group, plus completion against the plan.
What you get
Training data is E2E too
Weight, plan and history are encrypted end-to-end by the same mechanism as your notes.
Zero backend changes
The whole history sits in one encrypted blob (a reserved "note") โ less code, less risk.
Real times, not assumed
We record the actual duration of sets, breaks and pauses โ analysis rests on what happened, not what was meant to.
Fully offline
The session lives in memory with a checkpoint after every set โ losing signal does not wipe your workout.
Measurable progression
Double progression anchored to RPE with block periodization โ growth instead of randomness.
Privacy-preserving analysis
You export a plaintext file by a deliberate action; the key and passphrase never leave your devices.
Details
One encrypted store for everything
Weight, plan and your entire training history sit in a single E2E-encrypted file โ technically a "reserved note". As a result, without touching the backend we inherit AES-256-GCM encryption, conflict detection, offline mode and sync. The backend stays "dumb" and untouched, while all the new logic lives in the client โ which minimizes the attack surface.
The "guide my workout" mode as a state machine
Start โ warm-up (finished manually) โ exercise โ set (real time) โ correction of the actual values โ timed rest โ next set. Mid-session: skip a set, skip an exercise, a technical break counted separately, and an irreversible "finish early". Every time โ set, rest, pause โ is logged independently, so the real course of the session can be verified later, not just the assumptions.
Plan-vs-actual analysis, privately
For each set we keep the prescribed and actual values side by side โ the essence of the analysis. The summary computes tonnage per muscle group and completion against the plan. The plan-improvement loop is manual and E2E-compliant: you export a plaintext file (JSON plus a readable MD) by a deliberate action, get a proposal for changes, and after approval import the new plan. The key and passphrase never leave your devices.
For the curious โ how it works under the hood. The whole training feature is ES modules in the client (no build step), and the data is a single versioned JSON object encrypted by the same pipeline as your notes. The PHP backend is not touched at all.
Data model
One JSON object versioned by a schema field: settings, weight measurements (kg plus loose optional parameters), the plan (blocks, days, exercises with muscle groups and RPE) and the training history. Each set stores prescribed vs actual plus independent timestamps for the start/end of the set, the rest and technical pauses โ a full, verifiable session trace.
Offline and session resilience
An active workout keeps a checkpoint in localStorage after every set, so closing the window or losing signal does not wipe your progress. At the end the session is appended to the history (append-only), and on a conflict we merge by session id (union), not by a blind overwrite โ saves made offline are queued and retried like the notes autosave.
Mobile-first UX
During a set the interface is minimal: a big clock and one main button, with risky actions (skip, finish) tucked away so you cannot tap them by accident. The rest timer fills the whole screen, with sound and vibration at the end of the break, 16 px inputs with no iOS auto-zoom, and safe-area support for the notch.