The diary itself is easy: foods with calories and macros, meals, daily totals against goals, a weight chart. An agent builds that in one sitting. The weekend goes on what fills the diary. Open Food Facts and USDA FoodData Central give free barcode and generic food lookups, but brand and restaurant coverage is patchier than MyFitnessPal's, and some entries are wrong. Scanning from a phone camera needs HTTPS and a web app, and watch and scale sync (Apple Health, Garmin, Fitbit) is another project. If you log mostly home cooking, a build can replace it; if you eat out, you will miss the database.
Before you buildMyFitnessPal's free tier still tracks nutrition, weight and exercise, and OpenNutriTracker is a free app on both phone platforms. Build only if you want your own data store.
Build me a personal calorie and macro diary to replace MyFitnessPal Premium. Requirements: - Node.js 22 + TypeScript: Fastify serving a mobile-first installable web app (web manifest plus service worker). `npm start` serves http://localhost:4860. A phone camera needs HTTPS, so the README covers a Tailscale or Caddy setup. - Storage: better-sqlite3 in ./data/diary.db with foods (per 100 g plus named servings), custom foods and recipes, diary entries (date, meal, food, grams), weight entries, exercise entries and daily goals. - Food search order: your own foods, then Open Food Facts (https://world.openfoodfacts.org/api/v2, send a descriptive User-Agent), then USDA FoodData Central (USDA_API_KEY in .env). Cache every result locally so repeat lookups work offline. - Barcode scan: `@zxing/browser` reads the barcode through the phone camera and looks it up in Open Food Facts; if the product is missing, open an add-custom-food form pre-filled with the code. - Diary: a day view with breakfast, lunch, dinner and snacks; calories, protein, carbs and fat against goals; a different goal per weekday; a net-carbs toggle (carbs minus fibre and sugar alcohols); copy yesterday or a past meal; quick-add calories and macros with no food. - Trends: weight with a 7-day moving average, and weekly calorie and macro averages. - Import and export: import a MyFitnessPal "Your Nutrition" CSV by mapping whatever columns it has; export the whole diary as CSV and JSON. - Single user with one password in .env (signed cookie). No accounts, no telemetry, local-first; outbound calls are food lookups only. - Out of scope: voice logging, meal photos, social features, wearable sync, meal plans. - README: Open Food Facts coverage differs by country and some entries are wrong, so keep the custom-food form handy.
Opens your agent with the prompt filled in, you press enter. Or copy it and paste it into an empty folder.
The first prompt builds the core. Run these one at a time in the same folder to grow it into your own MyFitnessPal Premium.
Extend the calorie diary in this folder. Requirements: - A recipe editor: ingredients with grams, number of servings, and cooked weight; per-serving and per-100 g nutrition computed from the ingredients. - Logging a recipe adds one entry by servings or by grams of the finished dish. - Editing a recipe must not change past diary entries; store a snapshot of the nutrition on each entry. - Tests for the arithmetic, including a dish that loses weight when cooked. - Update the README.
Add weight import to the calorie diary in this folder. Requirements: - Accept an Apple Health export.zip (parse only body mass records with a streaming XML parser) and a Garmin weight CSV, and merge them into the weight table by date and source. - Show a preview with the number of new, duplicate and conflicting rows before saving. - Never overwrite a weight I typed by hand. - Update the README with how to export from each app.
Add a weekly report to the calorie diary in this folder. Requirements: - `npm run report` sends an HTML email through SMTP settings in .env with average calories and macros against goals, days logged, weight change and the five most-logged foods. - Mark days with fewer than two logged meals as incomplete and leave them out of the averages. - Include a cron example for Sunday evening. - Update the README.
People pay to log a meal in seconds: scan the barcode, pick a restaurant item someone else already entered, and have steps and workouts arrive from a watch. Years of diary history and the daily habit are the lock-in, and the free tier keeps nudging them toward the paid features.
Estimate · Free on a home machine with Tailscale, or a $5 VPS; USDA and Open Food Facts are free. The build is token usage on your agent plan.
Checked 2026-10-19 against MyFitnessPal Premium's docs: 1, 2, 3
| Plan | Monthly | Annual, per month | What you get |
|---|---|---|---|
| Free | $0 | $0 | Nutrition and weight tracking, exercise tracking. Ads in the app. |
| Premium | $19.99 | $6.67 | Barcode and meal scan, voice log, macro tracking in grams or percent with custom goals, net carbs mode, quick-log of macros, multi-day logging, intermittent fasting, food insights and comparison, ad-free, data export. |
| Premium+ | custom | — | Everything in Premium plus personalized meal plans, grocery delivery integration and 1,500+ recipes, per the App Store description. |
Free covers nutrition and weight tracking and exercise tracking, with ads.
Kinda. The core is a weekend build with the prompt on this page, but real gaps remain: MyFitnessPal's crowd-built food database, restaurant and brand items included, Sync with Apple Watch, Fitbit, Garmin, Samsung Health, Google Fit and more than 35 other apps and devices.
About $19.99 a month on the Premium plan, $239.88 a year (checked 2026-10-19).
MyFitnessPal's crowd-built food database, restaurant and brand items included; Sync with Apple Watch, Fitbit, Garmin, Samsung Health, Google Fit and more than 35 other apps and devices; Voice logging and meal scan; A native phone app with a fast barcode scanner; Premium+ meal plans, recipes and grocery delivery. If any of those matter to you, keep paying.
Yes: OpenNutriTracker (open source), Waistline (open source), wger (open source).