# aviirajsharma/zenki-kmp architecture

> Architecture diagram of the GitHub repository aviirajsharma/zenki-kmp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aviirajsharma/zenki-kmp
- Repository: https://github.com/aviirajsharma/zenki-kmp

## Overview

1. **Repository shape**
   - This is a Kotlin Multiplatform mobile app targeting **Android and iOS**.
   - The architecture is split between thin platform shells (`androidApp`, `iosApp`) and a large shared module (`shared`) that contains most UI, state, data access, and business logic.

2. **Platform entry points**
   - `androidApp/MainActivity.kt` is the Android launch point.
   - `iosApp/iOSApp.swift` and `iosApp/ContentView.swift` are the iOS launch points, with the iOS-specific Kotlin bridge in `shared/src/iosMain/.../MainViewController.kt`.
   - These shells mostly exist to host the shared app UI and provide platform bootstrapping.

3. **Shared UI layer**
   - The main UI is built in **Compose Multiplatform** inside `shared/src/commonMain/kotlin/.../ui`.
   - Core app structure lives in `App.kt`, navigation in `navigation/AppNavigation.kt`, and shared scaffolding in `ui/core` (`AppScaffold`, bottom navigation, snackbar, top-level tabs).
   - The app uses a theme system under `theme/` with explicit support for theme mode toggling.

4. **Feature screens**
   - The screen layer is organized by feature: `home`, `deck`, `card`, `study`, `quiz`, `ai`, and `settings`.
   - This suggests a flashcard/study product with deck management, study and quiz modes, card editing, and AI-assisted generation.
   - `CreateDeckDialog` and the various screens indicate a task-oriented, multi-screen user flow rather than a single-page app.

5. **State and screen logic**
   - Each major screen has a corresponding ViewModel in `ui/viewmodel`.
   - ViewModels mediate between UI and repositories, and likely own screen state, user actions, and data loading.
   - This gives a clear separation between Compose UI rendering and application state orchestration.

6. **Domain/data boundary**
   - Repositories in `data/repository` form the main abstraction between screens/viewmodels and the underlying data sources.
   - There are repositories for decks, flashcards, study sessions, and theme mode.
   - This is the main boundary to diagram: UI/ViewModels call repositories, not databases or services directly.

7. **Local persistence**
   - The local data model is defined under `data/local/entity` with `Deck`, `Flashcard`, `StudySession`, `AppMetadata`, and a derived view model `DeckWithCount`.
   - DAO interfaces under `data/local/dao` define access for each entity type.
   - `DatabaseProvider` exists in common code with platform-specific actual implementations in `androidMain` and `iosMain`, so persistence is shared conceptually but wired per platform.

8. **Remote/AI integration**
   - `data/remote/GroqService.kt` and platform-specific `HttpClientProvider` files indicate a remote API integration, very likely for AI content generation.
   - The `ai` feature screen and `AiGenerateViewModel` connect this remote service into the app flow.
   - In the architecture diagram, this is the main external boundary: shared app → HTTP client → Groq service/API.

9. **Dependency injection / composition root**
   - `di/AppModule.kt` is the shared composition root for wiring repositories, data sources, and services.
   - This is where the app’s object graph is assembled so the UI layer can stay decoupled from concrete implementations.
   - It likely binds the database provider, HTTP client, repositories, and view models together.

10. **Platform-specific implementations**
   - `shared/src/androidMain/...` and `shared/src/iosMain/...` contain the actual platform implementations for things like the database and HTTP client.
   - `Platform.android.kt` and `Platform.ios.kt` provide platform identity/info used by shared code.
   - These source sets are the key boundary where shared abstractions become Android- or iOS-specific code.

11. **Assets and resources**
   - Shared Compose resources live under `shared/src/commonMain/composeResources`.
   - Android has its own resources in `androidApp/src/main/res`, while iOS uses `Assets.xcassets` and `Info.plist`.
   - These are presentation assets rather than business logic, but they matter for the final app packaging on each platform.

12. **Overall data flow**
   - Typical flow is: **screen → viewmodel → repository → local database and/or remote service → repository → viewmodel → screen**.
   - Navigation and scaffolding stay in the shared UI layer, while persistence and network are abstracted behind repository and provider boundaries.
   - The Android/iOS apps are primarily launch/hosting layers around the shared Kotlin logic and UI.

