Skip to main content

MoAPIs

"The Gateway" — "I connect to other services"

Status: ❌ Future

MoAPIs will handle third-party fitness service integrations beyond wearables and health platforms.


Purpose

  • Import workout history from other apps
  • Sync with social fitness platforms
  • Connect nutrition tracking services
  • Enable data portability
  • Extend Mo's capabilities

Planned Integrations

Strava

FeatureDirectionDescription
ActivitiesPushShare Mo workouts
FeedPullSee friend activity
ClubsReadJoin fitness groups

MyFitnessPal

FeatureDirectionDescription
Food LogPullImport nutrition data
WeightPullSync weight entries
MacrosPullGet macro breakdown

Strong App (Import)

FeatureDirectionDescription
Workout HistoryPull (one-time)Import past workouts
Exercise NamesMapMatch to Mo exercises
PRsPullImport personal records

Other Planned

  • Hevy (import)
  • JEFIT (import)
  • Fitbod (import)
  • Cronometer (nutrition)

Data Model

interface ThirdPartyConnection {
id: string;
userId: string;
service: ThirdPartyService;

// OAuth
accessToken: string;
refreshToken: string | null;
tokenExpiresAt: Date | null;

// Sync settings
autoSync: boolean;
syncDirection: 'push' | 'pull' | 'both';

// Status
status: ConnectionStatus;
lastSyncAt: Date | null;

createdAt: Date;
}

interface ImportJob {
id: string;
userId: string;
service: ThirdPartyService;

// Progress
status: ImportStatus;
totalItems: number;
processedItems: number;

// Results
imported: {
workouts: number;
exercises: number;
records: number;
};

errors: ImportError[];

startedAt: Date;
completedAt: Date | null;
}

type ThirdPartyService =
| 'strava'
| 'myfitnesspal'
| 'strong'
| 'hevy'
| 'jefit'
| 'fitbod'
| 'cronometer';

type ImportStatus = 'pending' | 'in_progress' | 'completed' | 'failed';

Import Flow

1. User selects "Import from Strong"
2. Authenticate with Strong (if needed)
3. Fetch workout history
4. Show preview with exercise mapping
5. User confirms mapping corrections
6. Process import in background
7. Show import summary

Exercise Mapping

When importing, map foreign exercises to Mo's exercise library:

interface ExerciseMapping {
foreignName: string; // "Flat Barbell Bench Press"
foreignService: string; // "strong"

moExerciseId: string; // Match to MoExercises
confidence: number; // 0-1 match confidence

userConfirmed: boolean; // User verified mapping
}

// Mapping algorithm
function mapExercise(foreignName: string): ExerciseMatch {
// 1. Exact name match
// 2. Fuzzy name match (Levenshtein)
// 3. Movement pattern match
// 4. Manual mapping required
}

Planned API Endpoints

EndpointMethodDescription
/api/integrationsGETList connections
/api/integrations/connectPOSTOAuth connect
/api/integrations/:id/syncPOSTTrigger sync
/api/integrations/importPOSTStart import job
/api/integrations/import/:idGETCheck import status

Rate Limiting & Quotas

Respect third-party API limits:

ServiceRate LimitStrategy
Strava100/15minQueue + backoff
MyFitnessPal200/hourBatch requests
StrongExport fileOne-time import

Implementation Tasks

  • OAuth flow infrastructure
  • Strava integration
  • Strong CSV import
  • Exercise mapping system
  • Import progress UI
  • Sync settings management