The itch
For months I believed I was in a calorie deficit. I was eating at maintenance. The tracker said one thing, the scale said another, and I had no way to tell which number to trust. So I built the tracker I would trust: share a food photo from the phone gallery, get calories and macros I can actually check, and see them judged against targets that follow my training and my real metabolism.
How a photo becomes a number
It is a PWA on the phone with a service worker that catches the photo from the Android share sheet, and one Node and TypeScript service behind it that serves both the API and the UI. A fast vision model only does what it is good at: name the items and estimate grams. If a nutrition label is visible, it reads the printed per 100 g values and those are used directly instead of any estimate.
Every item name is normalised into a food key (tokenised, synonyms and plurals folded, words sorted), so "Tandoori Chicken" and "chicken tandoori" are one food. A lookup cascade tries Redis, the store, learned aliases, then a fuzzy match that auto-links at high similarity and asks "Same as...?" in the grey zone. Only foods the app has never seen go to a stronger reasoning model, which breaks the dish into a recipe and derives nutrition per 100 g from IFCT 2017 and USDA sources.
Then comes the part I care about most. Deterministic checks run on that answer: energy must match the macros (4P + 4C + 9F + 2 fibre) within a tolerance, no macro can exceed 100 g per 100 g, and the ingredient calories must add up to the total. A failure goes back to the model with the errors listed. If it still fails, the UI flags the food instead of quietly logging it.
A library that learns
Results are stored per 100 g with their recipe, assumptions and sources, then scaled to the grams logged. Each meal shows where every item came from: Library, New, Check or Yours. Rename an item the same way twice and the correction becomes a permanent alias. The expensive reasoning call is only paid for new foods, so cost falls as the library grows.
Targets that tell the truth
The energy engine starts from Katch-McArdle when body fat is known, Mifflin-St Jeor otherwise, and adds activity from the best signal on hand: Strava or a watch, power, pace, heart rate or a MET table, counting only 85% of wearable estimates. Harder days get more carbs. Then it checks itself: 28 days of logged intake against a smoothed weight trend teach it a correction factor, clamped to plus or minus 25%, so the target reflects the metabolism you actually have. Guardrails keep it honest: never below BMR or a sex floor, deficit capped at 25%, surplus at 15%.
Decisions that shaped it
- The math over the model. One model's confident number is not evidence. Checks and sourced recipes are, so validation sits between the AI and the log.
- Two models, not one. A cheap vision model for the plate, an expensive reasoning model only for new foods.
- Self-hosted first. No auth or billing, so it shipped fast. A hosted mode with sign-in and usage limits exists on a separate branch but is not launched.
- Per-user libraries. No shared food database keeps it private and simple, at the price of each new user paying for staples early on.
- Boring storage. SQLite as the system of record, so a backup is one file. Redis is cache only and the app keeps working if it dies. Couchbase stays optional.
- Cut on purpose. Image embeddings and photo memory (SigLIP, DINO, JEPA) were dropped: the photo just goes to a vision model.
- Kind wording. On a cut, going over target but under maintenance says "Still in deficit", not "failed".
Bugs that taught me things
Browsers cached stale JavaScript, so a new index.html ran against old modules, fixed with no-cache headers and a service worker that bypasses the HTTP cache. Meal thumbnails stored at 128 px looked blurry, so they are now 640 px. The Docker data volume was not writable by the node user. The UI was redesigned twice, then again from a design canvas. It was built and shipped in public over one weekend in November 2026.
Where it stands
Self-hosted only, with no public instance yet. I have not measured accuracy, latency or cost per photo, so I am not quoting any: the interesting claim here is the design, not a benchmark.
Landing pageSource on GitHub
- Built with
- Node, TypeScript, zod, SQLite, Redis, Docker
- AI
- OpenRouter: vision model for plates, reasoning model for new foods
- Data
- IFCT 2017, USDA, Strava
- Features
- Share-sheet logging, label reading, learning food library, adaptive TDEE, trends, export
- Status
- Self-hosted, open source on GitHub