Main entry points: [`shared/src/commonMain/kotlin/com/avirajsharma/zenki/di/AppModule.kt`](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/di/AppModule.kt) (App module), [`shared/src/commonMain/kotlin/com/avirajsharma/zenki/navigation/AppNavigation.kt`](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/navigation/AppNavigation.kt) (Navigation), [`shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/local/DatabaseProvider.kt`](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/local/DatabaseProvider.kt) (Local DB), [`shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/repository/FlashcardRepository.kt`](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/repository/FlashcardRepository.kt) (Card repo)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform shells"]
  node_android_main["Android app<br/>entry shell<br/>[MainActivity.kt]"]
  node_ios_swift["iOS app<br/>entry shell<br/>[iOSApp.swift]"]
  node_ios_content["iOS view<br/>host view<br/>[ContentView.swift]"]
  node_main_controller["Main VC<br/>bridge"]
  node_platform_impl["Platform impls<br/>actuals"]
end

subgraph group_shared["Shared KMP core"]
  node_app_entry["App entry<br/>shared bootstrap<br/>[App.kt]"]
  node_app_module["App module<br/>composition root<br/>[AppModule.kt]"]
end

subgraph group_data["Data layer"]
  node_deck_repo[("Deck repo<br/>[DeckRepository.kt]")]
  node_flashcard_repo[("Card repo")]
  node_study_repo[("Study repo")]
  node_theme_repo[("Theme repo")]
  node_database[("Local DB<br/>platform database")]
  node_daos["DAOs<br/>persistence interfaces<br/>[DeckDao.kt]"]
  node_entities["Entities<br/>data model<br/>[Deck.kt]"]
  node_groq_service{{"Groq API<br/>remote service<br/>[GroqService.kt]"}}
  node_http_client["HTTP client<br/>network provider"]
end

subgraph group_ui["UI layer"]
  node_navigation["Navigation<br/>routing<br/>[AppNavigation.kt]"]
  node_scaffold["App shell<br/>ui shell<br/>[AppScaffold.kt]"]
  node_theme["Theme system<br/>ui theme<br/>[AppTheme.kt]"]
  node_home_screen["Home<br/>feature screen<br/>[HomeScreen.kt]"]
  node_deck_screen["Deck detail<br/>feature screen"]
  node_card_screen["Card editor<br/>feature screen"]
  node_study_screen["Study mode<br/>feature screen<br/>[StudyModeScreen.kt]"]
  node_quiz_screen["Quiz mode<br/>feature screen<br/>[QuizModeScreen.kt]"]
  node_ai_screen["AI generate<br/>feature screen"]
  node_settings_screen["Settings<br/>feature screen<br/>[SettingsScreen.kt]"]
  node_home_vm["Home VM<br/>state orchestrator<br/>[HomeViewModel.kt]"]
  node_deck_vm["Deck VM<br/>state orchestrator"]
  node_study_vm["Study VM<br/>state orchestrator<br/>[StudyViewModel.kt]"]
  node_quiz_vm["Quiz VM<br/>state orchestrator<br/>[QuizViewModel.kt]"]
  node_ai_vm["AI VM<br/>state orchestrator"]
end

