Skip to Content
Living documentation — last reviewed 2026-05-28
FeaturesBody MetricsBody Metrics

Body Metrics

Status: Shipped. Last reviewed: 2026-05-28

What

Time-series of self-reported and coach-recorded body measurements per member: weight, body fat %, chest / waist / hips / thigh / arm circumference, plus a custom bucket for studio-specific measurements (e.g. forearm, calf). Stored against a membership_id so members who belong to multiple orgs have an isolated history per gym.

Why

  • Members track progress toward weight / composition goals (see ../goals/).
  • Coaches review tendencies during programming.
  • Powers trend charts in the member detail page (member-metrics-tab.tsx).

Personas

PersonaSurfaceCapabilities
MemberMobile + web (/members/me/metrics)Self-report a measurement; view own trend
Coach / admin / ownerMember detail page → Metrics tabRecord on behalf of member; view chart; update / delete entries

Capabilities

  • CreatePOST /organizations/:orgId/members/:membershipId/metrics (coach acting on member) or self-report path.
  • Settingsbody_metric_settings.enabled_metrics (JSONB array) lets a member hide metric types they don’t care about. One row per membership.
  • List + summaryGET /members/:membershipId/metrics (with from, to, type filters); /summary returns latest value per (metric_type, custom_label) bucket with previous-value delta.
  • Update + soft-deletePATCH and DELETE (sets deleted_at).
  • Duplicate-prevention — DB unique on (membership_id, metric_type, recorded_at, COALESCE(custom_label,'')) — one weight per day per bucket.

Capabilities (gaps)

  • No CSV export (general export covered by ../exports-imports/).
  • No automatic backfill from device integrations.
  • Custom labels are free text — no autocomplete or normalization.
  • ../goals/ — body-metric goals resolve their start value via bodyMetrics.
  • ../progress-photos/ — independent timeline; photos can carry an inline bodyweight_kg without inserting a metric row.
  • ../metric-sets/ — separate concept: performance metric definitions for lifts and pace, not body composition.

Source code

  • API: apps/api/src/body-metrics/
  • DB: libs/db/src/lib/schema/body-metrics.ts
  • Shared: libs/shared/src/lib/schemas/body-metric.schema.ts
  • Web: apps/web/src/components/member/body-metrics/, apps/web/src/components/overview/members/member-metrics-tab.tsx