Back to Roadmap

Import from Strava

Import full workout history from a Strava data export. Map Strava activity types to canonical types, preserve GPS routes and heart rate data.

Updated for SYNTHESIS schema

Source identity

  • source = 'strava', Strava activity ID as external_id
  • UNIQUE(athlete_id, source, external_id) prevents duplicate imports

Type mapping

  • Map Strava PascalCase types (Run, Ride, Swim, WeightTraining, Hike, etc.) → canonical slugs (running, cycling, swimming, strength_training, hiking)
  • Preserve original in source_activity_type (e.g., 'strava:VirtualRide')
  • Use activity-types.json mapping table

Stream data → Parquet

  • Strava streams API returns parallel arrays: { time: [...], heartrate: [...], latlng: [...], altitude: [...], velocity_smooth: [...] }
  • Convert to Parquet files, one per stream type, store in S3
  • Metadata rows in activity_streams

Cross-source dedup

  • A Strava import of a run already synced from Apple Watch should detect the duplicate via (start_date ±2min, activity_type, duration ±10%)
  • Use source_priorities to determine which becomes primary

Strava-specific fields

  • Map to activity_statistics: elevation_gain, avg_speed, max_speed, avg_power, weighted_avg_power, suffer_score
  • source_data JSONB preserves the full Strava activity object

Depends on

  • #31 Implement SYNTHESIS Schema
  • #32 Object Storage Setup (S3/R2/MinIO)
  • #3 Sync Infrastructure (for cross-source dedup)

Reference

See docs/api-research/SYNTHESIS.md §3 (Activity Types), §6 (Streams), §11 (Deduplication).

Status
Backlog
Priority
Normal
Platform
API
Date
1 month ago