How gernotfound/logbook works
TheLogBook is an offline-first PWA for workout training, nutrition, and body-composition tracking. Users record and review those domains in the app; changes are persisted locally first and, for authenticated accounts, replicated to Firestore. The graph also preserves the documented catalog, backup/export, PWA, analytics, and account-deletion capabilities. Several subsystem links are supported only by the README or source-index references; unsampled implementation details are not inferred.
Main entry points: App.tsx App shell · useAppStore.ts App state · AuthContext.tsx Authentication · localRepository.ts Local repository
Components 22
App experience
- App shell
src/App.tsx - Authentication
src/contexts/AuthContext.tsx
Health domains
- Training
src/components/Training - Nutrition
src/components/Nutrition - Body data
src/components/Data - Progress analytics
src/components/analytics - Exercise and food catalog
src/lib/catalog/catalogService.ts - Backup and export
src/lib/backup.ts
Offline-first data
- App state
src/store/useAppStore.ts - Domain operations
src/lib/sync/domainOperations - Local repository
src/lib/sync/localRepository.ts - Local persistence
src/lib/db.ts - Sync session
src/lib/sync/session.ts
Account and services
- Cloud replica
src/lib/firebase.ts - Account deletion
server/accountDeletion - Deletion API
api/account-deletion.ts
PWA and insights
- Service worker
src/sw.ts - Safe update barrier
src/lib/sync/safeReload.ts - Technical telemetry
src/lib/telemetryHub.ts - Opt-in analytics
src/lib/googleAnalytics.ts
Other components
- User
- Firebase services
Connections 29
- User → App shell: uses
README.md - App shell → Training: opens
src/App.tsx - App shell → Authentication: uses
src/App.tsx - User → Nutrition: records meals
README.md - User → Body data: records measures
README.md - User → Progress analytics: reviews progress
README.md - Training → App state: updates state
- Nutrition → App state: updates state
- Body data → App state: updates state
- Progress analytics → App state: reads state
- Training → Exercise and food catalog: uses exercises
- Nutrition → Exercise and food catalog: uses foods
- Authentication → Exercise and food catalog: loads catalog
src/contexts/AuthContext.tsx - App state → Domain operations: dispatches mutations
- Domain operations → Local repository: compiles and applies
src/lib/sync/localRepository.ts - Local repository → Local persistence: persists envelope
README.md - Local repository → Exercise and food catalog: reads cached catalog
src/lib/sync/localRepository.ts - Authentication → Local repository: hydrates account data
src/contexts/AuthContext.tsx - Authentication → Sync session: establishes sync
src/contexts/AuthContext.tsx - Sync session → Cloud replica: replicates data
README.md - Cloud replica → Firebase services: uses Firebase
src/lib/firebase.ts - User → Backup and export: exports or imports
README.md - User → Deletion API: requests deletion
README.md - Deletion API → Account deletion: routes request
- Account deletion → Firebase services: uses Firebase Admin
README.md - App shell → Service worker: runs as PWA
README.md - App shell → Safe update barrier: guards update reload
src/App.tsx - App shell → Technical telemetry: reports technical issues
- User → Opt-in analytics: opts in
README.md