
Live since May 2026
Health & Fitness · iOS
Loam — type how you feel, get a meditation for it
Every meditation app is a fixed library. At 2am, when the thing keeping you awake is a specific conversation you had at work, none of the tracks are about that. Loam lets you type what’s actually going on and writes and narrates a session for it, in about a minute.
The model was never the interesting part — everything around it was. Design, mobile app, backend, audio pipeline, pricing, App Store review. Live since May 2026.
Case study by Mutlu Can Ateş ·
600+
Guided meditations
77
Programs
188
Soundscapes
21
Breathing techniques
32
Sleep stories
69+
Hours of audio






How it’s built
Client
React Native on Expo 55. Reanimated 4 for motion, Skia for the generated certificates, Rive for the breathing guides, react-native-track-player for gapless audio with crossfades.
Edge & API
Cloudflare Workers running Hono, with D1 for relational data, R2 for the audio library, and Drizzle as the ORM. Custom JWT auth, hardened with Apple App Attest so only genuine builds can call the API.
AI
LLM script generation for The Moment, ElevenLabs for speech synthesis, and LiveKit for Sage's realtime voice sessions — streaming audio with barge-in.
Commerce & insight
RevenueCat for subscriptions plus consumable credit packs, PostHog for retention and funnel analysis.
Where the real engineering was
Getting a written, narrated meditation back in about a minute
The Moment takes whatever you type — “I can’t stop thinking about work” — and returns a complete, narrated session. That generation cannot live inside one mobile request: writing, validation, speech synthesis and upload can outlast a foreground connection, and a retry must not charge twice. I moved the pipeline into a Cloudflare Queue, publish real phase updates to the app, resume pending jobs after a disconnect and use idempotent claims so only one consumer owns a generation. Failed jobs retry and ultimately refund the credit; every script is validated before audio is synthesized. The wait reads as the first part of the practice instead of a spinner.
Protecting an AI backend without trusting the mobile client
A public iOS app exposes every endpoint it calls, and a stolen token should not be enough to spend model credits, reach private audio or delete an account. I built an install-bound trust layer with Apple App Attest: a genuine build completes a hardware-backed ceremony once, then signs every Worker request over its method, path, timestamp and body. The first design used Secure Enclave assertions per request; concurrent calls arrived out of order and looked like replay attacks, causing production rejections and re-attestation floods. I redesigned it around one-time attestation plus HMAC request signing, preserving the security boundary without the counter race.
Scaling 600+ sessions without letting AI invent the science
Loam's catalog spans 77 programs and more than 69 hours of audio, including anxiety, grief, ADHD and sleep. I built a content pipeline that starts with primary research and approved-claims dossiers, generates structured scripts, checks every health claim and required safety line, then synthesizes and publishes the audio. Programs that touch crisis, medication or clinical care fail review if the right boundary or handoff is missing. The result is a repeatable, auditable system rather than 600 prompts and a hope that the model behaves.