A static training log for strength workouts, runs, and plans tied to a goal. The starter program is ski-season prep for 15 December 2026: a 10-week home plan (6 October–13 December) with five training days. The same week repeats, and phases change the runs and the last week’s sets. The log starts empty. Workout presets are included; past sample sessions are not.
The app runs entirely in the browser. There is no server and no database. The log is a JSON file in this repo, public/data/training.json, which is the same general approach as the Cardmarket wishlist tracker: a client-side Vite app, data you can commit, and GitHub Pages for hosting.
npm install
npm run devOpen http://127.0.0.1:43217
Use the dev server (or npm run preview after a build). Opening index.html as a file will not load the JSON log.
| Script | What it does |
|---|---|
npm run dev |
Local site on port 43217 |
npm run build |
Typecheck and production build into dist/ |
npm run preview |
Serve the production build |
npm run lint |
Lint with oxlint |
npm run sample-data |
Rewrite the starter log: goal, plan, presets, and no sessions |
Today is the phone screen for the plan. It opens on a short card for the selected day: what was planned, what was logged, and whether that is done. That card stays open. Sets, watch metrics, form links, and the rest of the session open from View session, Start, Continue, or Log. The week and its controls stay put above that card, so choosing another day does not move them. Previous and next are arrows above the week and each move one week. Today sits between them and opens the current week with today selected. Tapping a day opens that day under the week. While another day is open, today stays one tap away at the top of the page. A day shows what was planned, marked not done until a log fulfills it, and what was done that day, including a session that was never on the plan. A planned session that was logged reads as done once, not as a second card. A session can move to another day for one week. The card sits on the new day, and its label says which weekday it left, such as “Moved from Wed”. A log linked to that plan session still marks the moved card done. Strength uses Start, a run uses Log, an unfinished entry uses Continue, and a finished one uses View session. Runs are logged after the fact. Sets, the goal, presets, and recent sessions stay folded until you open them.
Activity is its own tab. Weeks stack from top to bottom, and the week that contains today is the top row. Older weeks sit under it. There are no weeks after the current one. Each day is empty, planned and not done, partly done, or done. A day with only an unplanned log still counts. Tapping a day opens that day on Today.
Workouts are reusable presets. The starter set is Lower A, an easy run, full upper, Lower B, and a longer run. Each strength exercise plays a short form clip in the app. Starting a strength preset fills the log. Logging a run preset does too, after the run. If that workout is still open on this week’s plan, the entry counts toward it, including the phase for that date.
Log takes a strength workout or a run. A strength session shows one exercise at a time: pick one dumbbell, one kettlebell, or two dumbbells, then tap the weight and the reps. The large number is kilograms per piece. The line under it is the total. Log each set, then move to the next exercise. Form still plays that exercise’s clip on this page, and the week controls stay put when Form is opened from Today. Save sits on the review after the last exercise. Strength targets are sets and reps (or seconds for a hold such as a side plank). Kilograms are optional and are not the weekly target. A run counts as soon as you save it. Runs are logged after the fact: distance, workout time, pace, heart rate, active and total calories, elevation, cadence, power, effort, place, source, start and finish, weather, and per-kilometre splits (time, pace, heart rate) are all optional. A strength session can also store workout time, heart rate, calories, and effort when a watch recorded them.
Plans is where goals and the repeating week live. A goal has a name, a target date, and focus tags. A plan has a start date, a length in weeks, and sessions on chosen days. Phases are inclusive date windows that replace a session’s notes, duration, or set count. The home ski plan uses them for the run phases and the 2-set taper. “Start with the home ski plan” fills that week. Editing a strength session sets sets and reps, not a weight. A run counts when it is logged; the phase says how long it should be.
Progress leads with this week: sets completed against the target, and runs done. After you have logged load or distance, the charts still show one lift at a time (top set as total kilograms, and an estimated 1RM) and weekly running distance plus pace. Estimated 1RM uses the Epley formula on that total: weight × (1 + reps / 30). A set that knows its pieces also reads as kilograms per piece.
Data syncs the log to a private GitHub gist so the phone and laptop share one copy. See below.
The starter goal is Ski season prep, aimed at 15 December 2026. The week is Lower A, an easy run, full upper, Lower B, and a longer run, from 6 October through 13 December 2026. There are no historical sessions.
- The site loads
data/training.json, built frompublic/data/training.json. That file is the starter program: the goal, the plan, and the presets. - Edits are cached in
localStorage, so logging works offline and survives a refresh. - A private GitHub gist is the copy shared across devices. The gist id and token live only in that browser.
The gist token is never written into training.json or committed to this repository.
On the Data tab, connect the same gist on each device:
- Create a classic personal access token with only the
gistscope. A fine-grained token does not have that scope. - Create a secret gist. Name the file
training-tracker.json. The contents can be{}. - Copy the gist id from the URL (
gist.github.com/<you>/<id>) and paste the id and token into the Data tab.
The app loads the gist when it opens, merges it with the cache, and saves back a couple of seconds after you change something. Sync now does the same immediately. Disconnecting stops the sync and leaves the cache on that device.
Sessions, goals, plans, and presets merge by id. The later edit wins. A delete is recorded, so removing a session on the phone removes it on the laptop at the next sync. Each save reads the gist once more and merges before writing, so a save does not replace a session the other device just added.
Fields the app does not use are kept through that load and save. An open copy of an older build therefore cannot wipe a newer plan field. Each deploy writes version.json with that build’s id. A tab or home-screen app still running an older build compares it, with the network cache bypassed, when the page loads, when it regains focus, and before a gist write. A newer id reloads the page. An open strength session or the log form finishes first; the reload waits until you leave that screen. If a reload still leaves the old build running, that copy stops writing to the gist.
This follows the same idea as the Cardmarket wishlist tracker: the browser calls the GitHub API directly, and the gist is the shared JSON file. Here you paste the gist id yourself so both devices are aimed at the one gist.
On the Data tab, download training.json, replace the file in the repo, and commit:
cp ~/Downloads/training.json public/data/training.json
git add public/data/training.json
git commit -m "Update training log"
git pushThe Pages workflow rebuilds the site from that commit. That publishes the starter program. Day-to-day sessions belong in the gist, not in this commit, unless you want them in the repository too.
You can also paste a fine-grained GitHub personal access token on the Data tab and commit the file from the app. Give the token Contents: Read and write on this repository only. It stays in the browser’s localStorage.
Import accepts a JSON file or pasted JSON. “Reload the site file” drops browser-only edits and reads the committed file again.
.github/workflows/deploy.yml builds the app and deploys dist/ on every push to main.
One-time setup on the GitHub repository:
- Settings → Pages → Build and deployment → Source: GitHub Actions.
- Push to
main.
The site will be at https://<user>.github.io/<repo>/. Vite’s base is relative (./), so a project site works without hardcoding the repository name.
For a repo named training-tracker under capdefra, that URL is:
https://capdefra.github.io/training-tracker/
Start, Log, or Continue on a strength day opens a fullscreen session. It uses the plan for that day, including a moved day, and saves through the same log as the rest of the app. An unfinished session stays in this browser until you save or exit. #/prototype/session opens Today.
A hold or a carry is an exercise with count set to "seconds". Timer, on that seconds card, opens a modal. The hold starts from the seconds already on the stepper (the first number of a range such as 20-30, or the phase target when one is set) and can be changed before Start. Rest has presets and its own adjuster, including off. Start runs a 4 second get-ready, the hold, then that rest. The set is logged when the hold reaches zero. Close or Cancel before that logs nothing. Pause freezes the clock. Locking the phone does not: the timer stores timestamps, and a hold that already elapsed is logged when the page returns. Short tones mark the last three get-ready seconds, the start of the hold, the last three hold seconds, the end of the hold, and the end of rest. The page behind the modal stays as it was. Workout Planner already sends count. An optional timerSec could later name a countdown that differs from the stepper; that field is not written by this app.
A per-side exercise sets "perSide": true. The reps or seconds already mean each side, so the app labels them /side and does not double a logged number. A timed per-side set is get-ready, the left hold, a 4 second switch, the right hold, then one logged set of that per-side duration, then rest. Cancel before the right side finishes logs nothing. When perSide is absent, names containing side plank, single-leg, single-arm, one-arm, or suitcase use the same label. "perSide": false turns that hint off. Bulgarian split squat, reverse lunge, step-up, and dead bug are not inferred.
public/data/training.json starter goal, plan, and presets (no sessions)
public/form-demos/ short form clips, one per strength exercise
src/views Today, Log, Plans, Progress, Data
src/components/StrengthSession.tsx fullscreen strength logger
src/lib dates, targets, gist sync, storage, form clips
.github/workflows/deploy.yml Pages deploy
scripts/sample-data.mjs rewrites the starter file
scripts/form-placeholders.py redraws the placeholder clips
Form on a strength exercise opens a sheet and plays a short loop. The week controls and the log stay where they are. Nothing about that button opens a new tab.
Clips live in public/form-demos/, one file per exercise on the presets and the ski plan. src/lib/demos.ts maps the exercise name to that file. WebM is what the files use now. A GIF with the same name also plays.
Goblet squat, flat dumbbell bench press, incline press, dumbbell curl, and hip thrust are short trims from the wger library under CC BY-SA 4.0. Credits are in public/form-demos/CREDITS.txt and on the sheet. The other exercises are placeholder stick figures, labeled Placeholder, so a demo still plays with the phone offline. They are not filmed form.
To drop in a real clip, replace the WebM at that exercise’s path with a short, muted file about 480px wide. A GIF named the same way works too. Then set that exercise’s source to wger and add a credit line in src/lib/demos.ts. python3 scripts/form-placeholders.py redraws only the placeholders, and only if ffmpeg is installed. It does not touch the filmed files.
Learn more, at the bottom of the sheet, still opens the wger page for that exercise.
training.json is version 1:
- goals — name, target date, focus tags, notes, status (
active,paused,done) - plans — linked to a goal, with a start date, a number of weeks, an optional end date, a weekly template, optional phases (inclusive dates that change a session’s notes, minutes, or set count, and can carry per-exercise load targets), and optional one-off
moves(see below) - presets — reusable workouts you can start from Today or the log
- sessions — a strength workout or a run, optionally linked to a plan session. A run can hold a watch summary: pace, heart rate, active and total calories, cadence, power, elevation, effort, place, source, activity, start and finish, weather, and splits. Older sessions that lack those fields still load. Strength uses the same time, heart rate, calorie, and effort fields when they are present. A strength exercise can also store how the load was held.
- deleted — ids removed on one device, so a sync does not bring them back
A strength session counts as done from sets and reps (seconds for a hold). That check does not use weight. A run on the plan is done when a run is logged against it that week. Logged kilograms, distance, and pace are history.
An optional recommendation can pre-fill the strength logger. weightKg is the kilograms of one piece — one dumbbell, one kettlebell, or each hand of a pair — the same number the session shows as kg per piece, not the total of a pair. A missing sets, reps, or weightKg keeps the plan’s set count, the plan’s reps text, or the last logged weight.
A plan or preset exercise can include an optional alsoCounts list of other logged names that satisfy that exercise. The field is absent when there are no aliases. Matching trims both names and ignores case. The gist file stays version 1, and exercises that omit alsoCounts are unchanged.
{ "name": "Dumbbell Romanian deadlift", "sets": 3, "reps": "8", "alsoCounts": ["Single-leg Romanian deadlift"] }A phase can list targets for the dates it covers. Each of sets, reps, and weightKg on that list wins over the same field on the exercise. A field the phase omits falls back to target on the exercise, then to the plan. Names match the plan exercise, or an alsoCounts alias, after trim and without case. Outside the phase dates, only the exercise target applies.
{
"name": "Week 2",
"startDate": "2026-10-12",
"endDate": "2026-10-18",
"sessions": [
{ "sessionId": "ps-lower-b", "notes": "Reverse lunge 3x8 each leg @ 10 kg per hand" }
],
"targets": [
{
"sessionId": "ps-lower-b",
"exercises": [
{ "name": "Reverse lunge", "sets": 3, "reps": 8, "weightKg": 10 }
]
}
]
}reps here is a number of reps to pre-fill, not the plan’s reps text. sets, when present, is also the planned set count and the session cap for that date. A standing recommendation, used when no phase target covers the date, sits on the exercise:
{ "name": "Reverse lunge", "sets": 3, "reps": "8", "target": { "reps": 8, "weightKg": 8 } }Those numbers pre-fill the logger. They do not decide whether the session is done. A strength session is done when every exercise has its planned number of sets logged. A short set still counts, and weight is not checked. The logger’s set cap stays that planned count.
An exercise can list the gear it needs. Each entry is a short label. 2× dumbbells is a pair, dumbbell or kettlebell is one piece, and bench, mat, and resistance band are the other home-plan pieces. The field is absent until a writer adds it. The preview then infers the piece count from the exercise name and adds the bench or mat the home plan uses. A written list replaces that inference for that exercise.
{ "name": "Reverse lunge", "sets": 3, "reps": "8", "equipment": ["2× dumbbells"] }A phase note that only restates those loads, including a paragraph that starts with Loads:, is left off a run preview. The strength preview does not show the session coaching note or the phase coaching note. A run note such as 20-25 min easy still shows.
The repeating week stays on dayOfWeek. To show one occurrence on another date, the planner adds moves on that plan. Leave moves off and the week is unchanged. The site does not edit this list.
"moves": [
{
"sessionId": "ps-upper",
"fromDate": "2026-10-07",
"toDate": "2026-10-08",
"updatedAt": "2026-10-07T08:00:00.000Z"
}
]fromDate is the day that occurrence would have used. toDate is where the card shows. Both are YYYY-MM-DD. updatedAt can be omitted. When the same session and fromDate appear twice, the later stamp wins, and an equal stamp keeps the later entry.
The site does not shift any other session. If the new day already has a workout, the planner writes a move for that workout too. Thursday 8 October 2026 is empty, so Full upper needs only the entry above. Moving the Tuesday easy run onto Wednesday, which already has Full upper, needs both of these:
"moves": [
{
"sessionId": "ps-easy",
"fromDate": "2026-10-06",
"toDate": "2026-10-07",
"updatedAt": "2026-10-06T09:00:00.000Z"
},
{
"sessionId": "ps-upper",
"fromDate": "2026-10-07",
"toDate": "2026-10-08",
"updatedAt": "2026-10-06T09:00:00.000Z"
}
]A move is ignored when moves is missing or not an array, the session id is unknown, a date is not a real calendar day, fromDate is not that session’s weekday, fromDate equals toDate, or fromDate falls outside the plan. Other weeks stay on their usual days. The phase, the targets, and the done check use the day the card shows (toDate). The card label reads “Moved from Wed”.
A saved preset can be placed on one date without joining the repeating week. Leave extras off and nothing is added. The site does not edit this list. The card uses the preset as written: phase set changes do not rewrite it. presetId must match presets[].id. The logged session id is extra: plus that preset id, for example extra:preset-full-body.
"extras": [
{
"presetId": "preset-full-body",
"date": "2026-10-25",
"updatedAt": "2026-10-25T09:00:00.000Z"
}
]date is the day the card shows, YYYY-MM-DD. updatedAt can be omitted. When the same preset and date appear twice, the later stamp wins, and an equal stamp keeps the later entry. An empty list is omitted on save.
The card shows on that date, after the repeating sessions, when the preset exists and the date is inside the plan. Today, the week board, and the activity calendar all use that card. Start opens the preset with its targets filled in. Logging the planned sets, or marking the card done, counts it like any other planned session. A completion for it uses session id extra:preset-full-body and the card’s date.
An entry is kept but not drawn when the preset id is unknown or the date falls outside the plan. An entry is dropped when extras is not an array, presetId is blank, or date is not a real calendar day. A past date inside the plan still shows on that day, and only on that day.
The site can mark any planned card done or not done from the day view, the session preview, and the strength review screen. The planner reads and writes the same list on the plan. Leave completions off and every card follows its logged set count.
"completions": [
{
"sessionId": "ps-upper",
"date": "2026-10-12",
"done": true,
"updatedAt": "2026-10-12T18:00:00.000Z"
}
]date is the day the card shows, YYYY-MM-DD. For a moved session that is toDate, not fromDate. done: true forces the card done. done: false forces it not done, even when every set is logged. updatedAt can be omitted. When the same session and date appear twice, the later stamp wins, and an equal stamp keeps the later entry.
The site stores an entry only when the choice differs from the set count, and removes it when the choice matches that count again. The planner can write either value; the site treats a stored entry as the override. An entry is ignored when completions is missing or not an array, the session id is unknown, the date is not a real calendar day, or done is not a boolean.
weightKg on a set is always the total load. When the set used a bell, the exercise also stores pieces (1 or 2) and implement (dumbbell or kettlebell), and each weighted set stores kgPerPiece. Two pieces are always dumbbells. One piece is a dumbbell or a kettlebell. The logger shows kilograms per piece as the large number and the total underneath. Those two never swap.
Older sets stored only weightKg. That number stays the total. On load, the app fills a one-piece choice only when the total and the per-piece weight are the same number:
- a name containing “kettlebell”, plus Goblet squat and Suitcase carry → one kettlebell (those two names follow the home plan notes)
- a name containing “one-arm” or “single-arm” → one dumbbell
A pair of dumbbells is not guessed, because the old number does not say whether it was one bell or both. Those sets stay labeled as a total until you pick pieces while editing.