node_android_main -->|"hosts"| node_app_entry
node_ios_swift -->|"renders"| node_ios_content
node_ios_content -->|"embeds"| node_main_controller
node_main_controller -->|"hosts"| node_app_entry
node_app_entry -->|"composes"| node_app_module
node_app_entry -->|"starts"| node_navigation
node_navigation -->|"uses"| node_scaffold
node_scaffold -->|"shows"| node_home_screen
node_scaffold -->|"shows"| node_settings_screen
node_navigation -->|"routes"| node_deck_screen
node_navigation -->|"routes"| node_card_screen
node_navigation -->|"routes"| node_study_screen
node_navigation -->|"routes"| node_quiz_screen
node_navigation -->|"routes"| node_ai_screen
node_home_screen -->|"binds"| node_home_vm
node_deck_screen -->|"binds"| node_deck_vm
node_study_screen -->|"binds"| node_study_vm
node_quiz_screen -->|"binds"| node_quiz_vm
node_ai_screen -->|"binds"| node_ai_vm
node_home_vm -->|"reads/writes"| node_deck_repo
node_deck_vm -->|"reads/writes"| node_deck_repo
node_deck_vm -->|"reads/writes"| node_flashcard_repo
node_study_vm -->|"uses"| node_study_repo
node_study_vm -->|"reads"| node_flashcard_repo
node_quiz_vm -->|"reads"| node_flashcard_repo
node_ai_vm -->|"calls"| node_groq_service
node_groq_service -->|"uses"| node_http_client
node_deck_repo -->|"persists"| node_database
node_flashcard_repo -->|"persists"| node_database
node_study_repo -->|"persists"| node_database
node_theme_repo -->|"persists"| node_database
node_database -->|"exposes"| node_daos
node_daos -->|"maps"| node_entities
node_app_module -->|"provides"| node_database
node_app_module -->|"provides"| node_http_client
node_app_module -->|"creates"| node_deck_repo
node_app_module -->|"creates"| node_flashcard_repo
node_app_module -->|"creates"| node_study_repo
node_app_module -->|"creates"| node_theme_repo
node_platform_impl -->|"implements"| node_database

