How ahljvanderplas/justfit works
JustFit is a privacy-first fitness PWA centered on an adaptive daily workout: users check in or rely on profile settings, receive an exercise plan, complete and adjust a session, then review progress. The client shell and API wrapper connect that experience to Pages Functions and D1. The README also documents coaching, sport-specific modes, trainer/gym features, legal and privacy flows, and integrations. Some subsystem links reflect documented capabilities and tree paths; unsampled implementation details are not inferred.
Main entry points: apiClient.js API client · App.jsx App shell · plan.js Plan endpoint · index.js Scheduled operations
Components 25
Client PWA
- App shell
packages/client-app/src/App.jsx - API client
packages/client-app/src/apiClient.js - Workout coaching
packages/client-app/src/WorkoutView.jsx - Progress views
packages/client-app/src/HistoryView.jsx - Settings and coaches
packages/client-app/src/SettingsView.jsx - Safety messaging
packages/client-app/src/messagePolicy.js
Fitness planning
- Plan endpoint
functions/api/plan.js - Planner rules
packages/shared/src/rule-engine/rules.ts - Sport adaptations
functions/api/_shared
API services
- Daily check-in
functions/api/checkin.js - Profile and preferences
functions/api/profile.js - Workout execution
functions/api/execution.js - Progression and score
functions/api/progression.js - Authentication
functions/api/auth.js - Trainer and gym services
functions/api/client - Consent and privacy
functions/api/client/gdpr - Exercise library
functions/api/exercises.js
Integrations and operations
- Strava connection
functions/api/strava-auth.js - Mollie billing
functions/lib/mollie.js - D1 database
- Scheduled operations
workers/justfit-ops/src/index.js - Push dispatch
functions/api/push-dispatch.js
Other components
- Member
- Strava
- Backup object store
Connections 33
- Member → App shell: uses
- App shell → API client: requests data
- App shell → Workout coaching: opens session
- App shell → Progress views: shows progress
- App shell → Settings and coaches: configures
- App shell → Safety messaging: interprets rule codes
- API client → Plan endpoint: generates plan
- API client → Daily check-in: saves check-in
- API client → Profile and preferences: loads preferences
- API client → Workout execution: syncs sessions
- API client → Progression and score: loads progress
- API client → Authentication: authenticates
- API client → Trainer and gym services: requests coaching
- API client → Consent and privacy: requests privacy data
- API client → Exercise library: loads exercises
- Workout coaching → API client: records session
- Plan endpoint → Planner rules: uses planner rules
- Plan endpoint → D1 database: reads and writes
- Plan endpoint → Sport adaptations: applies sport context
- Daily check-in → D1 database: reads and writes
- Profile and preferences → D1 database: reads and writes
- Workout execution → D1 database: reads and writes
- Progression and score → D1 database: reads and writes
- Authentication → D1 database: reads and writes
- Authentication → Mollie billing: cancels subscription
- Trainer and gym services → D1 database: reads and writes
- Consent and privacy → D1 database: reads and writes
- Exercise library → D1 database: queries exercises
- Strava connection → D1 database: stores connection
- Strava connection → Strava: exchanges tokens
- Scheduled operations → D1 database: exports data
- Scheduled operations → Backup object store: stores backups
- Scheduled operations → Push dispatch: dispatches daily