Skip to content

armgit / lyftr

Public Imported from GitHub
0

Self-hosted fitness tracker. Log workouts, track nutrition, and monitor progress. Docker deployment, mobile-friendly.

chore: remove the rest of the dead code across web, mobile, and backend

Cawlummc9f58835cf9d
diff --git a/backend/stores/workout.go b/backend/stores/workout.go
index bc02c73..4e19a6b 100644
--- a/backend/stores/workout.go
+++ b/backend/stores/workout.go
@@ -97,18 +97,8 @@ func (s *WorkoutStore) get(id int64) (models.Workout, error) {
return w, nil
}
-func (s *WorkoutStore) Create(uid int64, req models.CreateWorkoutRequest) (models.Workout, error) {
- wid, err := inTx(s.db, func(tx *sql.Tx) (int64, error) {
- return createWorkoutTx(tx, uid, req)
- })
- if err != nil {
- return models.Workout{}, err
- }
- return s.get(wid)
-}
-
// createWorkoutTx inserts the workout + its exercises/sets within an existing
-// transaction, returning the new workout id. Factored out of Create so the
+// transaction, returning the new workout id. Factored out so the
// PR-snapshot read, the insert, and the suggestion-staging write can share one
// transaction (see CreateWithProgression) — SQLite then serializes concurrent
// submissions instead of letting them read the same stale prior-best (#40).
diff --git a/mobile/src/components/ui/OptionPill.tsx b/mobile/src/components/ui/OptionPill.tsx
deleted file mode 100644
index 5c358bd..0000000
--- a/mobile/src/components/ui/OptionPill.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { Pressable, Text } from 'react-native'
-import type { LucideIcon } from 'lucide-react-native'
-import * as Haptics from 'expo-haptics'
-import { useTheme } from '../../theme/useTheme'
-
-interface Props {
- label: string
- icon?: LucideIcon
- active: boolean
- onPress: () => void
- className?: string
-}
-
-// Mobile-only extraction unifying settings' UnitPill + ThemePill: a small set of
-// mutually-exclusive choices where each pill carries its own selected state.
-// (For a boxed, single-track control use SegmentedControl instead — pills suit 2–3
-// loose options with icons.)
-export function OptionPill({ label, icon: Icon, active, onPress, className = '' }: Props) {
- const { colors } = useTheme()
- // Icon stroke is an SVG prop → themed inline (documented className exception).
- const tint = active ? '#ffffff' : colors.txSecondary
- return (
- <Pressable
- accessibilityRole="button"
- accessibilityState={{ selected: active }}
- onPress={() => {
- if (active) return
- Haptics.selectionAsync().catch(() => {})
- onPress()
- }}
- className={`flex-row gap-2 px-5 h-11 rounded-lg items-center justify-center active:scale-95 ${
- active ? 'bg-brand-500' : 'bg-surface-muted border border-surface-border'
- } ${className}`}
- >
- {Icon ? <Icon color={tint} size={16} strokeWidth={2.2} /> : null}
- <Text className={`font-sans-semibold text-sm ${active ? 'text-white' : 'text-tx-secondary'}`}>
- {label}
- </Text>
- </Pressable>
- )
-}
diff --git a/mobile/src/components/ui/Section.tsx b/mobile/src/components/ui/Section.tsx
deleted file mode 100644
index 726b96f..0000000
--- a/mobile/src/components/ui/Section.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import { ReactNode } from 'react'
-import { View } from 'react-native'
-import { Card } from './Card'
-import { Label } from './Typography'
-
-interface Props {
- label: string
- right?: ReactNode
- children: ReactNode
- className?: string
-}
-
-// Mobile-only extraction: the "Card with a muted uppercase micro-label" pattern that
-// every tab screen was hand-rolling (Account / Weight unit / Today's macros / ...).
-export function Section({ label, right, children, className = '' }: Props) {
- return (
- <Card className={className}>
- <View className="flex-row items-center justify-between mb-2">
- <Label>{label}</Label>
- {right ? <View>{right}</View> : null}
- </View>
- {children}
- </Card>
- )
-}
diff --git a/mobile/src/components/ui/Skeleton.tsx b/mobile/src/components/ui/Skeleton.tsx
index a213356..b6d3bd0 100644
--- a/mobile/src/components/ui/Skeleton.tsx
+++ b/mobile/src/components/ui/Skeleton.tsx
@@ -76,7 +76,7 @@ export function Skeleton({ width, height = 14, radius = 8, style, className }: P
// A stack of text-line placeholders: a heavier "title" line then lighter meta lines.
// widths cycle so successive lines look naturally ragged.
-export function SkeletonText({ lines = 2, widths, style }: {
+function SkeletonText({ lines = 2, widths, style }: {
lines?: number
widths?: (number | string)[]
style?: ViewStyle
@@ -93,7 +93,7 @@ export function SkeletonText({ lines = 2, widths, style }: {
// A generic list-row placeholder inside a Card: optional leading square (thumbnail),
// text lines, optional trailing glyph — the shape of the app's card list rows.
-export function SkeletonListRow({ avatar = 44, lines = 3, trailing = true }: {
+function SkeletonListRow({ avatar = 44, lines = 3, trailing = true }: {
avatar?: number | false
lines?: number
trailing?: boolean
@@ -123,7 +123,7 @@ export function SkeletonList({ count = 6, ...row }: {
// A single summary-stat card placeholder (label + big value), and a row of them — the
// shape used by the Workouts/Weight/Dashboard stat grids.
-export function SkeletonStat() {
+function SkeletonStat() {
return (
<Card className="flex-1 rounded-2xl" style={{ paddingHorizontal: 12 }}>
<Skeleton width={40} height={10} radius={4} />
diff --git a/mobile/src/components/ui/Stat.tsx b/mobile/src/components/ui/Stat.tsx
deleted file mode 100644
index a1a9089..0000000
--- a/mobile/src/components/ui/Stat.tsx
+++ /dev/null
@@ -1,36 +0,0 @@
-import { Text, View } from 'react-native'
-import { AppText } from './Typography'
-
-interface Props {
- label: string
- value: string | number
- unit?: string
- /** Tiny third line, e.g. the "/ 150g" goal under a macro. */
- sublabel?: string
- /** Prefix positive numeric values with "+" (deltas like 7d/30d change). */
- signed?: boolean
- className?: string
-}
-
-// Mobile-only extraction unifying the dashboard's Macro and the weight screen's Stat:
-// a centered value (+ optional inline unit), a label, and an optional sub-line.
-// Intended for row layouts (`flex-row justify-between` of several Stats).
-export function Stat({ label, value, unit, sublabel, signed = false, className = '' }: Props) {
- const display = signed && typeof value === 'number' && value >= 0 ? `+${value}` : String(value)
- return (
- <View className={`items-center ${className}`}>
- <Text
- className="font-display text-lg text-tx-primary"
- // Tabular digits so a row of Stats doesn't wobble as values update.
- style={{ fontVariant: ['tabular-nums'] }}
- >
- {display}
- {unit ? <Text className="font-sans text-sm text-tx-muted"> {unit}</Text> : null}
- </Text>
- <AppText variant="caption">{label}</AppText>
- {sublabel ? (
- <Text className="font-sans text-[10px] text-tx-muted">{sublabel}</Text>
- ) : null}
- </View>
- )
-}
diff --git a/mobile/src/components/ui/Typography.tsx b/mobile/src/components/ui/Typography.tsx
index b6f409a..3dff438 100644
--- a/mobile/src/components/ui/Typography.tsx
+++ b/mobile/src/components/ui/Typography.tsx
@@ -98,10 +98,6 @@ export function AppText({
// Convenience wrappers so call sites read like a type scale, not a prop soup.
type VariantlessProps = Omit<AppTextProps, 'variant'>
-export function Heading(props: VariantlessProps) {
- return <AppText variant="heading" {...props} />
-}
-
export function Body(props: VariantlessProps) {
return <AppText variant="body" {...props} />
}
@@ -110,16 +106,6 @@ export function Label(props: VariantlessProps) {
return <AppText variant="label" {...props} />
}
-export function Numeric(props: VariantlessProps) {
- return <AppText variant="numeric" {...props} />
-}
-
-// Pre-existing exports, preserved verbatim in API but re-based on the brand fonts
-// (this is the fix for tab screens rendering headings in the system font).
-export function H1({ children }: { children: ReactNode }) {
- return <AppText variant="title">{children}</AppText>
-}
-
// Muted deliberately does NOT set a font size: existing callers size it via
// className (`text-xs`, etc.), and stacking a variant size class against theirs
// would leave the winner to stylesheet order rather than intent.
diff --git a/mobile/src/components/ui/index.ts b/mobile/src/components/ui/index.ts
index ec68702..6767b98 100644
--- a/mobile/src/components/ui/index.ts
+++ b/mobile/src/components/ui/index.ts
@@ -3,13 +3,12 @@
// already import, so it fully replaces the old single-file ui.tsx.
// Typography — the only sanctioned way to render text (brand fonts live here).
-export { AppText, Heading, Body, Label, Numeric, H1, Muted } from './Typography'
+export { AppText, Body, Label, Muted } from './Typography'
export type { AppTextProps, TextVariant, TextColor } from './Typography'
// Layout / surfaces
export { Screen } from './Screen'
export { Card } from './Card'
-export { Section } from './Section'
// Headers (web-parity)
export { PageHeader } from './PageHeader'
@@ -19,7 +18,6 @@ export { SectionHeader } from './SectionHeader'
export { Button } from './Button'
export { IconButton } from './IconButton'
export { SegmentedControl } from './SegmentedControl'
-export { OptionPill } from './OptionPill'
// Inputs
export { Field } from './Field'
@@ -30,7 +28,6 @@ export { StepperTile } from './StepperTile'
export { DateInput } from './DateInput'
// Data display
-export { Stat } from './Stat'
export { ListRow } from './ListRow'
// Settings list — grouped iOS-style rows, reusable for any preferences screen
@@ -40,7 +37,7 @@ export { Toggle } from './Toggle'
export { EmptyState } from './EmptyState'
// Loading placeholders (skeleton screens) — reusable across list/detail pages
-export { Skeleton, SkeletonText, SkeletonListRow, SkeletonList, SkeletonStat, SkeletonStatRow } from './Skeleton'
+export { Skeleton, SkeletonList, SkeletonStatRow } from './Skeleton'
export { ListScreenSkeleton } from './ListScreenSkeleton'
// Feedback
diff --git a/mobile/src/lib/lyftr.ts b/mobile/src/lib/lyftr.ts
index e26fb5c..9b0e602 100644
--- a/mobile/src/lib/lyftr.ts
+++ b/mobile/src/lib/lyftr.ts
@@ -31,4 +31,3 @@ export const useThemeStore = createThemeStore(storage, 'light')
// AsyncStorage; rest-timer state is in-memory only (see the store).
export const useWorkoutSession = createWorkoutSession(storage)
-export { storage }
diff --git a/mobile/src/utils/exerciseUtils.ts b/mobile/src/utils/exerciseUtils.ts
index e268ee8..3d1e40d 100644
--- a/mobile/src/utils/exerciseUtils.ts
+++ b/mobile/src/utils/exerciseUtils.ts
@@ -18,7 +18,7 @@ export interface MuscleTint {
text: string
}
-export const MUSCLE_COLORS: Record<string, MuscleTint> = {
+const MUSCLE_COLORS: Record<string, MuscleTint> = {
chest: { chip: 'bg-red-500/20', border: 'border-red-500/30', text: '#f87171' },
back: { chip: 'bg-blue-500/20', border: 'border-blue-500/30', text: '#60a5fa' },
shoulders: { chip: 'bg-orange-500/20', border: 'border-orange-500/30', text: '#fb923c' },
diff --git a/web/e2e/config.ts b/web/e2e/config.ts
index 278bc13..f72932b 100644
--- a/web/e2e/config.ts
+++ b/web/e2e/config.ts
@@ -28,5 +28,3 @@ const base = getBase()
export const API_BASE = process.env.API_URL ?? (
process.env.E2E_DOCKER ? `${base}/api/v1` : 'http://localhost:3000/api/v1'
)
-export const TEST_EMAIL = process.env.TEST_EMAIL ?? '[email protected]'
-export const TEST_PASSWORD = process.env.TEST_PASSWORD ?? 'password123'
diff --git a/web/package-lock.json b/web/package-lock.json
index 689b012..4e17809 100644
--- a/web/package-lock.json
+++ b/web/package-lock.json
@@ -8,7 +8,6 @@
"name": "lyfter-web",
"version": "0.0.0",
"dependencies": {
- "@tanstack/react-query": "^5.28.0",
"@tanstack/react-virtual": "^3.13.24",
"axios": "^1.6.2",
"date-fns": "^3.0.0",
@@ -1602,30 +1601,6 @@
"win32"
]
},
- "node_modules/@tanstack/query-core": {
- "version": "5.99.1",
- "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.99.1.tgz",
- "integrity": "sha512-5E8xwxyWvr22yt7zvzP3KOZ5TUElOdVA45NP3/Ao1m9mvc9i18NLTDe9m3M00BH2DR5J20cv7xckMPlhKNs+vQ==",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/tannerlinsley"
- }
- },
- "node_modules/@tanstack/react-query": {
- "version": "5.99.1",
- "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.99.1.tgz",
- "integrity": "sha512-akg5GdwW70lvJvCqVHZ7tizGyc+TATjUzKX9RuF1xknhEe/1leofXk7YLYbrbRsuhNbHJBAayaQUMvvOFZ5L5g==",
- "dependencies": {
- "@tanstack/query-core": "5.99.1"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/tannerlinsley"
- },
- "peerDependencies": {
- "react": "^18 || ^19"
- }
- },
"node_modules/@tanstack/react-virtual": {
"version": "3.13.24",
"resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.13.24.tgz",
diff --git a/web/package.json b/web/package.json
index 11ad1eb..4ea9714 100644
--- a/web/package.json
+++ b/web/package.json
@@ -17,7 +17,6 @@
"test:e2e:ui": "playwright test --ui"
},
"dependencies": {
- "@tanstack/react-query": "^5.28.0",
"@tanstack/react-virtual": "^3.13.24",
"axios": "^1.6.2",
"date-fns": "^3.0.0",
diff --git a/web/scripts/post-launch.mjs b/web/scripts/post-launch.mjs
deleted file mode 100644
index f6524f2..0000000
--- a/web/scripts/post-launch.mjs
+++ /dev/null
@@ -1,112 +0,0 @@
-import { chromium } from 'playwright'
-import * as readline from 'readline'
-
-function pause(msg) {
- return new Promise(resolve => {
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout })
- rl.question(`\n${msg}\nPress ENTER when done... `, () => { rl.close(); resolve() })
- })
-}
-
-const browser = await chromium.launch({ headless: false, args: ['--start-maximized'] })
-const ctx = await browser.newContext({ viewport: null })
-const page = await ctx.newPage()
-
-// ── 1. DEV.TO ───────────────────────────────────────────
-console.log('\n[1/3] DEV.to')
-await page.goto('https://dev.to/enter')
-await pause('Log into DEV.to (GitHub login works), then press ENTER')
-
-await page.goto('https://dev.to/new')
-await page.waitForTimeout(2000)
-
-// DEV.to uses a rich editor — fill title then body via keyboard
-await page.click('textarea#article_title, input[placeholder*="title"], h1[data-placeholder]', { timeout: 5000 }).catch(() => {})
-await page.waitForTimeout(500)
-await page.keyboard.type('I built a self-hosted alternative to Hevy and Strong', { delay: 20 })
-
-// Click the body area
-await page.click('.CodeMirror, .cm-content, [data-testid="article-form__body"]', { timeout: 5000 }).catch(() => {})
-await page.waitForTimeout(300)
-
-const devBody = `I got tired of paying for fitness tracking apps and not owning my data, so I built Lyftr — a self-hosted workout tracker you can run on your own server or VPS with one Docker command.
-
-## What it does
-
-- Log workouts with 800+ exercise library (auto-seeded on first run)
-- Build reusable programs with target sets and weights
-- Active workout mode — guided set-by-set flow
-- Dashboard with volume trends, 12-week consistency heatmap, and muscle balance charts
-- All data in a single SQLite file you control
-
-## Stack
-
-Go + Gin backend, React + TypeScript + Tailwind frontend, SQLite, Docker + nginx.
-
-## Getting started
-
-\`\`\`bash
-git clone https://github.com/Cawlumm/lyftr.git
-cd lyftr
-cp .env.example .env
-docker compose up -d
-\`\`\`
-
-Open http://localhost. That's it.
-
-## Why self-hosted?
-
-Your workout history is valuable data. I didn't want it locked in a SaaS that could raise prices, change APIs, or shut down. SQLite means one file to back up.
-
-Still early beta — actively building. Source: https://github.com/Cawlumm/lyftr
-
-Feedback welcome.`
-
-await page.keyboard.type(devBody, { delay: 10 })
-
-await pause('Review the DEV.to post. Add tags: go, react, opensource, fitness — then press ENTER when ready to publish')
-// Try clicking publish button
-await page.click('button:has-text("Publish"), button:has-text("Submit")').catch(() => {})
-await page.waitForTimeout(2000)
-console.log('DEV.to done. URL:', page.url())
-
-// ── 2. INDIE HACKERS ────────────────────────────────────
-console.log('\n[2/3] Indie Hackers')
-await page.goto('https://www.indiehackers.com/sign-in')
-await pause('Log into Indie Hackers, then press ENTER')
-
-await page.goto('https://www.indiehackers.com/post/new')
-await page.waitForTimeout(2000)
-await pause('Indie Hackers post page is open. Manually paste the post (copied from terminal), choose "What are you working on?" group, then press ENTER when submitted')
-
-// ── 3. TWITTER/X ────────────────────────────────────────
-console.log('\n[3/3] Twitter/X')
-await page.goto('https://x.com/compose/post')
-await page.waitForTimeout(2000)
-const tweet = `Built Lyftr — a self-hosted, open source workout tracker.
-
-Your data. Your server. One Docker command.
-
-→ 800+ exercises auto-seeded
-→ Volume trends + consistency heatmap
-→ Program builder
-→ Works great on mobile
-
-Still early beta but it's usable daily.
-
-github.com/Cawlumm/lyftr
-
-#buildinpublic #selfhosted #opensource #fitness`
-
-// Try filling compose box
-await page.click('[data-testid="tweetTextarea_0"], .DraftEditor-root, [contenteditable="true"]', { timeout: 5000 }).catch(() => {})
-await page.waitForTimeout(300)
-await page.keyboard.type(tweet, { delay: 15 })
-
-await pause('Log in if needed, review the tweet, then press ENTER to post')
-await page.click('[data-testid="tweetButtonInline"], button:has-text("Post")').catch(() => {})
-await page.waitForTimeout(2000)
-console.log('Twitter done. URL:', page.url())
-
-console.log('\n✓ All done. Closing browser.')
-await browser.close()
diff --git a/web/scripts/screenshots.mjs b/web/scripts/screenshots.mjs
deleted file mode 100644
index c40af5a..0000000
--- a/web/scripts/screenshots.mjs
+++ /dev/null
@@ -1,160 +0,0 @@
-import { chromium } from 'playwright'
-import { writeFileSync, mkdirSync } from 'fs'
-import { join, dirname } from 'path'
-import { fileURLToPath } from 'url'
-
-const __dirname = dirname(fileURLToPath(import.meta.url))
-const OUT = join(__dirname, '../../docs/screenshots')
-mkdirSync(OUT, { recursive: true })
-
-const BASE = 'http://localhost:5173'
-const EMAIL = '[email protected]'
-const PASS = 'password123'
-
-const MOBILE = { width: 390, height: 844, deviceScaleFactor: 2 }
-const DESKTOP = { width: 1280, height: 800, deviceScaleFactor: 1 }
-
-async function shot(page, name) {
- await page.waitForTimeout(600)
- await page.screenshot({ path: join(OUT, name), fullPage: false })
- console.log(' saved:', name)
-}
-
-async function login(page) {
- await page.goto(`${BASE}/login`)
- await page.waitForSelector('input[type="email"]')
- await page.fill('input[type="email"]', EMAIL)
- await page.fill('input[type="password"]', PASS)
- await page.click('button[type="submit"]')
- await page.waitForURL(`${BASE}/`)
- await page.waitForTimeout(1200)
-}
-
-async function setLight(page) {
- // set light mode via localStorage
- await page.evaluate(() => {
- localStorage.setItem('theme', 'light')
- document.documentElement.classList.remove('dark')
- })
- await page.waitForTimeout(300)
-}
-
-const browser = await chromium.launch()
-
-// ── MOBILE ────────────────────────────────────────────
-console.log('\n── Mobile screenshots ──')
-{
- const ctx = await browser.newContext({ viewport: MOBILE })
- const page = await ctx.newPage()
- await login(page)
- await setLight(page)
-
- // Dashboard
- await page.goto(`${BASE}/`)
- await page.waitForTimeout(1500)
- await shot(page, 'dashboard-mobile.png')
-
- // Workouts list
- await page.goto(`${BASE}/workouts`)
- await page.waitForTimeout(800)
- await shot(page, 'workouts-mobile.png')
-
- // Workout detail — get first workout id from list
- const wLink = await page.locator('.card button').first()
- await wLink.click()
- await page.waitForTimeout(800)
- await shot(page, 'workout-detail-mobile.png')
-
- // Programs list
- await page.goto(`${BASE}/programs`)
- await page.waitForTimeout(800)
- await shot(page, 'programs-mobile.png')
-
- // Program detail
- const pLink = await page.locator('.card button').first()
- await pLink.click()
- await page.waitForTimeout(800)
- await shot(page, 'program-detail-mobile.png')
-
- // Exercise detail from program detail
- const exLink = await page.locator('button.card').first()
- await exLink.click()
- await page.waitForTimeout(1000)
- await shot(page, 'exercise-detail-mobile.png')
-
- // Active workout — start from a program
- await page.goto(`${BASE}/programs`)
- await page.waitForTimeout(800)
- // click Play button on first program
- const playBtn = await page.locator('button[title="Start workout"]').first()
- await playBtn.click()
- await page.waitForTimeout(800)
- await shot(page, 'active-workout-mobile.png')
-
- // Settings
- await page.goto(`${BASE}/settings`)
- await page.waitForTimeout(800)
- await shot(page, 'settings-mobile.png')
-
- await ctx.close()
-}
-
-// ── DESKTOP ───────────────────────────────────────────
-console.log('\n── Desktop screenshots ──')
-{
- const ctx = await browser.newContext({ viewport: DESKTOP })
- const page = await ctx.newPage()
- await login(page)
- await setLight(page)
-
- // Dashboard
- await page.goto(`${BASE}/`)
- await page.waitForTimeout(1500)
- await shot(page, 'dashboard-desktop.png')
-
- // Workouts
- await page.goto(`${BASE}/workouts`)
- await page.waitForTimeout(800)
- await shot(page, 'workouts-desktop.png')
-
- // Workout detail
- const wLink = await page.locator('.card button').first()
- await wLink.click()
- await page.waitForTimeout(800)
- await shot(page, 'workout-detail-desktop.png')
-
- // Programs
- await page.goto(`${BASE}/programs`)
- await page.waitForTimeout(800)
- await shot(page, 'programs-desktop.png')
-
- // Program detail
- const pLink = await page.locator('.card button').first()
- await pLink.click()
- await page.waitForTimeout(800)
- await shot(page, 'program-detail-desktop.png')
-
- // Exercise detail
- const exLink = await page.locator('button.card').first()
- await exLink.click()
- await page.waitForTimeout(1000)
- await shot(page, 'exercise-detail-desktop.png')
-
- // Active workout
- await page.goto(`${BASE}/programs`)
- await page.waitForTimeout(800)
- const playBtn = await page.locator('button[title="Start workout"]').first()
- await playBtn.click()
- await page.waitForTimeout(800)
- await shot(page, 'active-workout-desktop.png')
-
- // Settings
- await page.goto(`${BASE}/settings`)
- await page.waitForTimeout(800)
- await shot(page, 'settings-desktop.png')
-
- await ctx.close()
-}
-
-await browser.close()
-console.log('\nDone —', OUT)
diff --git a/web/scripts/screenshots.ts b/web/scripts/screenshots.ts
deleted file mode 100644
index 28829e3..0000000
--- a/web/scripts/screenshots.ts
+++ /dev/null
@@ -1,158 +0,0 @@
-/**
- * Run: npx tsx scripts/screenshots.ts
- * Requires: dev server on :5173 (npm run dev) with backend on :3000
- * Or pass BASE_URL env var for docker.
- */
-import { chromium } from '@playwright/test'
-import path from 'path'
-import { fileURLToPath } from 'url'
-
-const __dirname = path.dirname(fileURLToPath(import.meta.url))
-const OUT = path.resolve(__dirname, '../../docs/screenshots')
-const BASE = (process.env.BASE_URL ?? 'http://localhost:5173').replace(/\/$/, '')
-const API = process.env.API_URL ?? `${BASE}/api/v1`
-const EMAIL = process.env.TEST_EMAIL ?? '[email protected]'
-const PASSWORD = process.env.TEST_PASSWORD ?? 'password123'
-
-const MOBILE = { width: 390, height: 844, deviceScaleFactor: 2, isMobile: true, hasTouch: true }
-const DESKTOP = { width: 1280, height: 800, deviceScaleFactor: 1 }
-
-const SESSION_KEY = 'lyftr_active_session'
-const LAYOUT_KEY = 'lyftr_workout_layout'
-
-async function main() {
- const browser = await chromium.launch()
-
- // --- Login and get storage state ---
- const setupCtx = await browser.newContext({ viewport: MOBILE })
- const setupPage = await setupCtx.newPage()
- await setupPage.goto(`${BASE}/login`)
- await setupPage.getByPlaceholder('[email protected]').fill(EMAIL)
- await setupPage.locator('input[type="password"]').fill(PASSWORD)
- await setupPage.getByRole('button', { name: /sign in|log in/i }).click()
- await setupPage.waitForURL(`${BASE}/`)
- const storage = await setupCtx.storageState()
- await setupCtx.close()
-
- // Get a workout ID and exercise ID for detail pages
- const apiCtx = await browser.newContext()
- const apiPage = await apiCtx.newPage()
- const tokenRes = await apiPage.request.post(`${API}/auth/login`, {
- data: { email: EMAIL, password: PASSWORD }
- })
- const token = (await tokenRes.json()).data.token
- const headers = { Authorization: `Bearer ${token}` }
-
- const wRes = await apiPage.request.get(`${API}/workouts?limit=1`, { headers })
- const workouts = (await wRes.json()).data ?? []
- const workoutId = workouts[0]?.id
-
- const exRes = await apiPage.request.get(`${API}/exercises?limit=1`, { headers })
- const exercises = (await exRes.json()).data ?? []
- const exerciseId = exercises[0]?.id
- const exerciseName = exercises[0]?.name ?? 'Bench Press'
-
- const pRes = await apiPage.request.get(`${API}/programs?limit=1`, { headers })
- const programs = (await pRes.json()).data ?? []
- const programId = programs[0]?.id
-
- await apiCtx.close()
-
- async function shoot(name: string, url: string, viewport: typeof MOBILE | typeof DESKTOP, setup?: (p: any) => Promise<void>) {
- const ctx = await browser.newContext({ storageState: storage, viewport })
- if (setup) {
- await ctx.addInitScript(setup as any)
- }
- const page = await ctx.newPage()
- await page.goto(`${BASE}${url}`)
- await page.waitForLoadState('networkidle')
- await page.waitForTimeout(800)
- await page.screenshot({ path: `${OUT}/${name}.png`, fullPage: false })
- console.log(` ✓ ${name}.png`)
- await ctx.close()
- }
-
- async function shootGymMode(
- name: string,
- phase: 'overview' | 'exercise-info' | 'exercise',
- viewport: typeof MOBILE | typeof DESKTOP,
- exId: number,
- exName: string,
- ) {
- const ctx = await browser.newContext({ storageState: storage, viewport })
- const gymUi = { phase, exIdx: 0, setIdx: 0 }
- await ctx.addInitScript(
- ({ sk, lk, uk, session, ui }: any) => {
- localStorage.setItem(sk, JSON.stringify(session))
- localStorage.setItem(lk, 'gym')
- localStorage.setItem(uk, JSON.stringify(ui))
- },
- {
- sk: SESSION_KEY,
- lk: LAYOUT_KEY,
- uk: 'lyftr_gym_ui',
- session: {
- name: 'Push Day',
- started_at: new Date().toISOString(),
- exercises: [
- {
- exercise_id: exId,
- exercise: {
- id: exId, name: exName, muscle_group: 'Chest',
- equipment: 'barbell', category: 'strength',
- secondary_muscles: ['Triceps'], description: 'Classic chest press.', image_url: null,
- },
- notes: '',
- sets: [
- { set_number: 1, target_reps: 5, target_weight: 100, actual_reps: 5, actual_weight: 100, completed: true },
- { set_number: 2, target_reps: 5, target_weight: 100, actual_reps: 0, actual_weight: 0, completed: false },
- { set_number: 3, target_reps: 5, target_weight: 100, actual_reps: 0, actual_weight: 0, completed: false },
- ],
- },
- ],
- },
- ui: gymUi,
- }
- )
- const page = await ctx.newPage()
- await page.goto(`${BASE}/workout/active`)
- await page.waitForLoadState('networkidle')
- await page.waitForTimeout(1000)
- await page.screenshot({ path: `${OUT}/${name}.png`, fullPage: false })
- console.log(` ✓ ${name}.png`)
- await ctx.close()
- }
-
- console.log('\nCapturing mobile screenshots…')
- await shoot('dashboard-mobile', '/', MOBILE)
- await shoot('workouts-mobile', '/workouts', MOBILE)
- if (workoutId) await shoot('workout-detail-mobile', `/workouts/${workoutId}`, MOBILE)
- await shoot('programs-mobile', '/programs', MOBILE)
- if (programId) await shoot('program-detail-mobile', `/programs/${programId}`, MOBILE)
- if (exerciseId) await shoot('exercise-detail-mobile', `/exercises/${exerciseId}`, MOBILE)
- await shoot('active-workout-mobile', '/workouts/new', MOBILE)
- await shoot('settings-mobile', '/settings', MOBILE)
- if (exerciseId) {
- await shootGymMode('gym-mode-overview-mobile', 'overview', MOBILE, exerciseId, exerciseName)
- await shootGymMode('gym-mode-exercise-mobile', 'exercise', MOBILE, exerciseId, exerciseName)
- }
-
- console.log('\nCapturing desktop screenshots…')
- await shoot('dashboard-desktop', '/', DESKTOP)
- await shoot('workouts-desktop', '/workouts', DESKTOP)
- if (workoutId) await shoot('workout-detail-desktop', `/workouts/${workoutId}`, DESKTOP)
- await shoot('programs-desktop', '/programs', DESKTOP)
- if (programId) await shoot('program-detail-desktop', `/programs/${programId}`, DESKTOP)
- if (exerciseId) await shoot('exercise-detail-desktop', `/exercises/${exerciseId}`, DESKTOP)
- await shoot('active-workout-desktop', '/workouts/new', DESKTOP)
- await shoot('settings-desktop', '/settings', DESKTOP)
- if (exerciseId) {
- await shootGymMode('gym-mode-overview-desktop', 'overview', DESKTOP, exerciseId, exerciseName)
- await shootGymMode('gym-mode-exercise-desktop', 'exercise', DESKTOP, exerciseId, exerciseName)
- }
-
- await browser.close()
- console.log('\nDone.')
-}
-
-main().catch(err => { console.error(err); process.exit(1) })
diff --git a/web/src/components/BarbellMark.tsx b/web/src/components/BarbellMark.tsx
deleted file mode 100644
index acfecc2..0000000
--- a/web/src/components/BarbellMark.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-// Small barbell icon mark for favicon/small contexts
-export default function BarbellMark({
- size = 32,
- className = ''
-}: {
- size?: number
- className?: string
-}) {
- return (
- <svg
- width={size}
- height={size}
- viewBox="0 0 240 120"
- xmlns="http://www.w3.org/2000/svg"
- className={className}
- >
- <defs>
- <linearGradient id="barGrad" x1="0%" y1="0%" x2="0%" y2="100%">
- <stop offset="0%" stopColor="#38d8fb" />
- <stop offset="60%" stopColor="#00b8d9" />
- <stop offset="100%" stopColor="#007a96" />
- </linearGradient>
- <filter id="barGlow">
- <feGaussianBlur stdDeviation="2" result="coloredBlur" />
- <feMerge>
- <feMergeNode in="coloredBlur" />
- <feMergeNode in="SourceGraphic" />
- </feMerge>
- </filter>
- </defs>
-
- {/* Left upright */}
- <rect x="30" y="10" width="4" height="70" rx="2" fill="#1c2f50" />
- <rect x="24" y="38" width="10" height="2" rx="1" fill="#1c2f50" />
- <rect x="24" y="58" width="10" height="2" rx="1" fill="#1c2f50" />
-
- {/* Right upright */}
- <rect x="206" y="10" width="4" height="70" rx="2" fill="#1c2f50" />
- <rect x="206" y="38" width="10" height="2" rx="1" fill="#1c2f50" />
- <rect x="206" y="58" width="10" height="2" rx="1" fill="#1c2f50" />
-
- {/* Left plates */}
- <rect x="44" y="38" width="8" height="20" rx="2" fill="#0d1629" stroke="#00b8d9" strokeWidth="1.5" />
- <rect x="54" y="32" width="7" height="28" rx="2" fill="#0d1629" stroke="#00b8d9" strokeWidth="1.5" />
- <rect x="62" y="26" width="6" height="36" rx="2" fill="#0d1629" stroke="#00b8d9" strokeWidth="1.5" />
-
- {/* Bar */}
- <rect x="74" y="50" width="92" height="6" rx="3" fill="url(#barGrad)" filter="url(#barGlow)" />
-
- {/* Right plates */}
- <rect x="188" y="38" width="8" height="20" rx="2" fill="#0d1629" stroke="#00b8d9" strokeWidth="1.5" />
- <rect x="179" y="32" width="7" height="28" rx="2" fill="#0d1629" stroke="#00b8d9" strokeWidth="1.5" />
- <rect x="172" y="26" width="6" height="36" rx="2" fill="#0d1629" stroke="#00b8d9" strokeWidth="1.5" />
-
- {/* Collars */}
- <rect x="68" y="52" width="4" height="22" rx="1" fill="#00b8d9" />
- <rect x="168" y="52" width="4" height="22" rx="1" fill="#00b8d9" />
- </svg>
- )
-}
diff --git a/web/src/components/index.ts b/web/src/components/index.ts
deleted file mode 100644
index 1ab7e72..0000000
--- a/web/src/components/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export { default as Layout } from './Layout'
-export { default as Loading } from './Loading'
-export { default as Logo } from './Logo'
-export { default as BarbellSVG } from './BarbellSVG'
-export { default as BarbellMark } from './BarbellMark'
-export { HelpTip } from './Tooltip'
diff --git a/web/src/stores/settings.ts b/web/src/stores/settings.ts
index 89187e9..9be2021 100644
--- a/web/src/stores/settings.ts
+++ b/web/src/stores/settings.ts
@@ -75,7 +75,6 @@ export const useSettingsStore = create<SettingsStore>((set, get) => ({
reset: () => set({ settings: DEFAULTS, loaded: false }),
}))
-export const weightLabel = (unit: string) => unit === 'kg' ? 'kg' : 'lbs'
export const weightShort = (unit: string) => unit === 'kg' ? 'kg' : 'lb'
// Backend always stores lbs. Use these helpers everywhere weight values are read/written.
@@ -101,7 +100,7 @@ export const displayVolume = (lbs: number, unit: string): number => Math.round(l
// Bodyweight bounds — mirror the backend (LogWeightRequest: gt=0, lte=2000 lbs)
// so the user gets instant feedback instead of a round-trip 400. Defined once
// here; the weight-logging forms validate through weightError/isValidWeight.
-export const MAX_WEIGHT_LBS = 2000
+const MAX_WEIGHT_LBS = 2000
// The max in the user's display unit (2000 lb ≈ 907 kg).
export const maxWeight = (unit: string): number => round1(lbsToDisplay(MAX_WEIGHT_LBS, unit))
diff --git a/web/src/utils/exerciseUtils.ts b/web/src/utils/exerciseUtils.ts
index d9336d2..5a1ec86 100644
--- a/web/src/utils/exerciseUtils.ts
+++ b/web/src/utils/exerciseUtils.ts
@@ -1,4 +1,4 @@
-export const MUSCLE_COLORS: Record<string, string> = {
+const MUSCLE_COLORS: Record<string, string> = {
chest: 'bg-red-500/20 text-red-400 border-red-500/30',
back: 'bg-blue-500/20 text-blue-400 border-blue-500/30',
shoulders: 'bg-orange-500/20 text-orange-400 border-orange-500/30',