click node_android_main "https://github.com/aviirajsharma/zenki-kmp/blob/main/androidApp/src/main/kotlin/com/avirajsharma/zenki/MainActivity.kt"
click node_ios_swift "https://github.com/aviirajsharma/zenki-kmp/blob/main/iosApp/iosApp/iOSApp.swift"
click node_ios_content "https://github.com/aviirajsharma/zenki-kmp/blob/main/iosApp/iosApp/ContentView.swift"
click node_main_controller "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/iosMain/kotlin/com/avirajsharma/zenki/MainViewController.kt"
click node_app_entry "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/App.kt"
click node_app_module "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/di/AppModule.kt"
click node_navigation "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/navigation/AppNavigation.kt"
click node_scaffold "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/core/AppScaffold.kt"
click node_theme "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/theme/AppTheme.kt"
click node_home_screen "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/home/HomeScreen.kt"
click node_deck_screen "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/deck/DeckDetailScreen.kt"
click node_card_screen "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/card/AddEditCardScreen.kt"
click node_study_screen "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/study/StudyModeScreen.kt"
click node_quiz_screen "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/quiz/QuizModeScreen.kt"
click node_ai_screen "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/ai/AiGenerateScreen.kt"
click node_settings_screen "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/settings/SettingsScreen.kt"
click node_home_vm "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/HomeViewModel.kt"
click node_deck_vm "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/DeckDetailViewModel.kt"
click node_study_vm "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/StudyViewModel.kt"
click node_quiz_vm "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/QuizViewModel.kt"
click node_ai_vm "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/AiGenerateViewModel.kt"
click node_deck_repo "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/repository/DeckRepository.kt"
click node_flashcard_repo "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/repository/FlashcardRepository.kt"
click node_study_repo "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/repository/StudySessionRepository.kt"
click node_theme_repo "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/repository/ThemeModeRepository.kt"
click node_database "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/local/DatabaseProvider.kt"
click node_daos "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/local/dao/DeckDao.kt"
click node_entities "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/local/entity/Deck.kt"
click node_groq_service "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/remote/GroqService.kt"
click node_http_client "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/remote/HttpClientProvider.kt"
click node_platform_impl "https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/androidMain/kotlin/com/avirajsharma/zenki/data/local/DatabaseProvider.android.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_android_main,node_ios_swift,node_ios_content,node_main_controller,node_platform_impl toneBlue
class node_app_entry,node_app_module toneAmber
class node_deck_repo,node_flashcard_repo,node_study_repo,node_theme_repo,node_database,node_daos,node_entities,node_groq_service,node_http_client toneMint
class node_navigation,node_scaffold,node_theme,node_home_screen,node_deck_screen,node_card_screen,node_study_screen,node_quiz_screen,node_ai_screen,node_settings_screen,node_home_vm,node_deck_vm,node_study_vm,node_quiz_vm,node_ai_vm toneRose
```

## Components

### Platform shells

Android and iOS entry points plus platform-specific wiring

- [Android app](https://github.com/aviirajsharma/zenki-kmp/blob/main/androidApp/src/main/kotlin/com/avirajsharma/zenki/MainActivity.kt): entry shell · Android launch activity that hosts the shared app UI · `androidApp/src/main/kotlin/com/avirajsharma/zenki/MainActivity.kt`
- [iOS app](https://github.com/aviirajsharma/zenki-kmp/blob/main/iosApp/iosApp/iOSApp.swift): entry shell · SwiftUI host that launches the shared Kotlin UI · `iosApp/iosApp/iOSApp.swift`
- [iOS view](https://github.com/aviirajsharma/zenki-kmp/blob/main/iosApp/iosApp/ContentView.swift): host view · SwiftUI content view that embeds the shared app controller · `iosApp/iosApp/ContentView.swift`
- [Main VC](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/iosMain/kotlin/com/avirajsharma/zenki/MainViewController.kt): bridge · iOS Kotlin bridge that creates the shared app view controller · `shared/src/iosMain/kotlin/com/avirajsharma/zenki/MainViewController.kt`
- [Platform impls](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/androidMain/kotlin/com/avirajsharma/zenki/data/local/DatabaseProvider.android.kt): actuals · Android and iOS actual implementations for platform services · `shared/src/androidMain/kotlin/com/avirajsharma/zenki/data/local/DatabaseProvider.android.kt`

### Shared KMP core

Common app logic, UI, state, and domain boundaries

- [App entry](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/App.kt): shared bootstrap · Shared application root and top-level composition entry · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/App.kt`
- [App module](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/di/AppModule.kt): composition root · Wires repositories, services, databases, and view models · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/di/AppModule.kt`

### Data layer

Local persistence, remote API access, and repositories

- [Deck repo](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/repository/DeckRepository.kt): repository · Deck data access and deck-level business operations · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/repository/DeckRepository.kt`
- [Card repo](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/repository/FlashcardRepository.kt): repository · Flashcard CRUD and card-oriented data operations · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/repository/FlashcardRepository.kt`
- [Study repo](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/repository/StudySessionRepository.kt): repository · Study session persistence and session history operations · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/repository/StudySessionRepository.kt`
- [Theme repo](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/repository/ThemeModeRepository.kt): repository · Persists and resolves the current theme mode · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/repository/ThemeModeRepository.kt`
- [Local DB](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/local/DatabaseProvider.kt): platform database · Shared database abstraction with platform-specific implementations · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/local/DatabaseProvider.kt`
- [DAOs](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/local/dao/DeckDao.kt): persistence interfaces · Entity access interfaces for decks, cards, sessions, and metadata · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/local/dao/DeckDao.kt`
- [Entities](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/local/entity/Deck.kt): data model · Local storage models for decks, flashcards, sessions, and metadata · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/local/entity/Deck.kt`
- [Groq API](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/remote/GroqService.kt): remote service · Remote AI service used for content generation · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/remote/GroqService.kt`
- [HTTP client](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/remote/HttpClientProvider.kt): network provider · Platform-specific HTTP client wiring for remote calls · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/data/remote/HttpClientProvider.kt`

### UI layer

Compose screens, navigation, theming, and view models

- [Navigation](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/navigation/AppNavigation.kt): routing · Shared screen routing and app-level destination flow · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/navigation/AppNavigation.kt`
- [App shell](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/core/AppScaffold.kt): ui shell · Shared scaffold, bottom navigation, tabs, and snackbar surfaces · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/core/AppScaffold.kt`
- [Theme system](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/theme/AppTheme.kt): ui theme · Shared colors, shapes, typography, and theme mode support · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/theme/AppTheme.kt`
- [Home](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/home/HomeScreen.kt): feature screen · Deck overview and creation entry point · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/home/HomeScreen.kt`
- [Deck detail](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/deck/DeckDetailScreen.kt): feature screen · Deck contents and deck-level interactions · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/deck/DeckDetailScreen.kt`
- [Card editor](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/card/AddEditCardScreen.kt): feature screen · Add and edit flashcards · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/card/AddEditCardScreen.kt`
- [Study mode](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/study/StudyModeScreen.kt): feature screen · Flashcard study session experience · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/study/StudyModeScreen.kt`
- [Quiz mode](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/quiz/QuizModeScreen.kt): feature screen · Quiz-oriented study flow · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/quiz/QuizModeScreen.kt`
- [AI generate](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/ai/AiGenerateScreen.kt): feature screen · AI-assisted card generation workflow · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/ai/AiGenerateScreen.kt`
- [Settings](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/settings/SettingsScreen.kt): feature screen · App preferences and configuration · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/screens/settings/SettingsScreen.kt`
- [Home VM](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/HomeViewModel.kt): state orchestrator · Coordinates home screen state and deck actions · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/HomeViewModel.kt`
- [Deck VM](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/DeckDetailViewModel.kt): state orchestrator · Manages deck detail state and deck operations · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/DeckDetailViewModel.kt`
- [Study VM](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/StudyViewModel.kt): state orchestrator · Coordinates study session state and progress · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/StudyViewModel.kt`
- [Quiz VM](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/QuizViewModel.kt): state orchestrator · Coordinates quiz state and scoring flow · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/QuizViewModel.kt`
- [AI VM](https://github.com/aviirajsharma/zenki-kmp/blob/main/shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/AiGenerateViewModel.kt): state orchestrator · Drives AI generation requests and generated output · `shared/src/commonMain/kotlin/com/avirajsharma/zenki/ui/viewmodel/AiGenerateViewModel.kt`

## Connections

- Android app → App entry: hosts · Android shell launches the shared app
- iOS app → iOS view: renders · Swift app presents the content view
- iOS view → Main VC: embeds · Content view mounts the Kotlin view controller
- Main VC → App entry: hosts · iOS bridge launches the shared app
- App entry → App module: composes · App root resolves dependencies through the composition root
- App entry → Navigation: starts · Shared app enters the navigation flow
- Navigation → App shell: uses · Navigation is presented inside the shared app shell
- App shell → Home: shows · Shell exposes the main home entry
- App shell → Settings: shows · Shell exposes settings as a top-level destination
- Navigation → Deck detail: routes · Navigation reaches deck detail screens
- Navigation → Card editor: routes · Navigation reaches card editing screens
- Navigation → Study mode: routes · Navigation reaches study mode
- Navigation → Quiz mode: routes · Navigation reaches quiz mode
- Navigation → AI generate: routes · Navigation reaches AI generation
- Home → Home VM: binds · Home screen is driven by its view model
- Deck detail → Deck VM: binds · Deck detail screen is driven by its view model
- Study mode → Study VM: binds · Study screen is driven by its view model
- Quiz mode → Quiz VM: binds · Quiz screen is driven by its view model
- AI generate → AI VM: binds · AI screen is driven by its view model
- Home VM → Deck repo: reads/writes · Home state uses deck operations
- Deck VM → Deck repo: reads/writes · Deck detail uses deck operations
- Deck VM → Card repo: reads/writes · Deck detail manages cards through the repository
- Study VM → Study repo: uses · Study flow persists and loads sessions
- Study VM → Card repo: reads · Study flow loads cards for review
- Quiz VM → Card repo: reads · Quiz flow loads cards for questions
- AI VM → Groq API: calls · AI workflow invokes the remote generation service
- Groq API → HTTP client: uses · Remote service is executed over the shared HTTP client
- Deck repo → Local DB: persists · Deck repository uses local storage
- Card repo → Local DB: persists · Card repository uses local storage
- Study repo → Local DB: persists · Study repository uses local storage
- Theme repo → Local DB: persists · Theme repository stores theme mode locally
- Local DB → DAOs: exposes · Database is accessed through DAO interfaces
- DAOs → Entities: maps · DAO contracts operate on local entities
- App module → Local DB: provides · Composition root wires database implementation
- App module → HTTP client: provides · Composition root wires the HTTP client
- App module → Deck repo: creates · Composition root assembles repositories
- App module → Card repo: creates · Composition root assembles repositories
- App module → Study repo: creates · Composition root assembles repositories
- App module → Theme repo: creates · Composition root assembles repositories
- Platform impls → Local DB: implements · Android and iOS source sets provide actual database wiring
