Week 9 Worklog

Week 9 Objectives:

  • Backend: Build the User Metric module — BodyMetric for recording physical measurements and HealthCalculation for computing BMI, BMR, and TDEE.
  • Frontend: Build HealthDashboardScreen with goal input + calculation, BodyMetricListScreen, BodyMetricFormScreen, and all health visualization chart components.
  • Give users clear, actionable insight into their physical health and calorie targets.

Tasks to be carried out this week:

Day Task Start Date Completion Date Reference Material
2 - Build BodyMetric entity (table body_metric)
  + Fields: user (@ManyToOne), heightCm (Float, min=50), weightKg (Float, min=20), age (Integer, min=10), gender (Gender enum), activityLevel (ActivityLevel enum)
  + BodyMetricController (/api/body-metrics): create, get by user (newest first), get latest, get/update/delete by ID
03/10/2026 03/10/2026
3 - Build HealthCalculation entity (table health_calculation)
  + Fields: user, bodyMetric (optional snapshot FK), bmi, bmr, tdee, goalType (GoalTypes enum)
  + Calculation formulas:
   BMI = weight / (height in m)²
   BMR (Mifflin-St Jeor): Men = 10×w + 6.25×h - 5×age + 5; Women = −5
   TDEE = BMR × activity multiplier
03/11/2026 03/11/2026
3 - Build HealthMetricsController (/api/metrics)
  + POST /calculate — compute & persist BMI/BMR/TDEE from CalculateMetricsRequest
  + GET /user/{userId} (full history), GET /user/{userId}/latest, GET /{id}
03/11/2026 03/11/2026
4 - Build HealthDashboardScreen (Frontend)
  + WheelPicker for height (cm) and weight (kg) selection
  + ActivityLevel dropdown picker
  + Goal type selector: Cutting / Bulking / Maintain / UP_Power
  + On submit: createBodyMetric + calculateMetrics → display HealthResultCard (BMI, BMR, TDEE, Macros)
  + Redirect to Profile if gender/birthdate missing
03/12/2026 03/12/2026
5 - Build health chart components (src/components/health/)
  + BMITrendChart: line chart with time range filter (7d/30d/90d/all) + color-coded BMI zones
  + WeightChart: line chart + optional 7-day moving average + distance to goal weight
  + CalorieEnergyCharts: dual-line BMR + TDEE with mode toggle
  + MacrosDisplay: 3 progress bars (protein/carbs/fat) with grams + % labels
  + HealthResultCard: summary card aggregating all computed values
03/13/2026 03/13/2026
6 - Build BodyMetricListScreen (Frontend)
  + Lists all body metric history with formatted dates
  + WeightChart displayed at top of list
  + Edit (navigate to BodyMetricFormScreen) and delete with ConfirmModal
- Build BodyMetricFormScreen
  + Create or edit: height, weight, activity level, goal type
  + Derives gender + age from authSlice user state
03/14/2026 03/14/2026

Week 9 Achievements:

  • Backend — User Metric module:
    • BodyMetric records persisted with proper validation (height ≥ 50 cm, weight ≥ 20 kg, age ≥ 10).
    • BMR computed correctly using Mifflin-St Jeor equation; TDEE applies activity multipliers (1.2 – 1.9).
    • POST /api/metrics/calculate returns HealthCalculationResponse with BMI, BMR, TDEE, and derived macros (protein/carbs/fat grams for goal type).
    • History endpoints return records sorted by createdAt DESC.
  • Frontend — Health Dashboard:
    • HealthDashboardScreen wheel pickers provide smooth UX for entering height/weight.
    • Results display immediately in HealthResultCard after API response.
    • BMITrendChart color-codes data points: underweight (blue), normal (green), overweight (yellow), obese (red).
    • WeightChart shows moving average trend line when user has ≥ 7 data points.
    • CalorieEnergyCharts allows toggling between BMR-only, TDEE-only, and combined view.
    • BodyMetricListScreen shows full measurement history with inline edit/delete.

Next Week Plan:

  • Backend: Add pagination refinements, endpoint validation improvements, and write unit/integration tests for key service methods.
  • Frontend: Build ChatScreen with AWS Bedrock AI chat integration and ProfileScreen with user profile edit and account management.