Skip to content

feat(routes-f): macro nutrient calculator (calories carbs protein fat) #733

@davedumto

Description

@davedumto

Summary

Add a macro calculator at app/api/routes-f/macro-nutrients/route.ts. Calculate daily macros from goals and activity.

Requirements

  • POST body { weight_kg, height_cm, age, sex: male|female, activity_level: sedentary|light|moderate|active|very_active, goal: lose|maintain|gain }
  • Return { bmr, tdee, target_calories, macros: { protein_g, carbs_g, fat_g }, water_ml }
  • Use Mifflin-St Jeor for BMR
  • Activity multipliers: 1.2-1.9
  • Goal adjustments: -500 lose, +500 gain
  • Standard split: 30% protein, 40% carbs, 30% fat
  • Include disclaimer (general guidance, not medical advice)
  • Tests: each sex, each activity, each goal

Scope Constraint - READ BEFORE STARTING

All files for this task must live inside app/api/routes-f/. This includes the route handler, helpers/utilities, types, and tests. Do NOT modify, import from, or add files to lib/, utils/, types/, components/, or anywhere else outside app/api/routes-f/. If you need shared logic, duplicate it inside your subfolder. Keeping everything scoped to this folder is intentional - it keeps these tasks independent and mergeable in any order.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions