How kassomeone/temp-mobile-app works
1. This is a Kotlin Multiplatform + Compose Multiplatform client for the offer.sa insurance domain. The shared codebase contains most of the UI, state, networking, models, and feature logic, while Android and iOS mainly provide app launchers and platform integrations.
2. The top-level runtime is split by platform:
- Android entry points live under composeApp/src/androidMain with MainActivity, MyApplication, manifest, resource XML, and platform-specific helpers.
- iOS entry points live under composeApp/src/iosMain with MainViewController plus the Swift app shell in iosApp.
- Shared Compose UI is hosted inside those native shells.
3. The central architecture in commonMain follows MVVM. Most screens have a dedicated ViewModel, with screen-specific state classes and UI state wrappers. UI events flow from Compose screens to ViewModels, then to repositories or network helpers, and results come back as immutable models/state for rendering.
4. Feature boundaries are organized by business area under presentation/screen and presentation/fragments. Major subsystems include login/signup, onboarding/splash, home/dashboard, profile/settings, quotes, vehicles, drivers, policy holders, purchased policies, orders, tickets, referral, feedback, language selection, biometrics, and payment status. This is the main navigation and business workflow surface of the app.
5. The quote and policy-sale flow is one of the largest subsystems. It spans:
- quote search and list screens,
- client/vehicle/driver data collection,
- image capture and upload,
- billing and invoice review,
- payment form and payment web views,
- policy completion/status screens.
This is the core transactional path in the app.
6. Networking is centralized in commonMain/kotlin/network with Ktor-based HTTP client code, route constants, and a generic API call handler. The app talks to backend APIs through this layer, and the large set of DTOs in commonMain/kotlin/models represents the backend contract.
7. There is a meaningful platform/security boundary around networking. Android has a custom trust manager plus network_security_config.xml and bundled certs in res/raw, suggesting controlled TLS trust for specific environments. iOS has platform-specific networking configuration in configureForPlatform.kt.
8. Several device capabilities are abstracted behind expect/actual APIs so shared code can call them uniformly:
- OTP retrieval
- clipboard copy
- app exit
- kiosk detection
- app-start hooks
- image capture with metadata
- camera handling
- show-toast behavior
These are implemented separately for Android and iOS.
9. The camera subsystem is split into shared and platform code under camera_view. Shared code defines controllers and bitmap conversion, while Android and iOS provide native camera managers. This likely supports identity, vehicle, or document image capture within quote and claims-like workflows.
10. Payment is another explicit cross-platform boundary. Shared code contains payment screens and web view sheets, while Android/iOS provide the concrete navigation/finish behavior for HyperPay. This indicates the payment flow is mediated through native/webview handoff rather than purely shared UI.
11. Local persistence and app context are handled through a small preference layer in preference, with platform-specific context adapters. This is likely used for user session data, language choice, kiosk flags, and other lightweight app settings.
12. The UI layer is built from a reusable component library in presentation/components and presentation/bottom_sheets. It includes dialogs, drawers, sheets, loaders, tabs, pagination, form fields, and toast/loading/error components. Feature screens compose these primitives rather than duplicating them.
13. Resource organization is also split cleanly:
- shared Compose resources hold most icons and SVG-like assets,
- Android keeps platform drawables, string XML, raw certs, and security configs,
- iOS keeps asset catalogs, plist files, and entitlements.
This matters for the diagram because many visual assets are shared, but platform packaging still exists.
14. In short, the diagram should show a shared Compose/MVVM core in the middle, feature screens branching out by domain, Ktor/backend access below that, and thin Android/iOS adapters on the sides for camera, biometrics, payment, OTP, clipboard, startup, and other device-specific behavior.
Main entry points: network Network layer · quotes_screen Quote flow · App.kt App shell · payment_webView Payment UI
Components 21
Shared core
Common Kotlin Multiplatform app logic and UI.
- App shell · Shared Compose app bootstrap and top-level composition.
composeApp/src/commonMain/kotlin/App.kt - UI kit · Reusable dialogs, scaffolds, sheets, loaders, tabs, and other shared UI primitives.
composeApp/src/commonMain/kotlin/presentation/components - State models · Shared UI state wrappers and loading/error/result patterns.
composeApp/src/commonMain/kotlin/presentation/components/UiState.kt - Auth flow · Login, signup, OTP, forgot-password, biometrics, and startup flow screens.
composeApp/src/commonMain/kotlin/presentation/screen/login - Home shell · Home, dashboard, onboarding, splash, language, settings, profile, and related app navigation surfaces.
composeApp/src/commonMain/kotlin/presentation/screen/home_screen - Quote flow · Quote search, customer/vehicle/driver capture, image upload, billing, invoice review, and policy completion.
composeApp/src/commonMain/kotlin/presentation/screen/quotes_screen - Policy ops · Purchased policies, policy holders, vehicles, orders, tickets, referral, feedback, services, and agent-facing screens.
composeApp/src/commonMain/kotlin/presentation/fragments - Payment UI · Shared payment form, payment status, and web view handoff screens.
composeApp/src/commonMain/kotlin/presentation/screen/payment_webView - Network layer · Ktor client, HTTP routes, API handler, and platform-configured networking.
composeApp/src/commonMain/kotlin/network - DTO models · Backend response/request models and UI data models used across features.
composeApp/src/commonMain/kotlin/models - Preferences · Cross-platform preference and context adapters for session and app settings.
composeApp/src/commonMain/kotlin/preference - Camera core · Shared camera controller and bitmap conversion used by image capture flows.
composeApp/src/commonMain/kotlin/camera_view - Device bridge · Shared abstraction for OTP retrieval, clipboard, app exit, kiosk detection, startup hooks, and image capture metadata.
composeApp/src/commonMain/kotlin/expect_actual - Language · Language manager and localized string resources.
composeApp/src/commonMain/kotlin/utils/language
Android
Android runtime, platform integrations, and resources.
- Android app · Android entry activity, application class, manifest, and platform resource packaging.
composeApp/src/androidMain/kotlin/com/offer/sa/MainActivity.kt - Android trust · Android-specific certificate trust manager and network security config for controlled TLS environments.
composeApp/src/androidMain/kotlin/network/AllCertsTrustManager.kt - Android adapters · Android actual implementations for camera, OTP, clipboard, kiosk, app start, toast, biometrics, and HyperPay finish behavior.
composeApp/src/androidMain/kotlin/expect_actual - Android payment · Android payment activity/navigation bridge and web view screen for HyperPay.
composeApp/src/androidMain/kotlin/hyper_pay/startPaymentActivity.kt
iOS
iOS runtime and Swift shell.
- iOS app · iOS MainViewController and Swift app shell that hosts the shared Compose UI.
composeApp/src/iosMain/kotlin/MainViewController.kt - iOS adapters · iOS actual implementations for camera, OTP, clipboard, kiosk, app start, toast, biometrics, and HyperPay finish behavior.
composeApp/src/iosMain/kotlin/expect_actual - iOS payment · iOS payment web view and HyperPay integration boundary.
composeApp/src/iosMain/kotlin/hyper_pay/startPaymentActivity.kt
Connections 28
- App shell → UI kit: composes · Top-level UI is assembled from reusable shared Compose primitives.
- App shell → Auth flow: navigates · Launch and authentication screens are part of the shared app composition.
- App shell → Home shell: navigates · Main app navigation continues into home, profile, settings, and onboarding surfaces.
- Home shell → Quote flow: opens · Business navigation routes from home into the main quote and policy-sale workflow.
- Home shell → Policy ops: opens · Home surfaces business and account management areas.
- Quote flow → Camera core: captures · Quote flow uses the shared camera pipeline for document and vehicle images.
- Quote flow → Payment UI: hands off · Quote completion transitions into payment form, web view, and status screens.
- Quote flow → DTO models: uses · The transaction flow depends on many quote, invoice, vehicle, and policy DTOs.
- Policy ops → DTO models: uses · Operational screens are driven by shared backend contract models.
- Auth flow → Device bridge: uses · Authentication relies on OTP, biometrics, clipboard, kiosk, and startup hooks.
- Payment UI → Device bridge: uses · Payment flow uses platform handoff and webview-related device integration.
- Network layer → DTO models: serializes · HTTP requests and responses are mapped through shared DTOs.
- Auth flow → Network layer: calls · Login, signup, and recovery screens invoke backend APIs through the network layer.
- Quote flow → Network layer: calls · Quote search, customer data, invoice, and policy-sale actions call backend APIs.
- Policy ops → Network layer: calls · Dashboard, tickets, vehicles, policies, and referral screens fetch and mutate backend data.
- Preferences → Auth flow: stores · Session and user preferences are shared across auth and app startup.
- Preferences → Home shell: stores · Language, kiosk, and app settings are read by the main app shell.
- Device bridge → Android adapters: actualized on · Android provides the concrete platform implementations.
- Device bridge → iOS adapters: actualized on · iOS provides the concrete platform implementations.
- Camera core → Android adapters: implemented by · Android supplies the native camera manager and bitmap bridge.
- Camera core → iOS adapters: implemented by · iOS supplies the native camera manager and bitmap bridge.
- Payment UI → Android payment: bridges to · Android hosts the native/webview payment completion path.
- Payment UI → iOS payment: bridges to · iOS hosts the native/webview payment completion path.
- Network layer → Android trust: platform policy · Android networking is hardened with custom trust and security config.
- Network layer → iOS adapters: platform config · iOS applies its own network configuration for the shared client.
- Language → UI kit: renders · Localized text is consumed by shared UI primitives and screens.
- Android app → App shell: hosts · Android launches the shared Compose application.
- iOS app → App shell: hosts · iOS embeds the shared Compose application in the Swift shell.