Case study · Wellness

Felt

An AI journaling and wellbeing app on the App Store, rated 4.4 stars. I rebuilt it from scratch, A/B tested it against the old version, and worked on the parts that let an app with no accounts safely run a paid AI: App Attest identity, server-owned credits and streamed chat.

Role
iOS Engineer, part-time contract
When
May 2024 to Jun 2026
Stack
Swift · SwiftUI · SQLite · Firebase · RevenueCat · Azure
Result
Full rewrite, A/B tested · 4.4★ on the App Store
Overview

No accounts, a paid AI, and content that works offline

Felt is an AI journaling and wellbeing app on the App Store, rated 4.4 stars. It has swipeable affirmations with themed backgrounds, daily reminders, and an AI companion called Mentora for chatting and journaling, paid for through subscriptions.

I worked on it as a part-time iOS engineer from May 2024 to June 2026. The biggest thing I did was rebuild the current app from scratch. We did not just swap it in: we ran the new version against the old one as an A/B test in Firebase, and only removed the old version once the results said the new one was better.

One constraint shaped everything: nobody has to create an account. Every user is anonymous, and every AI response still costs money that has to be metered and protected from abuse.

The problem

Metering an AI for people you cannot identify

The app had to give an anonymous person personal affirmations and an AI companion, charge per use, and resist API abuse, all without a login screen. In practice that meant four things:

  • Identity without accounts. A device-bound ID, established through Apple App Attest and a Firebase anonymous token. Credits, conversations, goals and the calendar all hang off that ID.
  • A ledger the client cannot fake. AI responses cost real money, so the server has to own the balance.
  • Chat that feels alive. Token-by-token streaming, while the same connection also carries credit updates and other state.
  • Content without a network. Affirmations have to open instantly, even offline.
Architecture

One door for HTTP, one for identity

A SwiftUI app plus a widget extension. Everything past the screen goes through a few services, and everything past the device goes to Azure.

Felt architecture: SwiftUI screens and view models call through repositories and client services (NetworkService, SSEHandler, DeviceAttestationService, and CreditsService) to an Azure Functions backend fronting an OpenAI-compatible LLM, Whisper transcription, and Firebase. IOS APP · SWIFTUI Screens & Views 34 screens · 29 views ViewModels @ObservableObject · 6 VMs Repositories Calendar · Mentora · Theme Local SQLite Store en / es / fr → Documents CLIENT SERVICES · SWIFT NetworkService · APIEndpoint Single HTTP choke point SSEHandler text/event-stream chat parser DeviceAttestationService App Attest · Secure Enclave · Keychain CreditsService · Remote Config Credit metering · runtime config BACKEND · AZURE + FIREBASE Azure Functions API x-functions-key · Traffic Manager LLM (OpenAI-compatible) gpt-4o-mini · Responses API Whisper Transcription POST /api/v1/transcribe Firebase Anonymous auth · Remote Config Swift calls HTTPS / SSE
All requests go through one NetworkService and one APIEndpoint enum. Device attestation and the credits ledger are what make it safe for an account-less app to sit in front of a paid model.

Views never build URLs. They go through view models to repositories and services, and all HTTP goes through one APIEndpoint enum and one NetworkService. There are two deliberate exceptions: chat streaming over SSE has its own handler, and audio upload for transcription is multipart. Affirmation text never touches the network. It ships as bundled SQLite databases, one per language, copied into Documents on first launch. The AI companion keeps its long-term memory in on-device SQLite too, so it remembers context across sessions.

Sending a message to Mentora shows how it fits together. The view model calls the SSE handler with the Firebase token, the device ID from the Keychain, and a pro-status header from RevenueCat. The server streams back text deltas, and the same stream also carries credit balance, gifted credits, emotion state and suggested follow-ups. Running out of credits returns a 403 that goes straight to the paywall.

Decisions

What we chose, and what we paid for it

Rewrite, then prove it with an A/B test

We did not have to trust our own opinion about the new app. Real users decided, through Firebase, before the old version was removed.

What it cost

Two versions to support while the test ran, and the patience to wait for results instead of shipping the rewrite on day one.

Anonymous device identity instead of accounts

No login, onboarding that starts the second the app opens, and a hardware-backed signal against abuse.

What it cost

No cross-device sync and no account recovery. Lose the device or its Keychain, and the history goes with it.

Server-owned credits

The server holds the ledger and the balance arrives on every streamed chunk, so the client never has to guess.

What it cost

Every chat request depends on the backend agreeing with the subscription state, so that reconciliation has to be right.

Configuration from Firebase Remote Config

Base URL, model name, paywall grouping and about thirty other flags change without an App Store release.

What it cost

More moving parts at launch, and every flag needs a safe default inside the app for when Remote Config does not load.

Bundled SQLite for affirmations

Browsing works offline and instantly. The network is only for themes, AI and the rest.

What it cost

New content means a new build, which is fine for content this stable.

Hard parts

Where it pushed back

An attestation retry loop

A temporary network error during App Attest could, in a naive version, cause endless re-registration. The attestation service now looks at the specific error: network or verification failures reuse the stored device ID, and only a missing key or a bad challenge triggers registration again. Parallel calls share one in-flight task instead of each starting their own.

A celebration that fired twice

The server reports gifted credits twice in the same stream: once early and once in the completion event. The first version showed the toast twice for one gift. A small per-stream guard fixed it.

A SwiftUI layout loop

Geometry and preference updates in the calendar and chat screens were reacting to their own output, so layout kept recalculating instead of settling. It is invisible in code review and obvious the moment you watch the frame rate.

Results

What shipped

4.4★
App Store rating
For the version I rebuilt.
A/B
Tested before replacing
The new app ran against the old one in Firebase, and won.
3
Languages
English, Spanish and French, each with its own bundled content database.
Looking back

What I would do first next time

  • One place for auth headers pays off. Past 25 endpoints, having one enum and one service build the token, device ID and pro header was worth it. SSE and multipart upload show where one abstraction stops fitting, and that is fine.
  • On a metered AI product, identity and cost come before UX. Attestation and the credits ledger had to exist before chat could ship at all.
  • Test the risky paths first. Attestation, credit accounting and SSE parsing are where I would put unit tests before anything else. Bugs there turned into same-day fixes more than once.