Back to Selected Work

Engineering Case Study · Kotlin Multiplatform Application

Affirmi

Cross-platform daily personalization engine built with Kotlin Multiplatform, Compose Multiplatform, and local preference modeling across Android, iOS, and Web.

Kotlin MultiplatformCompose MultiplatformKotlinCoroutines & FlowFirebaseLocal Preference Engine
Affirmi dashboard with daily affirmation, progress, and mood summary
Affirmi daily affirmations experience and audio reflection
Affirmi mood history, trends, and preference insights

Overview

A cross-platform personalization application engineered with Kotlin Multiplatform (KMP) and Compose Multiplatform to share 100% of state modeling and preference algorithms across Android, iOS, and Web (affirmi.tech). Features dynamic preference weighting calculated from mood check-in telemetry with deterministic offline fallback guarantees.

My Role

Lead Mobile Engineer responsible for Kotlin Multiplatform architecture, Compose Multiplatform shared UI, and local preference weighting models.

The Problem

Maintaining separate native codebases for client-side sentiment analysis and daily affirmation scheduling introduced state drift between iOS and Android. Additionally, network instability during daily morning rituals caused empty dashboard states when cloud generation endpoints stalled.

The Solution

Unified Android and iOS targets using Kotlin Multiplatform and Compose Multiplatform, consolidating business logic, state machines, and declarative UI into a single codebase. Engineered a local-first recommendation engine that computes daily content weights on-device, backed by local key-value persistence to guarantee instant renders in zero-connectivity states.

Architectural reasoning

By executing preference ranking inside a shared KMP Kotlin Coroutine pipeline rather than depending on a remote inference API, content selection happens with zero network roundtrips (<10ms). Remote synchronization occurs asynchronously in the background, treating the cloud as an optional enhancement rather than a runtime dependency.

Technical Decisions

  • Adopted Kotlin Multiplatform and Compose Multiplatform to share 95%+ of UI and business logic across Android and iOS targets
  • Engineered a local preference model that calculates daily affirmation weightings based on historical mood check-in velocity
  • Structured unidirectional data flow with Kotlin StateFlow, guaranteeing deterministic UI state transitions across platform boundaries
  • Built resilient offline fallback layers with pre-cached emergency affirmation decks, eliminating cold-start blank screens

Architecture

  • Kotlin Multiplatform (KMP) Shared Core
  • Compose Multiplatform Declarative UI
  • Kotlin Coroutines & StateFlow State Machines
  • Local-First Preference Weighting Engine
  • Firebase Cloud Functions & Auth Integration

Engineering Highlights

  • 100% shared business logic and Compose Multiplatform UI across mobile targets
  • Sub-10ms on-device preference ranking with zero remote network blocking
  • Deterministic offline mode with local preference cache continuity
  • Graceful telemetry synchronization with idempotent event queues

Results & Impact

  • Shipped to production on Google Play and Web with unified KMP architecture
  • Achieved 100% offline availability for morning affirmation rituals regardless of connectivity

NEXT STEP

Need similar architectural rigor on your mobile stack?

Whether you are untangling legacy state, building offline-first sync, or shipping a greenfield Android / KMP / Flutter product—let's talk.