BlacktipSV

PT-Kampen 2026

Labs · 2026 · Product design · UX · Frontend

How does a training session stack up against the food I put away, counted in calories?

That’s what I wanted to find out, so I built an app that kept count for me. The reason? I had just signed up for a ten-week training programme, and wanted to keep track daily.

So the solution had to log training sessions, weight & muscle/fat percentage, know what food I had eaten, and then turn all of it into a balance of calories in vs calories out. The training was handled by my Apple Watch Ultra, weight and other bodily things were measured by a Withings scale — but the food? How do you turn “three eggs and a banana” into calories?

The app
The app across ten weeks. The numbers are demo data.

How much is the fish? (as Scooter would have put it)

I started out trying to look up foods in a couple of public databases, but it turned out Swedish foods weren’t well represented in openfoodfacts.org and the like. The Swedish Food Agency was also missing certain specific products — “Lindahls vaniljkvarg”, for instance.

So I made a curated list of what was missing (and that I ate often) on top of the Food Agency’s open data. Specific products (fish, for one) I found on the manufacturers’ own websites.

Barcode scanning is the obvious answer to fast food logging, so I built that too, but with certain products missing it was still quickest to just type free text into the app.

“150 g kalkonfärs, 2 ägg, 3 dl mjölk” — 150 g turkey mince, two eggs, 300 ml milk — becomes three entries with the right units. The parser reads quantity, measure and food out of the sentence and looks up what the household measure weighs.

You write the way you talk.
The question

Am I in deficit today?

That was the whole basic question when I decided to build the app. Being able to see day by day how “things are going” felt like it would spur me on to eat better or train more.

A view that’s always current, if a theoretical one

The app showed theoretical basal metabolism over time; that is: an adult man burns around 2,000 kCal a day. A training session burns more, and then you add what you eat. The sum is either a surplus or a deficit.

Here Friday’s PT session is added: 399 kcal moves the subtotal and the net. The numbers are demo data.

Background

Seven years earlier a spreadsheet did the same job

Eleven columns, one row a day, filled in by hand.

In 2019 I made the same journey as now, and used a Google Sheet back then to punch in workouts, food intake and the rest. The sheet counted correctly, but only when I updated it, and always after the fact. This time I wanted the overview available all the time. And a snazzy app is more fun, isn’t it?

The data

Three sources. Three challenges.

To give myself a running picture of where I stood, I needed to pull in three different kinds of data: how much I had burned per session, what weight, muscle and fat mass I had every time I stepped on the scale, and what I had eaten each day. All of it lived in different places (the food intake, admittedly, lived nowhere at all), and collecting it turned out to be differently hard in each case.

Withings
Withings — the maker of my scale — has an open API, so getting all the values to land in the app was an easy job.
Apple HealthHealth Auto Export
Apple Health was the exact opposite. Sessions are logged on the watch and end up in Apple Health, but Apple doesn’t hand the information out to just anyone. So the data had to take a detour via a third-party app, Health Auto Export, which posted it to a small PHP receiver on my own server and on into the PT-Kampen app. It took an evening to build and has been running (reasonably) ever since.
The food
Logging food intake was something I had to build from scratch, described above.
The tool

Other features

I deliberately kept the interface fairly tight, since I was the only one who would use the app and knew where things were. If I were building it for outside users I’d probably go over accessibility, legibility and the rest.

The overview

The programme day, the sessions and the body on one screen.

1 / 5

So, how did it go?

Well, it went reasonably given the circumstances. I was ill for just under two weeks, plus away on a Home Guard exercise (where you eat ration packs with extreme amounts of calories). Got a lot stronger though, lost six kilos and generally felt better.