Skip to main content

MoGoals

"The Target" — "I know what you're aiming for"

Status: ⚠️ Partial (DB schema only)

MoGoals manages user training goals and target metrics. Currently has database schema but no dedicated API or UI.


Purpose

  • Define training goals (strength, muscle, endurance, weight loss)
  • Set target metrics (target weight, target lifts)
  • Track goal progress over time
  • Inform MoCoach recommendations

Planned Implementation

Code Location (Future)

/lib/mo-self/identity/goals.ts

Key Functions (Planned)

// Get user's current goals
export async function getGoals(userId: string): Promise<UserGoals>

// Set or update goals
export async function setGoals(userId: string, goals: GoalInput): Promise<UserGoals>

// Check goal progress
export async function getGoalProgress(userId: string): Promise<GoalProgress[]>

Data Model

interface UserGoals {
id: string;
userId: string;

// Primary goal
primaryGoal: GoalType;

// Target metrics
targetWeight: number | null; // Body weight goal
targetBodyFat: number | null; // Body fat % goal

// Strength targets (optional)
targetBench: number | null;
targetSquat: number | null;
targetDeadlift: number | null;

// Timeline
targetDate: Date | null;

createdAt: Date;
updatedAt: Date;
}

type GoalType =
| 'build_muscle'
| 'lose_fat'
| 'gain_strength'
| 'improve_endurance'
| 'maintain'
| 'recomp';

Database Table (Exists)

CREATE TABLE user_goals (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID REFERENCES users(id),
primary_goal VARCHAR(50) NOT NULL,
target_weight DECIMAL(5,2),
target_body_fat DECIMAL(4,1),
target_bench DECIMAL(5,2),
target_squat DECIMAL(5,2),
target_deadlift DECIMAL(5,2),
target_date DATE,
created_at TIMESTAMP DEFAULT NOW(),
updated_at TIMESTAMP DEFAULT NOW()
);

Planned API Endpoints

EndpointMethodDescription
/api/goalsGETGet current goals
/api/goalsPOSTSet goals
/api/goalsPATCHUpdate goals
/api/goals/progressGETGet progress toward goals

Integration Points

Will Provide to:

  • MoCoach (training recommendations based on goal)
  • MoSuggest (rep ranges based on goal type)
  • Dashboard (goal progress display)
  • MoReports (goal tracking in reports)

Will Receive from:

  • Onboarding flow (initial goal setting)
  • Profile settings (goal updates)

Goal-Based Training Adjustments

GoalRep RangeRestVolume
Build Muscle8-1260-90sHigh
Gain Strength3-63-5minModerate
Lose Fat12-1530-60sHigh
Endurance15-2030sVery High

Implementation Tasks

  • Create /lib/mo-self/identity/goals.ts
  • Add API endpoints
  • Build goal setting UI in onboarding
  • Add goal progress tracking
  • Integrate with MoCoach recommendations