Feature Guide

Developer & AI Features

Run your own lightweight sync server to keep your macros on infrastructure you control, and plug in your own AI provider for meal descriptions and label parsing. Both are optional and off by default.

Sync across every device.

The sync server keeps a copy of your food log on a computer you control, reachable on your network or anywhere via a Cloudflare tunnel. It's a small Flask app you run yourself, so your data never touches anyone else's infrastructure. Today it is a one-way backup: Macrolog sends your log, recipes, custom foods and targets to the server, and fills in fibre, sugar and sodium values that were added on the server.

Getting started

  • Requires Python 3 and pip.
  • Clone the repo, install the dependencies, and start the server.
  • The server listens on port 5001 by default.
  • Set SYNC_API_KEY to require an API key. Without it, anyone who can reach the server can read your log.
  • Data is saved as JSON files in ~/.claude/garmin-tools/ on the server.
git clone https://github.com/Oliver-Johnson/macro-tracker
cd macro-tracker/sync-server
pip install flask flask-cors
SYNC_API_KEY=choose-a-secret python server.py

Connecting Macrolog

  • Turn on Developer Mode at the bottom of Settings. This shows the Sync Server card.
  • In Settings → Sync Server, enter your server's HTTPS address (see Remote Access below), e.g. https://your-tunnel.trycloudflare.com, and the API key, then tap Save.
  • Tap ⇅ Sync on the Today page whenever you want to send your log to the server. Targets and fibre values are fetched each time the app opens.

Three ways to reach it.

From simplest to most permanent — pick whichever matches how you want to use the server.

1 — LAN only

Connect while on the same Wi-Fi network using the server's local IP address. Macrolog is served over HTTPS, and browsers block it from talking to a plain http:// address, so this only works if you put the server behind HTTPS yourself (for example with a reverse proxy and a certificate). For most setups, a tunnel below is easier.

2 — Cloudflare Quick Tunnel (simplest)

A temporary HTTPS URL, no account required. The URL changes each session, so it's ideal for occasional remote access.

cloudflared tunnel --url http://localhost:5001

3 — Named Cloudflare Tunnel

A permanent HTTPS URL on your own domain. Requires a Cloudflare account and a domain — best for long-term, always-on remote access.

Bring your own AI.

AI features require an API key from one of the supported providers. All processing happens through the API you choose — your key stays on-device and nothing is stored.

Supported providers

  • OpenAI — GPT-4o
  • Anthropic — Claude
  • Google — Gemini

Setting up

  • Go to Settings → AI Features.
  • Enter your API key and select your provider.
  • Tap Save.

What AI can do

  • Describe a meal — tap “Describe” in Log Food and type something like “bowl of oats with blueberries and honey, about 350g”. The AI estimates the macros and logs it directly.
  • Parse a nutrition label — point your camera at a label or paste text. AI extracts the exact macro values and pre-fills the log form.
  • Interpret OCR output — when a barcode lookup fails or a label scan is unclear, AI cleans up garbled OCR text and pulls out the correct numbers.
Tips

Getting the best estimates.

  • Be specific with descriptions — include approximate weights or portions for better estimates.
  • Review AI-estimated macros before saving — treat them as a starting point, not ground truth.
  • API calls use a small amount of tokens; typical daily use costs less than $0.01.