Skip to main content

MoHistory

"I remember your journey"

MoHistory tracks user achievements, personal records, streaks, and milestones.


Systems

SystemNameStatusDescription
MoRecords"The Historian"✅ BuiltPersonal records, 1RM tracking
MoStreaks"The Motivator"✅ BuiltWorkout consistency tracking
MoBadges"The Trophy Case"❌ FutureAchievements, milestones

Vertical Interface

interface MoHistoryInterface {
// Records
getPersonalRecords(userId: string, exerciseId?: string): Promise<PersonalRecord[]>;
checkAndRecordPR(userId: string, exerciseId: string, weight: number, reps: number): Promise<PRResult>;

// Streaks
getStreak(userId: string): Promise<StreakData>;
updateStreakOnWorkout(userId: string): Promise<StreakData>;

// Badges (future)
getBadges(userId: string): Promise<Badge[]>;
checkBadgeProgress(userId: string): Promise<BadgeProgress[]>;
}

Code Location

/lib/mo-self/history/
├── records.ts → MoRecords
├── streaks.ts → MoStreaks
└── index.ts → Vertical exports

API Endpoints

EndpointMethodSystem
/api/recordsGETMoRecords
/api/streaksGETMoStreaks