A personal weight tracker that runs as a PWA on your phone. Reads weight from scale photos via the Anthropic API.
index.html— the app (React, Recharts, Lucide, all via CDN, no build step)manifest.json— PWA manifestservice-worker.js— offline cache + installabilityicon-192.png,icon-512.png— home-screen iconsapple-touch-icon.png,favicon.png— iOS and browser icons
Requirement: HTTPS. The camera API and service workers only work over HTTPS. All options below provide this automatically.
- Create a public repo (e.g.
weight-ledger) - Upload all files to the repo root
- Settings → Pages → Source: main / root → Save
- Visit
https://<username>.github.io/weight-ledger/after ~1 min
- Log in to netlify.com
- Drag the folder onto the deploy area
- Get a URL like
https://<random-name>.netlify.app/ - Optionally rename in Site settings → Domain management
Similar to Netlify. Import or drag the folder, get a URL.
- Open the URL
- A bar appears: "Install app" → tap it
- If no bar: browser menu → "Install app" / "Add to Home screen"
- Open the URL in Safari
- Share button → "Add to Home Screen"
- Open Settings (gear icon, top right)
- Set your height
- Tap "Add key" under API Key, paste your Anthropic API key
- Start logging — tap the
+button
The API key is stored in your device's localStorage. It never leaves your phone except in requests to api.anthropic.com.
The service worker caches files for offline use. To force updates after you change code:
- Bump
CACHE_VERSIONinservice-worker.js - Redeploy
The next time the app is opened, the new version installs in the background. The launch after that shows the new version.
- Everything lives in
localStorageon your device. - Export JSON from Settings for backup.
- Import JSON restores data (merges with existing; dedupes by timestamp+weight).
- "Clear all data" wipes entries but leaves the API key and height.
- Camera doesn't open: HTTPS missing, or site permissions blocked. Check browser site settings.
- "API error 401": API key is invalid or revoked. Update it in Settings.
- "API error 429": You've hit the rate limit or monthly spend cap. Check console.anthropic.com.
- App won't update after redeploy: Close the app fully, reopen; it may need two launches. Or clear site data in browser settings.