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.
This commit is contained in:
1 parent
3c5bcd5957
commit
e9bf38f39b
11 files changed
+281
-15
No files matched your search
@@ -7,6 +7,7 @@ import { lastEntryFor, bestWeightFor, buildSets, effectiveRoutineId, workoutVolu
|
||||
import { beep, vibrate } from './lib/sound.js'
|
||||
import { t, instrFor, getLang, INSTR_LANGS } from './lib/i18n.js'
|
||||
import { nav } from './lib/nav.js'
|
||||
import { starterRoutines } from './lib/starter.js'
|
||||
import Media, { Thumb } from './components/Media.jsx'
|
||||
import Stepper from './components/Stepper.jsx'
|
||||
import Icon from './components/Icon.jsx'
|
||||
@@ -36,11 +37,8 @@ export function confirmSheet(opts) {
|
||||
|
||||
/* ============================ starter plan ============================ */
|
||||
export function loadStarterPlan() {
|
||||
const mk = (name, emoji, list) => ({ id: uid(), name, emoji, ex: list.map(([id, sets, reps]) => ({ id, sets, reps, weight: 0 })) })
|
||||
const [push, pull, legs] = starterRoutines()
|
||||
update(st => {
|
||||
const push = mk('Push Day', 'barbell', [['0025', 4, 8], ['0047', 3, 10], ['0426', 3, 10], ['0334', 3, 12], ['0241', 3, 12], ['0251', 3, 10]])
|
||||
const pull = mk('Pull Day', 'pullup', [['2330', 4, 10], ['0027', 4, 8], ['1323', 3, 10], ['0031', 3, 10], ['0313', 3, 12]])
|
||||
const legs = mk('Leg Day', 'legs', [['0043', 4, 8], ['0085', 3, 10], ['0739', 3, 12], ['0585', 3, 12], ['0586', 3, 12], ['0605', 4, 15]])
|
||||
st.routines.push(push, pull, legs)
|
||||
st.week[1] = push.id; st.week[3] = pull.id; st.week[5] = legs.id
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user