Unhinged - The Workout Tracker

Messy workouts in. Clean logs out.

Unhinged is a workout tracker for people who train however the day allows: a lift one day, a run or a game of badminton the next. Type or say what you did in your own words. It comes back as structured sets for you to check, and one tap saves it. It runs on Web (Chrome) and native Android, live on Google Play. Every model call goes through Firebase AI Logic: on the device where the device can, in the cloud where it cannot.

Inspiration

We are its first two users, and neither of us follows a programme. Every tracker we tried wanted a plan first, then a number in every box, one set at a time, on a gym floor with one free hand and often no signal. A game of football had no box at all, so it went unlogged.

We are not unusual. In a 2018 Nuffield Health survey of 2,000 UK gym-goers, 55% said they do not know what they are doing at the gym (Nuffield Health). A 2024 review in the Journal of Medical Internet Research found that in most studies it covered, more than half of health-app users had stopped within 100 days, and burdensome data entry is among the reasons it discusses (JMIR 2024). So: say it the way you would text a friend, and let the phone fill in the form.

What it does

  • One line, your words. bench 4x8 @60, laterals 3x15, badminton 1 hr becomes sets and minutes on four lines: Strength, Cardio, Sport and Mobility. Or tap the mic and say it.
  • Guesses are shown, never hidden. A weight you did not type is filled from last time and drawn dashed until you confirm it. Tap anything to fix it.
  • Notes about your body stay on the phone. "Left knee felt twingy" is split off before anything is read, and only the on-device model ever sees it.
  • Off the rails, and it answers back. "Three beers, then 10 push-ups" logs the push-ups, keeps the beers on a grey line that never counts, and replies: "3 beers against 10 reps. Bold strategy."
  • The week as four dials, with a sentence on how it compares with your usual week.
  • Tomorrow's session, written from four weeks of your own counts and stored for the gym with no signal. A sore knee from your notes marks the lifts it touches. It never diagnoses.
  • Bring your own plan from a photo or a PDF, and ask the coach to change it. Nothing changes until you tap Apply.
  • Earlier days and rest days in the same words, kilograms or pounds, and an optional sign-in that syncs phone and web (notes about the body never sync).

How we used Firebase AI Logic

firebase/ai from the Firebase JS SDK on the web; firebase-ai with firebase-ai-ondevice on Android. On the device: Gemini Nano (Chrome's built-in model through the Prompt API, and AICore on Android). In the cloud: gemini-3.5-flash-lite. Four inference modes, one chosen for each feature:

  • PREFER_ON_DEVICE: reading a line, Home's sentence and the reply after saving. These happen between sets, often offline; a device with no model falls back to the cloud.
  • ONLY_ON_DEVICE: notes about the body, enforced in our own code: the app checks the model is there and discards any answer whose inferenceSource is not on-device. That text has no path to the cloud.
  • PREFER_IN_CLOUD: tomorrow's session. The model sees only counts, never your words. It is written while online and stored; when the cloud cannot answer, code writes it from your own log.
  • ONLY_IN_CLOUD: voice, plan import and the coach (audio, an image or a PDF, and a conversation).

Every answer comes back in a JSON schema and is checked in code before you see it. App Check is enforced (reCAPTCHA Enterprise and Play Integrity). Remote Config holds the model, the prompts and each feature's mode, changeable live. Performance Monitoring times every call as on-device, cloud or cache. Settings > Developer details > "Show where each answer was made" labels every answer.

How we built it

Native Kotlin and Jetpack Compose on Android; React, TypeScript and Vite on Firebase Hosting for the web. There is no cross-platform framework, because none has hybrid inference. Both apps are checked against the same 54 test lines on every push. Everything was written during the hackathon, from 18 November 2026; an earlier private prototype of the idea shares no code or design with it.

Challenges we ran into

  • Two prompts at once destroyed Chrome's on-device session, so on-device calls now queue on both platforms.
  • "Only on device" can still reach the cloud in Chrome when the built-in model is missing (firebase-js-sdk issue 10635). That is why notes about the body are guarded in our own code, not by the mode alone.
  • The phone's model writes at most 256 tokens. Long sessions were cut off, so the reader now asks only for the fields each item needs.
  • One of our two phones has no on-device model, which made the cloud fallback a first-class path, not an error.

Accomplishments that we're proud of

  • 51 of 54 test lines read exactly right on the device in Chrome, and 49 of 54 in the cloud.
  • One prompt answered in 587 ms on the device, against 2,285 ms in the cloud on the same Mac.
  • With every request body recorded, no request carried a word of a note about the body.
  • 804 automated tests green in CI, no axe-core accessibility failures on eight screens, and a 499 ms cold start on a phone.
  • Live on Google Play and on the web, with one log across both once you sign in.

What we learned

  • Hybrid is a product decision first: every feature needed its own answer to "what if the device cannot?"
  • "Only on device" has to be enforced by the app, not just requested from the SDK.

What's next

  • People beyond the two of us logging real weeks from the Play listing.
  • Tomorrow's session read aloud, weights said relative to last time, and more languages.

Built With

  • android
  • chrome
  • cloud-firestore
  • firebase
  • firebase-ai-logic
  • firebase-app-check
  • firebase-authentication
  • firebase-hosting
  • firebase-performance-monitoring
  • firebase-remote-config
  • gemini
  • gemini-nano
  • github-actions
  • google-play
  • jetpack-compose
  • kotlin
  • prompt-api
  • react
  • roborazzi
  • typescript
  • vite
  • vitest
Share this project:

Updates