side project
Leer en españolBrinco
A playful health app for iPhone and Apple Watch: recipes, a weekly plan, a shopping list and a step-by-step cook mode, plus calorie and macro tracking with Apple Health.
What it is
I am building Brinco, a playful health app for iPhone and Apple Watch. It covers recipes, a weekly plan, a shopping list and a step-by-step cook mode, plus daily calorie and macro tracking with Apple Health, a quick log on the Watch and home-screen widgets.
Recipes can come from AI ideas, a link, a photo or screenshot, or a look at what is in your fridge. The AI features use your own Anthropic or OpenAI key.
How it's built
Brinco is an iPhone app with an Apple Watch app and widgets, written in SwiftUI. It keeps recipes, the weekly plan, the shopping list, meal logs and weights in SwiftData, synced through your own private iCloud database. The iPhone sends the Watch a small daily payload over WatchConnectivity, and a shared container gives the widgets a snapshot of the day. The AI works with more than one provider using your own key. Burned energy is read from Apple Health on each device and isn’t synced, while weights read from Health are copied into your synced log.
highlights
Recipe import that tries the cheap path first
Importing from a link runs in order: fetch the page, read its schema.org recipe data with a deterministic parser, and use AI only if the page has none or to tidy the ingredients. The parser handles nested data, turns ISO 8601 durations into minutes and guesses timers from step text such as “simmer 20–25 minutes”. Without an API key, recipes from sites that publish this data still import.
Recipe photos: on-device OCR first
For a cookbook page or a screenshot, Vision reads the text on the phone, in English and Spanish. A reading-order pass sorts the lines and splits two-column pages. If there is enough readable text, only the text goes to the model, otherwise the images do. A rule-based splitter can also turn the text into a title, ingredients and steps with no AI at all, and you correct the result in a review sheet.
One AI interface, structured answers, one retry
Every AI feature goes through one provider protocol, with Anthropic and OpenAI behind it. A catalogue maps each job (recipe, link import, food photo, week plan, pantry photo) to a model per provider, so the model isn’t a user setting. Answers come back as structured output; if the first one is unusable, a shared recovery step retries once with a stricter reminder.
Macro estimates checked against real food data
A food photo becomes a dish broken into ingredients with macros per 100 g. Each ingredient is matched against your own foods and a bundled food database, in English or Spanish, and a confident match replaces the model’s numbers. Local sanity rules, like an energy check against the macros, catch made-up values and trigger one re-ask. Barcodes are looked up in Open Food Facts.
CloudKit with a local fallback, and Apple Health on top
The models follow CloudKit’s rules, so the same store syncs when you have iCloud and stays local when you don’t, and if the CloudKit store can’t open, the app opens the same file local-only. HealthKit gives the day’s burned energy with one query per energy type for a whole range, and meals are written back as dietary samples.
A Watch quick log that works without the phone
The Watch lists today’s planned meals, recently cooked recipes and snack presets, and one tap logs a serving. Because the synced store can be empty or slow on the Watch, the phone pushes a compact day payload, and meals logged on the Watch queue for guaranteed delivery through a persistent outbox. Complication updates are only spent on changes the complication actually draws.
- Swift
- SwiftUI
- SwiftData
- CloudKit
- HealthKit
- WatchConnectivity
- WidgetKit
- Vision