TASE Logo
Case study 04 / 20
←All Work
TASE ARCHITECTURE

Zeitra

A heart rate from the phone camera, and 3,264 tests to trust it.

Sector
Consumer health · Mobile-first
Role
Technical founder and lead engineer
Duration
About 4 months
Year
2026
↓Scroll to explore showcase↓
Zeitra
Consumer health · Mobile-first
TASE // 04

●METRICS

By the numbers.

Production telemetry, active capacity, and engineering scale measured in live deployment.

01
0,264
test cases
02
0
mobile routes
03
0
backend services
04
0
data models
05
0
containers in one stack
06
0 mo
build

01 — What it does


What it
actually does.

Zeitra plans nutrition, training and recovery around when a person is actually awake and working. Mainstream health apps assume a stable daytime routine, so their guidance fails nurses, drivers, first responders and anyone on a rotating roster, and it ignores how appetite and energy move across a menstrual cycle. Zeitra treats the schedule as the input rather than the exception.

A conversational coach called Ria turns that schedule into a concrete plan, and the app captures what keeps the plan honest: food by photo, barcode or search, workouts against a large demonstration library, sleep, and heart rate read through the phone camera.

There is no organisation tenancy, so isolation is per user: every request carries a signed token and each service scopes its queries to that token's subject, never to an identifier supplied in the request body. Exactly two paths cross a user boundary, a coach-to-client relation and a revocable read-only cycle share addressed by an opaque code, and both are explicit records rather than implicit trust.

02 — Module surface


28
screens.

Every discrete surface designed, engineered, and shipped in production. Zero placeholder concepts — 100% functional software.

28 OF 28 SURFACES SHIPPED
01SURFACE

Home

02SURFACE

Train

03SURFACE

Meals

04SURFACE

Crew

05SURFACE

Onboarding

06SURFACE

Shifts and rotations

07SURFACE

Circadian schedule

08SURFACE

Analytics

09SURFACE

Exercise library

10SURFACE

Muscle map

11SURFACE

Workout sessions

12SURFACE

Challenges

13SURFACE

Recipes

14SURFACE

Food photo scan

15SURFACE

Barcode scan

16SURFACE

Macros and hydration

17SURFACE

Cycle tracking

18SURFACE

Vitals and heart rate

19SURFACE

Sleep

20SURFACE

Body metrics

21SURFACE

Community feed

22SURFACE

Leaderboards

23SURFACE

Achievements

24SURFACE

Coach marketplace

25SURFACE

Messaging

26SURFACE

AI workout planner

27SURFACE

Connected devices

28SURFACE

Admin

03 — Technical highlight


CORE ARCHITECTURE

A heart rate from the phone camera, and the refusal to answer

The reading sits above a timeline generated for a shift that runs through the night.
The reading sits above a timeline generated for a shift that runs through the night.

The deepest subsystem is camera photoplethysmography. With the torch lit and a fingertip on the lens, frame brightness rises and falls with the blood volume pulse, so the frame stream is a noisy one-dimensional signal whose fundamental frequency is the heart rate. A worklet on the camera thread reduces each frame to a mean luma plus its minimum and maximum; the spread between them decides whether a finger is present at all. Frames that fail that test emit a sentinel rather than a sample.

The estimator then works purely in the sample domain: sample rate from the median gap between timestamps rather than an assumed frame rate, baseline drift removed with a long moving average, sensor noise with a short one, peaks detected above a dynamic threshold under a physiological refractory gap, and the rate taken from the median inter-beat interval. Confidence comes from beat regularity and beat count, and below a floor the function returns no value.

Two decisions make it hold. The estimator imports nothing, not the camera library, not the UI framework, so the whole algorithm runs under the standard test runner with no native mocks. And it refuses to answer: an estimate that quietly returns a plausible number from noise is worse than one that admits it failed, because a fabricated pulse is indistinguishable from a real one to the person holding the phone.

The reading sits above a timeline generated for a shift that runs through the night.
The reading sits above a timeline generated for a shift that runs through the night.

04 — Architecture


SYSTEM TOPOLOGY

How it
runs.

INFRASTRUCTURE RUNTIMEPROD VERIFIED

A single Docker Compose stack runs 19 containers: 16 backend services, the web application, PostgreSQL and Redis. Fifteen services are Node and TypeScript on Fastify, two are Python on FastAPI for the AI pipeline and the circadian engine. An nginx gateway is the only public entry, terminating TLS, applying tiered rate limits with a stricter tier on authentication, and routing by path prefix.

CONSTRAINTS: 4 TOTALZERO COMPROMISE
01 / 04ENFORCED

A database per service, thirteen in total

No service reads another's tables, so a bad migration in one domain cannot corrupt another and any domain can be restored on its own. The boundary between health data and social data is real infrastructure rather than convention.

SPEC CONSTRAINT
02 / 04ENFORCED

Server-to-server routes guarded twice

Routes that move personal data are unresolvable through the public gateway and additionally require a service token inside the process, compared in constant time. An unset token fails closed rather than open.

SPEC CONSTRAINT
03 / 04ENFORCED

One shared policy package

Quota, plan resolution and retention are defined once and imported by every service that enforces them. Duplicating that table per service is how limits drift apart, and drift means the client and the server disagree about entitlement.

SPEC CONSTRAINT
04 / 04ENFORCED

Pure computation modules

The signal estimator, the quota arithmetic and the date logic take every input as a parameter, including the clock. Deterministic, timezone independent and testable without a running service, which is why the test count sits where it does.

SPEC CONSTRAINT
01 OF 04

05 — Integrations


ECOSYSTEM MAP

What it
talks to.

Every third-party API, external boundary, data pipeline, and payment rail hardened and operating in production.

06

GATEWAYS

16+

