Setup guide
Get your own Fitapp
Six steps, about 15 minutes. Do steps 1 to 3 on a computer, and the rest on your iPhone. Everything you sign up for is free.
- iPhone and Apple Watch
- GitHub account
- Vercel account
- Neon account
Create your database
Your data lives in a free Postgres database on Neon, in your own account.
- Sign up atneon.techand create a project. Call it Fitapp and pick the region closest to you.
- On the project dashboard, click Connect and copy the connection string. It starts with
postgresql://. - Keep it handy. You'll paste it in step 3.
Make your sync key
The Apple Shortcut sends this secret key with your Watch data, so only your iPhone can write to your Fitapp. The key is made in your browser and never leaves it.
Save it somewhere safe, like your password manager. You need it in step 3 and step 5.
Deploy your copy
Vercel copies Fitapp into your GitHub account and runs it for you. On the first deploy it also creates the tables in your database.
- Sign in with GitHub. If you don't have an account yet, you can make one there.
- Click Create to make your copy of the code.
- Fill in the four settings below, then click Deploy.
- DATABASE_URL
- The connection string from Neon (step 1).
- APP_PASSWORD
- A password you choose. You type it once on your phone to log in.
- HEALTH_SYNC_TOKEN
- Your sync key (step 2).
- TIMEZONE
- Your time zone, like
Europe/London. It decides when your day starts.
It takes about two minutes. When it's done, Vercel shows your address, something like
fitapp-yourname.vercel.app. Copy it.Add it to your home screen
- On your iPhone, open your address in Safari. Chrome can't add apps to the home screen.
- Log in with your APP_PASSWORD.
- Tap Share, then Add to Home Screen. Fitapp now opens full screen, like an app.
Add the Apple Shortcut
The Shortcut reads the calories you burned today and yesterday from Apple Health and sends them to your Fitapp. Sending yesterday again fills in the last minutes of the day, and catches up if a night was missed.
- Open the link on your iPhone and tap Add Shortcut.
- It asks two questions: your Fitapp address (like
https://fitapp-yourname.vercel.app, with nothing after.app) and your sync key. - In iPhone Settings, go to Apps → Shortcuts → Advanced and turn on Allow Sharing Large Amounts of Data. A full day has hundreds of Health records, and iOS blocks the sync without this. Fitapp still only receives the totals.
- Open the Shortcuts app and tap Fitapp Sync once. When it asks for Health access, allow Active Energy and Resting Energy.
- It shows
{"ok":true}. Open Fitapp, and your burned calories for today are there.
Sync every night
Last step: make the Shortcut run on its own.
- In the Shortcuts app, open Automation and tap +.
- Choose Time of Day, set it to 23:55 and Daily. That late, it catches almost the whole day.
- Choose Run Immediately, so it doesn't ask you first.
- Pick Fitapp Sync and tap Done.
You can still tap the Shortcut any time during the day to sync right away.
Troubleshooting
Something not working?
The Shortcut says “Unauthorized”
The sync key in the Shortcut doesn't match HEALTH_SYNC_TOKEN in Vercel. Check for a missing character or an extra space. If you change it in Vercel, redeploy (see below).
The Shortcut says it's “trying to share … Health items, which is not allowed”
Turn on Settings → Apps → Shortcuts → Advanced → Allow Sharing Large Amounts of Data (step 5). Fitapp only receives the daily totals, but iOS counts every Health record they're added up from.
The Shortcut never finishes
Check your Fitapp address in the Shortcut. It must end in .vercel.app, with no space, slash or page name like /history after it.
Switching pages is slow
Your app runs far from your database. In Vercel, open your project's Settings → Functions and pick the region closest to the one you chose in Neon (for example Frankfurt for eu-central-1), then redeploy.
Burned calories show 0
The Shortcut can't read your Health data. On your iPhone open Settings → Health → Data Access & Devices → Shortcuts, and turn on Active Energy and Resting Energy. The Watch also only counts while you wear it.
The deploy failed with “isn't a valid time zone”
TIMEZONE has a typo. Fix it in Vercel under Settings → Environment Variables, then redeploy.
I forgot my password
Set a new APP_PASSWORD in Vercel under Settings → Environment Variables, then redeploy.
How do I redeploy?
Vercel only reads changed settings on a new deploy. Open your project in Vercel, go to Deployments, tap ⋯ next to the newest one and choose Redeploy.