Fotologue

Fotologue iOS (iPhone/iPad) Porting Architecture Whitepaper 📄📱

Version: 1.0.17 (Build 18) | Last Updated: September 2026 | Audience: Product Strategy & Core Engineering Team

[!NOTE] High Technical Feasibility: Because Fotologue is built with 100% Kotlin, Jetpack Compose, and Room Database, over 80% of the entire codebase can be shared directly with iOS using Kotlin Multiplatform (KMP) and Compose Multiplatform for iOS.

Executive Summary

Porting Fotologue to iOS (iPhone / iPad) is remarkably straightforward thanks to modern Kotlin Multiplatform (KMP) technologies. The business logic, Room database, 3-Axis Taxonomy, ViewModels, and Compose UI screens can be shared directly between Android and iOS, requiring platform-specific implementations (expect/actual) only for camera hardware feeds, location services, BLE, and PDF rendering.

1. Codebase Shareability Overview (80%+ Code Sharing)

┌─────────────────────────────────────────────────────────────────────────────┐ │ SHARED KOTLIN MULTIPLATFORM CODE (80%+) │ ├─────────────────────────────────────────────────────────────────────────────┤ │ • 100% Compose UI Screens & Design System (`Welcome`, `Timeline`, `Contact`)│ │ • All ViewModels & StateFlows (`AddLogViewModel`, `ContactSheetViewModel`) │ │ • Room KMP Database Entities, DAOs & Schema (`AppDatabase`, `LogEntryDao`) │ │ • DataStore Preferences (`SettingsRepository`) │ │ • Core Mathematics & Metering Logic (`ExposureSuggester`, Calibration) │ │ • XMP Sidecar & JSON/CSV Exporters (`LogEntryXmpExporter`) │ └──────────────────────────────────────┬──────────────────────────────────────┘ │ ┌─────────────────────┴─────────────────────┐ ▼ ▼ ANDROID ACTUALS (20%) iOS ACTUALS (20%) ───────────────────── ───────────────── • CameraX (Live Viewfinder) • AVFoundation (`AVCaptureSession`) • Play Services Location • CoreLocation (`CLLocationManager`) • Android BLE (`android.bluetooth`) • CoreBluetooth (`CBCentralManager`) • Android PDF (`PdfDocument`) • PDFKit / CoreGraphics • Hilt DI • Koin Multiplatform DI

2. Component Migration Breakdown

A. UI Framework: Jetpack Compose → Compose Multiplatform (iOS)

  • Status: 100% Shared.

  • Details: JetBrains' Compose Multiplatform for iOS compiles Compose UI code directly to iOS via Metal graphics acceleration. All screens (TimelineScreen, ContactSheetScreen, GearLibraryScreen, AddLogScreen) run natively on iPhone without rewriting UI layouts.

B. Persistence Layer: Room Database KMP

  • Status: 100% Shared.

  • Details: Google's official androidx.room library supports Kotlin Multiplatform (KMP) for iOS using the SQLite KMP driver. All Room entities, DAOs, migrations, and cross-reference tables run natively on iOS.

C. Dependency Injection: Hilt → Koin

  • Status: Transition from Hilt (Android-only) to Koin.

  • Details: Koin is a pure Kotlin, lightweight multiplatform dependency injection framework that works identically on Android and iOS.

3. Platform-Specific Adapters (Expect / Actual Interfaces)

Only 5 platform-specific hardware adapters need iOS native implementations:

Feature ComponentAndroid ImplementationiOS Native EquivalentKMP Abstraction MethodCamera ViewfinderCameraX (androidx.camera)AVFoundation (AVCaptureSession)expect class CameraManagerGPS LocationPlay Services LocationCoreLocation (CLLocationManager)expect class LocationProviderBluetooth Trigger (v2.0)android.bluetoothCoreBluetooth (CBCentralManager)expect class BleTriggerManagerPDF Proof Sheetsandroid.graphics.pdf.PdfDocumentPDFKit / UIGraphicsPDFRendererexpect class PdfExporterFace DetectionGoogle ML Kit (Android)Apple Vision Framework (VNDetectFaceRectanglesRequest)expect class FaceDetector

  • Apple Vision Framework: iOS has native, built-in face detection in the Apple Vision framework (VNDetectFaceRectanglesRequest). It provides real-time, on-device face detection out of the box with zero third-party dependencies!

4. Xcode & Distribution Pipeline

  1. Project Structure:

    • Add an iosApp target inside the root Fotologue project directory.

    • Xcode builds the iosApp project, linking the shared Kotlin framework generated by KMP.

  2. Distribution:

    • Deploy to Apple TestFlight for iOS beta testing.

    • Publish to the Apple App Store.

5. Summary Recommendation

If an iOS version of Fotologue is desired:

  1. No UI Rewrite Required: You do NOT need to learn Swift or rewrite screens in SwiftUI—Compose Multiplatform runs the existing Compose UI natively on iOS.

  2. Phase 1 Strategy: Refactor Hilt to Koin and isolate the 5 hardware adapters (CameraManager, LocationProvider, BleManager, PdfExporter, FaceDetector) into expect/actual interfaces.

  3. Phase 2 Strategy: Add the iosApp Xcode wrapper and launch on Apple TestFlight.