Skip to main content

MO:SELF - Foundation Domain

"The Memory" — "I remember everything about you"

MO:SELF is the foundation layer that stores user identity, preferences, and history. All other domains reference MO:SELF to understand context.


Verticals

VerticalPurposeSystemsStatus
MoIdentityUser authentication & profile32/3 built
MoPrefsUser preferences & settings32/3 built
MoHistoryRecords, streaks, achievements32/3 built

Domain Data Model

interface MoSelfContext {
identity: {
userId: string;
profile: UserProfile;
goals: UserGoals;
};
preferences: {
equipment: EquipmentLevel;
settings: AppSettings;
};
history: {
records: PersonalRecord[];
streaks: StreakData;
achievements: Achievement[];
};
}

Domain Interface

interface MoSelfInterface {
// Get user context
getContext(): Promise<MoSelfContext>;

// Profile
getProfile(): Promise<UserProfile>;
updateProfile(data: Partial<UserProfile>): Promise<void>;

// Preferences
getPreferences(): Promise<UserPreferences>;
getEquipment(): Promise<EquipmentLevel>;

// History
getPersonalRecords(exerciseId?: string): Promise<PersonalRecord[]>;
getStreak(): Promise<StreakData>;
}

Code Organization

/lib/mo-self
├── /identity
│ └── auth.ts → MoAuth
├── /preferences
│ └── settings.ts → MoSettings
├── /history
│ ├── streaks.ts → MoStreaks
│ └── records.ts → MoRecords
└── index.ts → Domain exports

Import Pattern

import {
getCurrentUser, // MoAuth
getPreferences, // MoSettings
getStreak, // MoStreaks
checkAndRecordPR // MoRecords
} from '@/lib/mo-self';

API Endpoints

EndpointMethodSystem
/api/preferencesGET/PATCHMoSettings
/api/streaksGETMoStreaks
/api/recordsGETMoRecords

Status

MetricValue
Verticals3/3
Systems Built6/9 (67%)
API Endpoints3