FitTrack — Requirements
Personas
- Casual logger — opens after a run, taps “+ Run”, picks duration, saves. Wants the experience to take under 10 seconds.
- Active tracker — starts the workout on the Watch, lets it run with heart rate and pace, ends it; iPhone is only used later for review.
- Trend watcher — checks the dashboard weekly to see 30-day trends; wants beautiful, readable charts.
User stories
Onboarding & permissions
- As a first-time user I see a clear screen explaining what HealthKit data FitTrack reads and writes, before the system permission sheet.
- I am asked only for the minimum data: read heart rate / steps / active energy / distance, write workouts. Nothing else.
- If I deny everything, the app falls back to manual workout entry. Denial is not a dead-end.
Logging a workout (iPhone)
- From the home screen I tap “+” to log a workout: pick activity type (run/cycle/swim/walk/strength), duration, optional notes, optional photo.
- Workout saves to SwiftData and writes a corresponding HKWorkout to HealthKit (visible in Apple Health).
- If CloudKit sync is delayed, my saved workout is still visible immediately; sync indicator shows pending.
Starting a workout (watchOS)
- From the Watch app I tap an activity type to start a session. Heart rate and distance show live.
- The session runs in the foreground; double-tap on Apple Watch S9+ pauses/resumes.
- Ending the session saves the HKWorkout (with samples) to HealthKit and the FitTrack SwiftData store.
- While a session is active, a Live Activity on the iPhone shows duration + heart rate + a “Stop on Watch” hint.
Dashboard
- The dashboard shows 30-day trend charts for: heart rate (resting + active), steps, active energy, total workouts per week.
- Charts are tappable; tapping a data point opens that day’s detail with the contributing workouts.
- Charts gracefully handle missing days (shown as gaps, not as zero).
Sharing & export
- I can export my last 90 days of workouts as a
.csvvia the share sheet. - I can delete all FitTrack data — workouts and any cached samples — with one explicit two-tap confirmation. This must NOT delete HealthKit data written before (Apple’s rules).
Complications
- The Modular Compact face shows my last workout’s date + activity icon.
- The Smart Stack widget shows today’s active-energy progress vs goal.
Acceptance criteria
- Cold launch to home: < 1.5 s on iPhone 13.
- HealthKit query for 30 days of heart rate samples: < 800 ms end-to-end.
- Watch session start → first heart rate sample on screen: < 5 s.
- Live Activity update interval: 5 s during active workout, never less than the system permits.
- CloudKit sync of a new workout between two devices: < 30 s typical.
- Zero crashes in 100 simulated workouts (CI test).
Non-goals
- No social feed, no follower system, no “shares per workout” — not Strava.
- No GPS route tracking — that’s a third capstone’s worth of work and adds little here.
- No personalized coaching, no ML-derived recommendations.
- No third-party integration (Garmin, Whoop, etc.) — first-party Apple data only.
- No web dashboard.
Constraints
- iOS 17+ (SwiftData + CloudKit, Live Activities, Swift Charts 2.0).
- watchOS 10+ (modern workout session API, Smart Stack widget kind).
- Apple Developer Program — HealthKit capability requires it.
HealthKit privacy contract
The app’s purpose strings must be exact and honest. Drafts:
NSHealthShareUsageDescription: “FitTrack reads your heart rate, steps, distance, and active energy to show trends and power your workout history.”NSHealthUpdateUsageDescription: “FitTrack writes the workouts you log so they appear in Apple Health and contribute to your move ring.”
Apple Review rejects vague strings. Be specific.
Next: Architecture