← Back to docs

FitGenie calorie tracker build plan

Goal

Build a trustworthy, low-friction calorie and nutrient tracker whose logging experience improves as the user builds history. The first release prioritizes nutrition accuracy, repeat logging, home-cooked food, honest uncertainty, and reliable synchronization over unrelated fitness breadth.

“Perfect” is treated as a measurable quality target, not an assertion that food estimation can be exact. Packaged-food values can be precise to their labels; home-cooked, voice, and photo logs must communicate uncertainty and remain easy to correct.

Authoritative tracker design

Changes to tracker behavior must update the relevant design document before implementation when they affect stored data, permissions, nutrition calculations, or a primary user flow.

Product outcomes

The tracker succeeds when users can:

  1. Set a safe, understandable calorie and macro target.
  2. Find and log packaged or whole food quickly.
  3. Repeat a previous meal while changing only today’s quantities.
  4. Save and reuse meals, foods, and household recipes.
  5. Log home-cooked portions in familiar units such as katori and roti.
  6. Use voice, text, or photos as editable assistance rather than automatic truth.
  7. Understand daily and monthly trends without missing data being interpreted as zero intake.
  8. Trust that edits to the food catalog will not rewrite historical totals.

Scope priority

Required for polished tracker beta

Beta candidates after the required flows meet quality gates

Outside this tracker release

Those features can consume tracker data later but must not delay or weaken core logging.

Architecture

Flutter client

Flutter owns presentation, local form state, a small offline queue, cached recent/saved items, and user-controlled correction flows. It uses the Supabase client for authentication and access permitted by RLS.

The client never contains service-role credentials or provider secrets. External responses and local input are validated before entering domain state.

Supabase

Supabase provides:

Canonical catalog tables are never client-writable. Development, staging, and production use separate projects and migration histories.

Node service

A thin Node service provides operations that require secrets, provider calls, or protected computation:

LLM reasoning is isolated to the recipe/meal parsing boundary and receives structured user state, not raw chat history. NLP identifies foods and portions; versioned nutrition data performs calorie calculations. Provider output becomes a validated draft and never directly creates a confirmed log. The standard parser and enhanced AI parser implement the same contract, so AI can be disabled or replaced without changing Flutter or confirmed logs.

Data sources

Start with USDA FoodData Central, Open Food Facts, NIN tables, and in-house household presets. Every imported row records source and release metadata. Validate licensing, redistribution, attribution, update cadence, nutrient units, and actual prepared-dish coverage before production ingestion.

Paid data sources are considered only after measured search/barcode gaps show that free sources are insufficient.

Decisions required before implementation

  1. Initial launch country and catalog coverage.
  2. Initial languages, transliteration needs, and unit defaults.
  3. Exact beta cutoff: required flows only or selected AI candidates.
  4. Supabase organization, region, environments, and billing owner.
  5. Apple team, bundle identifier, and authentication methods.
  6. Nutrition-target formula, safety limits, and disclaimer language.
  7. Media/transcript retention and account-deletion policy.
  8. AI provider budget and per-user usage limits if assisted logging ships.
  9. Whether a nutrition professional will review calculation fixtures and user-facing guidance.

These decisions affect schema, permissions, ingestion, and UX; they are not end-of-project polish.

Delivery sequence

Durations are planning ranges for a focused team, not commitments before stories are estimated.

Phase 0 — Decisions, contracts, and environments

Target: Week 1

Exit criteria: environments are reproducible; migrations run from zero; CI rejects formatting, analysis, test, and migration failures; no privileged secret can enter the client build.

Phase 1 — Catalog foundation and thin vertical slice

Target: Weeks 1–3

Exit criteria: a confirmed log survives catalog version changes; retries cannot duplicate it; another user cannot read it; totals match fixtures.

Phase 2 — Reliable manual tracker

Target: Weeks 3–6

Exit criteria: manual search and barcode paths meet acceptance criteria; offline retry is idempotent; catalog provenance is visible; core flows work with screen readers and dynamic type.

Phase 3 — Reuse and home-cooked food

Target: Weeks 5–8

Exit criteria: users can log a repeated meal materially faster than rebuilding it; original meals remain unchanged; estimated totals expose their ranges and assumptions.

Phase 4 — Assisted logging candidates

Target: Weeks 7–10; include only if core tracker gates remain green

Exit criteria: no provider can directly confirm a log; correction and fallback are always available; accuracy, correction rate, latency, and cost are measured by input type.

Phase 5 — Personalization candidates

Target: Weeks 9–12; driven by real usage data

Exit criteria: suggestions have a minimum evidence threshold, never auto-log, stop after repeated dismissal, and can be disabled independently.

Phase 6 — Public beta hardening

Target: two focused weeks after selected scope is feature-complete

Exit criteria: all UX release gates pass; crash-free and duplicate-log targets are met; support can diagnose failures without accessing unnecessary private meal content.

Testing strategy

Testing is part of every phase rather than a final activity.

Quality measures

Set numerical targets after the first instrumented vertical slice establishes a baseline. At minimum, track:

A speed metric is never considered successful if it increases accidental, duplicate, or unreviewed logs.

Timeline interpretation

A focused four-person team may reach a private beta of the required manual, repeat, saved-meal, and home-cooked flows in roughly 10–14 weeks if design decisions and data licensing are resolved promptly. A two-person team should plan a longer range and reduce parallel work.

Voice, photo, personalization, broad localization, and production catalog depth are scope multipliers. They enter the same beta only when core quality gates remain green; otherwise they follow in measured releases. The timeline must be re-estimated from implementation stories before an external launch date is announced.

Input needed from the product owner

When Decision or asset
Before Phase 0 exits Launch market, languages/units, beta cutoff, project ownership, auth, privacy retention, nutrition formula and safety policy
Before production ingestion Approval of source licenses/attribution and catalog coverage
Before Phase 2 stabilizes Visual direction, icon placeholder, and approval of primary UX flows
Before Phase 3 exits Nutrition review of recipe/yield/retention fixtures
Before Phase 4 starts AI providers, budget, usage limits, evaluation languages, and media retention
Before public TestFlight Apple Developer enrollment, privacy policy, support URL, final icon, screenshots, and App Store privacy answers

Definition of done

A feature is done only when its schema/migration, validation, RLS, errors, loading/empty states, accessibility, analytics, tests, documentation, and rollback behavior are complete. A screen connected to a happy-path API is not done.