Case Study

Unbuzz: Personal Caffeine Half-Life Modelling

How we built a sleep-safe caffeine tracker that gives every user their own decay curve, grounded in CYP1A2 literature rather than a one-size-fits-all five-hour assumption.

v1.1.0
Latest release
iOS + Watch
Surfaces
92+
Integration tests
Local-first
Architecture
Unbuzz dashboard, live caffeine decay curve, sleep-ready status
Unbuzz Insights, daily caffeine budget and productivity zones
Unbuzz How You Compare, community-percentile health score

The Challenge

Unbuzz needed an answer to a real problem: a generic five-hour caffeine half-life is wrong for most people. Smokers clear it ~50% faster. Pregnant women clear it up to 2× slower. Hormonal contraception roughly doubles the half-life. We had to capture that variation in-app while staying scrupulously away from clinical interpretation.

  • Build a sleep-safe caffeine cut-off engine without making clinical claims
  • Translate population-average half-life science into a per-user model
  • Surface the model's limits transparently so the math doesn't oversell
  • Keep the app fully usable offline, with no auth and no remote calls required
  • Ship a calibrated questionnaire that gates pregnancy questions ethically

Try Unbuzz today

Download the app and see the personalised half-life questionnaire in action.

Our Solution

Six load-bearing pieces. Every one of them serves the disclose-then-personalise philosophy that runs through the app.

Personalised half-life model

A 4–5 step questionnaire (smoking, pregnancy if applicable, oral contraceptive use, self-reported sensitivity) maps to a CYP1A2-literature-grounded coefficient table and produces a personal half-life clamped to a physiologically plausible 3.0–9.0 h range.

Flutter on iOS

Shipped on iOS (with an Apple Watch companion target and a home-screen widget). The codebase is Flutter, so an Android release is one CI pipeline away when the time is right. Pinned to Flutter 3.32.1 so the Dart 3.8.1 dependency graph is reproducible across CI and local dev.

Drift local-first DB

All user data lives in a Drift (SQLite) database on-device. No account is required to use the app; integration tests run against an in-memory drift instance so the test suite never hits a remote service.

Riverpod state + provider plumbing

Reactive state model so the dashboard's decay curve, the half-life bucket label, and the bedtime cut-off recompute together whenever the user nudges their personal value.

Watch + widget surfaces

iOS widget for one-glance caffeine status and an Apple Watch companion app for at-the-wrist logging, both bridged from the same on-device store.

Disclosure-first UX

Every estimate the app makes is reachable through a one-tap 'About this curve' sheet that names the assumption (blood caffeine, not subjective alertness) and links to the slider so the user can override.

Technology Stack

Production stack as shipped in v1.1.0.

FlutterDartiOSwatchOSDrift (SQLite)RiverpodRevenueCatSupabaseWidgetKitGitHub Actions

Got a model the world deserves to feel?

We turn rigorous domain models into apps that ship, without sanding off the science. Tell us what you're building.

Start your project