SERVICES

ZERO UNCHECKED SINKVERIFIED API
  • 01

    Billing

    2 SERVICES
    RevenueCat for store purchasesStripe for web checkout
  • 02

    AI

    2 SERVICES
    Anthropic Claude through LangChain across a quality tier and a latency tierwith an OpenAI-compatible branch
  • 03

    Identity

    3 SERVICES
    Google Sign-InApple Authenticationemail one-time passcodes
  • 04

    Health data

    3 SERVICES
    Health Connect on AndroidHealthKit on iOSBluetooth Low Energy for wearables
  • 05

    Device

    3 SERVICES
    Camera and torch through VisionCamera workletspush notificationsan Android home-screen widget
  • 06

    Content

    3 SERVICES
    An open exercise catalogue with 5341 images and 2192 videos served from a CDN

06 — Problems solved


DIAGNOSTIC LOG & ROOT CAUSE ANALYSIS

What broke,
and how we found it.

Feature lists show what was built. These post-mortems show how obscure edge cases and silent production bugs get diagnosed and permanently resolved.

01 / 03RESOLVED IN PROD

The torch was on. The LED was not.

01 // SYMPTOM

Camera heart rate returned nothing on several Android handsets. The app reported the torch as enabled and no light appeared.

02 // ROOT CAUSE

On certain chipsets the camera library's torch call is silently overridden by the frame output stream. The torch is commanded, the call succeeds, and the LED never energises. Without the flash there is no illuminated blood volume signal, so the estimator correctly reported that it had nothing to measure.

03 // ARCHITECTURAL FIX

Four theories, three discarded against on-device logs. A build-time config plugin now sets flash mode directly on the camera's repeating capture request through the lower-level interop the library already depends on. The staged toggles were deleted rather than kept, because once the light holds steady a flicker is noise injected into the measurement. Verified on device against a real pulse.

02 / 03RESOLVED IN PROD

Valid JSON in the prompt was the reason every reply failed

01 // SYMPTOM

Every message to the AI coach returned a generic connection error. No request was reaching the model.

02 // ROOT CAUSE

The prompt carried an example JSON block written with single braces. The templating layer treats braces as variable placeholders, so the template raised while being constructed, before any request was made. The caller fell back to a friendly stub on any exception, which made it look like a network fault.

03 // ARCHITECTURAL FIX

Literal braces were doubled. Live use then exposed a second failure: the model occasionally mangled the closing marker around its structured block. Rather than instruct the model more firmly, the parser now extracts the first balanced JSON object after the opening marker, quote and escape aware. Prompt instructions are advisory and parsers are not. The mangled output became a test fixture.

03 / 03RESOLVED IN PROD

The webhook parser was too broad, so valid payments looked invalid

01 // SYMPTOM

Store purchases completed and the account stayed on the free tier. The provider's dashboard showed callbacks being delivered and answered with a client error.

02 // ROOT CAUSE

The service registers a raw body parser so signature verification can see the exact bytes, scoped by a substring match on the request path. The store provider's callback path contained the same substring, so its handler received an undecoded buffer where it expected a decoded object. Two correct pieces of code, joined by a match wider than intended.

03 // ARCHITECTURAL FIX

The handler now accepts either a buffer or a decoded object, and the test registers the same raw parser so the buffer path is exercised rather than assumed. Broadening the handler beat narrowing the parser's match, because a tighter match only postpones the same collision until the next path is added.

01 OF 03

07 — The app


NATIVE MOBILE RUNTIME

Screen
by screen.

7 of the 28 surfaces, captured live in native execution.

Home: the last camera heart-rate reading, and tonight's rhythm generated around a shift, not a nine to five.
Home: the last camera heart-rate reading, and tonight's rhythm generated around a shift, not a nine to five.
Exercise detail: a spoken walkthrough from Ria, and the anatomy renderer shading primary and secondary movers.
Exercise detail: a spoken walkthrough from Ria, and the anatomy renderer shading primary and secondary movers.
The exercise catalogue, entered by muscle group.
The exercise catalogue, entered by muscle group.
Ninety-three exercises in one group, each with a demonstration and its equipment.
Ninety-three exercises in one group, each with a demonstration and its equipment.
Meals: macros resolved against a generated target, with Ria's plan on top.
Meals: macros resolved against a generated target, with Ria's plan on top.
Ria's Kitchen: chef-crafted recipes with macros and prep time per dish.
Ria's Kitchen: chef-crafted recipes with macros and prep time per dish.
Challenge plans, with the remaining allowance rendered from the tier the server resolved.
Challenge plans, with the remaining allowance rendered from the tier the server resolved.
01 OF 07

08 — Stack and outcome


CORE TECH TOOLKIT // 24 DEPENDENCIES

Built
with.

Every dependency is chosen deliberately for raw execution speed, strict type safety, zero cold-start latency, and battle-tested reliability under high concurrent load.

  • React Native 0.81
  • Expo 54
  • TypeScript
  • Fastify
  • Node
  • Python
  • FastAPI
  • PostgreSQL
  • Prisma
  • Redis
  • Next.js 16
  • Docker Compose
  • nginx
  • Turborepo
  • Jest
  • pytest
  • LangChain
  • Anthropic Claude
  • RevenueCat
  • Stripe
  • VisionCamera
  • HealthKit
  • Health Connect
  • EAS
// COMMERCIAL & OPERATIONAL OUTCOME
MEASURED IMPACT

"Sixteen services, 118 mobile routes and 3,264 tests in about four months, shipped through EAS to Google Play, with the one measurement that could mislead a user built to say nothing rather than guess."

Status: 100% Operational & Scaled
TASE ARCHITECTURE VERIFIED ✓
NEXT PRODUCTION ENGAGEMENT

Have one
like this?