
featured project
nest
AI fitness tracker where the model never touches a number you act on.
Nest is a personal fitness tracker installed to the iPhone home screen as a PWA. An AI reads meal photos, answers questions about your own log, and writes coaching notes, but it is never allowed to set, suggest, or adjust a target. That line is enforced three ways: the structured-output schemas have no field for a target, a guardrail rejects any energy or macro figure the model was not shown, and the MCP tools offer no way to change a goal. The targets themselves come from pure, unit-tested TypeScript, including an adaptive TDEE that re-estimates maintenance from logged intake and the weight trend.
technologies
- next.js
- react
- typescript
- supabase
- openai api
- model context protocol
- zod
- vitest
key highlights
- Numeric guardrail rejects any figure not in the model's context, retries once, then falls back to fixed text
- Adaptive TDEE clamped to ±15% of the formula, at most 5% per update, and never below BMR
- Meal estimates stored as ranges, counted at the bound that keeps the goal honest
- MCP server with 13 tools, OAuth with mandatory PKCE, and an audit log shown in settings
- Offline-first logging through an IndexedDB queue that replays idempotently
- Around 320 tests covering nutrition maths, timezone edges, the guardrail and the OAuth flow
next project
threadroom