YaComí
Food diary · full-stack web app
Your food diary, without the friction. Calories, protein and macros in a few taps: scan the barcode, describe the dish or snap a photo, and get on with your day.
«YaComí» means «I already ate». A personal project I built end to end: product, UX/UI, brand, frontend, backend, database, deployment and documentation. The interface is in Spanish, and the demo opens in guest mode, with no sign-up and a month of sample data.

- 1,064meals migrated from iOS
- 6ways to log a meal
- 4integrated services
- €0a month to run
The problem
I used to log my meals with a native iOS app I built myself in SwiftUI and SwiftData. It only worked on my iPhone, with no sync and no desktop version.
I decided to rebuild it from scratch as a web app and rethink the whole product: I redesigned the sections and added new features instead of copying the iOS app.
Before leaving the old app behind I rescued all its data. I exported the SwiftData database from the iPhone to JSON and CSV and migrated it to the cloud: 79 foods, 1,064 meals and the weight and body measurement history.
The result:
- it works on any phone or computer, fully synced;
- it can be added to the home screen as an app, with its own manifest and icons;
- it costs €0 to run: it only uses free plans (the free Gemini API, the Supabase free plan and Cloudflare Workers).
Six ways to log
Five sections (Today, Diary, Pantry, Progress and Profile) and a central «+» button to add; on a computer, a full side menu. Tap «+» and choose how:
- 1
Pantry
Pick from your saved foods.
- 2
Dishes and recipes
A saved dish or recipe, with its totals worked out on the spot.
- 3
Repeat
Log again something you ate recently.
- 4
By hand
Enter it yourself.
- 5
With AI
Describe it, for example «a plate of lentils with chorizo and a bit of bread». Gemini splits it into foods with grams and macros, and you adjust each one before saving.
- 6
Scanning
Read the barcode on the pack with the camera.

A reliable scanner
It is designed for Finnish supermarkets, so it searches two places at once and does not trust what it reads at first:
- it looks up every code in parallel in Open Food Facts (worldwide database) and S-kaupat (S-Group supermarkets in Finland), with a time limit;
- it checks the EAN/UPC check digit and tries variants of the code;
- it requires two identical reads before trusting a code;
- it uses the camera at 1920×1080 with zoom and continuous focus to read small codes;
- it discards S-kaupat entries that are placeholders or all zeros, for example when the kJ do not match the kcal.
If no database has the product, you take a photo of the nutrition table or upload a screenshot from another app (for example K-Ruoka, the Kesko/K-Citymarket app, which has no open data) and the AI fills in the values. The product is saved with its code, so next time it shows up instantly.


Technical decisions
No keys in the browser
The Gemini and Hevy keys are secrets of a Cloudflare Worker that acts as an authenticated proxy: every call checks the Supabase session first. The Worker serves the app and a small API: /api/ia, /api/etiqueta, /api/producto/:ean and /api/hevy/*.
Everyone sees only their own data
Supabase (Postgres) with Google sign-in, row-level security (RLS) on every table, new sign-ups closed, a SQL view for the daily summary and versioned SQL migrations.
Swappable data layer
One interface dispatches to Supabase (real user) or to localStorage (guest). That way guest mode reuses every screen without touching them.
History is never rewritten
Each meal keeps a copy of its values per 100 g, so editing a food does not change what you already logged, unless you ask it to.
Free, robust AI
Gemini returns structured JSON. If a model answers 503 or is overloaded, the Worker tries fallback models.
Deploys without broken screens
If, after a new version goes live, the browser asks for an old file, the app reloads itself once (vite:preloadError, with loop protection).
What it does
- Progress: a smoothed weight trend instead of the day-to-day noise, a weekly pace calculated from the scale and from what you eat (balance against maintenance), a target weight with an estimated date and weekly weight and calorie charts.
- Goals for calories (minimum and maximum), protein, carbs and fat, and a diary with each day's totals coloured against the goal.
- Hevy integration, the workout app: your workouts appear next to your food, read only.
- Daily streak, body measurements and an undo button.

Design and brand
Its own brand, made by me: logo, symbol, app icons (maskable too), favicon and social image. The design came from comparing several mock-ups: a light style on cream, with petrol and tangerine.
The interface is built for the thumb: sheets that slide up from the bottom, an icon menu and the «+» button in the middle.
- Petrol#073D37
- Tangerine#FF6500
- Cream#FFF6E8
Guest mode
Guest mode lets anyone try it. The /invitado link gets in with no sign-up and no account:
- It starts with a month of made-up sample data: 20 foods, 30 days of meals, weights, dishes and measurements.
- Everything is stored only in that person's browser (
localStorage) and never touches the server or the real data. - It has «Empezar de cero» (start from scratch) and «Poner datos de ejemplo» (load sample data), with confirmation and an «Deshacer» (undo) button.
- It turns off the AI, the label reader, S-kaupat and Hevy, so the quota is not used up.
- If someone without access signs in with Google, it explains they can come in as a guest.
Two challenges
Safari kept asking for camera permission
On the iPhone, Safari asked for camera permission again every time you changed section. The cause was a WebKit bug (215884) that resets the permission on hash changes. I moved navigation to
history.pushStateand the permission now sticks.Migrating 1,064 meals without them changing day
The iOS app stored dates in UTC, so meals close to midnight could land on the wrong day. During the migration I corrected them to match local midnight in Finland (UTC+2/+3) and cleaned up duplicates along the way.
What it is built with
FrontendReact 19, strict TypeScript, Vite 8 and hand-written CSS, with no component libraryDataSupabase (PostgreSQL) with Google sign-in and row-level securityServerCloudflare Workers with static assets, on its own subdomainScannerbarcode-detector with ZXing compiled to WebAssembly, served by the app itselfIntegrationsGoogle Gemini, Open Food Facts, S-kaupat and HevyToolingoxlint, Wrangler and Git/GitHub with conventional commits in SpanishProduct data from Open Food Facts and S-kaupat. The screenshots use sample data from guest mode.
Back to the portfolio
