Skip to content

Add body measurement tracker PWA with Google Sheets sync#7

Open
adamswbrown wants to merge 1 commit intomainfrom
claude/pwa-measurements-spreadsheet-GnLDL
Open

Add body measurement tracker PWA with Google Sheets sync#7
adamswbrown wants to merge 1 commit intomainfrom
claude/pwa-measurements-spreadsheet-GnLDL

Conversation

@adamswbrown
Copy link
Copy Markdown
Owner

Summary

  • Adds a mobile-first PWA for recording body measurements (arms, waist, legs, chest, hips)
  • Measurements sync to a Google Spreadsheet via Apps Script web app
  • Offline-first: queues submissions when offline and syncs automatically when back online
  • Includes local history, setup instructions with copyable script, and service worker caching

Security hardening (review feedback)

  • All values escaped via escapeHtml() before innerHTML insertion
  • URL validation requires https://*.google.com
  • Apps Script doPost wrapped in try/catch for malformed input
  • no-cors trade-off documented (inherent Apps Script limitation)

Test plan

  • Open index.html on mobile, verify PWA install prompt
  • Submit a measurement with a connected Google Sheet, verify row appears
  • Submit while offline, reconnect, verify queued entry syncs
  • Paste an invalid URL in settings, verify validation error
  • Check History page shows escaped values correctly

- Escape all interpolated values in renderHistory, not just name
- Add try/catch to doPost in Google Apps Script for malformed JSON
- Add URL validation requiring https://*.google.com on save
- Clarify test connection messaging (no-cors limits what we can verify)
- Document no-cors trade-off on sendToSheet and remove unused return

https://claude.ai/code/session_014KYgQRjUYF8Bam3pJWKa6A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants