# apoorvgupta25/news-shots-kmp architecture

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

- Interactive diagram: https://gitdiagram.com/apoorvgupta25/news-shots-kmp
- Repository: https://github.com/apoorvgupta25/news-shots-kmp

## Overview

NewsshotsKMP is a Kotlin Multiplatform news-reading app with shared Compose UI for Android and iOS. Its apparent user workflow is browsing home/category feeds, opening an article, and searching; the tree also indicates bookmarks and theme preferences. The shared app sets up navigation and reads the current theme, while domain contracts and network implementations cover news retrieval. Several feature and data modules are present only in the tree, so their internal wiring is not asserted here.

Main entry points: [`app/src/commonMain/kotlin/com/apoorvgupta/newsshotskmp/App.kt`](https://github.com/apoorvgupta25/news-shots-kmp/blob/main/app/src/commonMain/kotlin/com/apoorvgupta/newsshotskmp/App.kt) (Shared app), [`androidApp/src/main/java/com/apoorvgupta/newsshotskmp/MainActivity.kt`](https://github.com/apoorvgupta25/news-shots-kmp/blob/main/androidApp/src/main/java/com/apoorvgupta/newsshotskmp/MainActivity.kt) (Android entry), [`iosApp/iosApp/ContentView.swift`](https://github.com/apoorvgupta25/news-shots-kmp/blob/main/iosApp/iosApp/ContentView.swift) (iOS entry), [`app/src/iosMain/kotlin/com/apoorvgupta/newsshotskmp/MainViewController.kt`](https://github.com/apoorvgupta25/news-shots-kmp/blob/main/app/src/iosMain/kotlin/com/apoorvgupta/newsshotskmp/MainViewController.kt) (iOS controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["App entry and shell"]
  node_android["Android entry<br/>[MainActivity.kt]"]
  node_ios["iOS entry<br/>[ContentView.swift]"]
  node_ioscontroller["iOS controller"]
  node_app["Shared app<br/>[App.kt]"]
  node_navigation["Navigation host<br/>[NavigationHost.kt]"]
  node_themeviewmodel["Theme view model<br/>[AppViewModel.kt]"]
end

subgraph group_features["News experiences"]
  node_home["Home feed"]
  node_listing["News listing"]
  node_search["News search"]
  node_details["Article details"]
  node_bookmark["Bookmarks"]
end

subgraph group_domain["Domain contracts"]
  node_newscontracts["News use cases"]
  node_newsrepo["News repository contract<br/>[NewsShotsRepo.kt]"]
end

subgraph group_data["Data and preferences"]
  node_networkusecases["Network use cases"]
  node_newsrepoimpl["News repository"]
  node_remote["Remote news source"]
  node_http["HTTP client"]
  node_themeusecases["Theme use cases"]
  node_themerepo["Theme repository"]
  node_preferences["Platform preferences"]
end

node_reader(("Reader"))

node_reader -->|"opens"| node_android
node_reader -->|"opens"| node_ios
node_android -->|"renders"| node_app
node_ios -->|"hosts"| node_ioscontroller
node_ioscontroller -->|"renders"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"loads theme"| node_themeviewmodel
node_themeusecases -->|"uses"| node_themerepo
node_themerepo -->|"persists theme"| node_preferences
node_networkusecases -->|"calls"| node_newsrepo
node_newsrepoimpl -->|"fetches news"| node_remote
node_remote -->|"uses client"| node_http

click node_android "https://github.com/apoorvgupta25/news-shots-kmp/blob/main/androidApp/src/main/java/com/apoorvgupta/newsshotskmp/MainActivity.kt"
click node_ios "https://github.com/apoorvgupta25/news-shots-kmp/blob/main/iosApp/iosApp/ContentView.swift"
click node_ioscontroller "https://github.com/apoorvgupta25/news-shots-kmp/blob/main/app/src/iosMain/kotlin/com/apoorvgupta/newsshotskmp/MainViewController.kt"
click node_app "https://github.com/apoorvgupta25/news-shots-kmp/blob/main/app/src/commonMain/kotlin/com/apoorvgupta/newsshotskmp/App.kt"
click node_navigation "https://github.com/apoorvgupta25/news-shots-kmp/blob/main/app/src/commonMain/kotlin/com/apoorvgupta/newsshotskmp/ui/NavigationHost.kt"
click node_home "https://github.com/apoorvgupta25/news-shots-kmp/tree/main/feature/home/src/commonMain/kotlin/com/apoorvgupta/home"
click node_listing "https://github.com/apoorvgupta25/news-shots-kmp/tree/main/feature/listing/src/commonMain/kotlin/com/apoorvgupta/newsshotslisting"
click node_search "https://github.com/apoorvgupta25/news-shots-kmp/tree/main/feature/search"
click node_details "https://github.com/apoorvgupta25/news-shots-kmp/tree/main/feature/details/src/commonMain/kotlin/com/apoorvgupta/newsshotsdetails"
click node_bookmark "https://github.com/apoorvgupta25/news-shots-kmp/tree/main/feature/bookmark"
click node_newscontracts "https://github.com/apoorvgupta25/news-shots-kmp/tree/main/domain/src/commonMain/kotlin/com/apoorvgupta/domain/usecase"
click node_newsrepo "https://github.com/apoorvgupta25/news-shots-kmp/blob/main/domain/src/commonMain/kotlin/com/apoorvgupta/domain/repo/NewsShotsRepo.kt"
click node_networkusecases "https://github.com/apoorvgupta25/news-shots-kmp/tree/main/data/network/src/commonMain/kotlin/com/apoorvgupta/network/usecase"
click node_newsrepoimpl "https://github.com/apoorvgupta25/news-shots-kmp/blob/main/data/network/src/commonMain/kotlin/com/apoorvgupta/network/repo/NewsShotsRepoImpl.kt"
click node_remote "https://github.com/apoorvgupta25/news-shots-kmp/tree/main/data/network/src/commonMain/kotlin/com/apoorvgupta/network/datasource"
click node_http "https://github.com/apoorvgupta25/news-shots-kmp/blob/main/data/network/src/commonMain/kotlin/com/apoorvgupta/network/datasource/HttpClientFactory.kt"
click node_themeviewmodel "https://github.com/apoorvgupta25/news-shots-kmp/blob/main/app/src/commonMain/kotlin/com/apoorvgupta/newsshotskmp/AppViewModel.kt"
click node_themeusecases "https://github.com/apoorvgupta25/news-shots-kmp/tree/main/data/datastore/src/commonMain/kotlin/com/apoorvgupta/datastore/usecase"
click node_themerepo "https://github.com/apoorvgupta25/news-shots-kmp/blob/main/data/datastore/src/commonMain/kotlin/com/apoorvgupta/datastore/repo/AppThemeRepoImpl.kt"
click node_preferences "https://github.com/apoorvgupta25/news-shots-kmp/tree/main/data/datastore/src/commonMain/kotlin/com/apoorvgupta/datastore"

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,node_ios,node_ioscontroller,node_app,node_navigation,node_themeviewmodel toneBlue
class node_home,node_listing,node_search,node_details,node_bookmark toneAmber
class node_newscontracts,node_newsrepo toneMint
class node_networkusecases,node_newsrepoimpl,node_remote,node_http,node_themeusecases,node_themerepo,node_preferences toneRose
class node_reader toneIndigo
```

## Components

### App entry and shell

- [Android entry](https://github.com/apoorvgupta25/news-shots-kmp/blob/main/androidApp/src/main/java/com/apoorvgupta/newsshotskmp/MainActivity.kt): `androidApp/src/main/java/com/apoorvgupta/newsshotskmp/MainActivity.kt`
- [iOS entry](https://github.com/apoorvgupta25/news-shots-kmp/blob/main/iosApp/iosApp/ContentView.swift): `iosApp/iosApp/ContentView.swift`
- [iOS controller](https://github.com/apoorvgupta25/news-shots-kmp/blob/main/app/src/iosMain/kotlin/com/apoorvgupta/newsshotskmp/MainViewController.kt): `app/src/iosMain/kotlin/com/apoorvgupta/newsshotskmp/MainViewController.kt`
- [Shared app](https://github.com/apoorvgupta25/news-shots-kmp/blob/main/app/src/commonMain/kotlin/com/apoorvgupta/newsshotskmp/App.kt): `app/src/commonMain/kotlin/com/apoorvgupta/newsshotskmp/App.kt`
- [Navigation host](https://github.com/apoorvgupta25/news-shots-kmp/blob/main/app/src/commonMain/kotlin/com/apoorvgupta/newsshotskmp/ui/NavigationHost.kt): `app/src/commonMain/kotlin/com/apoorvgupta/newsshotskmp/ui/NavigationHost.kt`
- [Theme view model](https://github.com/apoorvgupta25/news-shots-kmp/blob/main/app/src/commonMain/kotlin/com/apoorvgupta/newsshotskmp/AppViewModel.kt): `app/src/commonMain/kotlin/com/apoorvgupta/newsshotskmp/AppViewModel.kt`

### News experiences

- [Home feed](https://github.com/apoorvgupta25/news-shots-kmp/tree/main/feature/home/src/commonMain/kotlin/com/apoorvgupta/home): `feature/home/src/commonMain/kotlin/com/apoorvgupta/home`
- [News listing](https://github.com/apoorvgupta25/news-shots-kmp/tree/main/feature/listing/src/commonMain/kotlin/com/apoorvgupta/newsshotslisting): `feature/listing/src/commonMain/kotlin/com/apoorvgupta/newsshotslisting`
- [News search](https://github.com/apoorvgupta25/news-shots-kmp/tree/main/feature/search): `feature/search`
- [Article details](https://github.com/apoorvgupta25/news-shots-kmp/tree/main/feature/details/src/commonMain/kotlin/com/apoorvgupta/newsshotsdetails): `feature/details/src/commonMain/kotlin/com/apoorvgupta/newsshotsdetails`
- [Bookmarks](https://github.com/apoorvgupta25/news-shots-kmp/tree/main/feature/bookmark): `feature/bookmark`

### Domain contracts

- [News use cases](https://github.com/apoorvgupta25/news-shots-kmp/tree/main/domain/src/commonMain/kotlin/com/apoorvgupta/domain/usecase): `domain/src/commonMain/kotlin/com/apoorvgupta/domain/usecase`
- [News repository contract](https://github.com/apoorvgupta25/news-shots-kmp/blob/main/domain/src/commonMain/kotlin/com/apoorvgupta/domain/repo/NewsShotsRepo.kt): `domain/src/commonMain/kotlin/com/apoorvgupta/domain/repo/NewsShotsRepo.kt`

### Data and preferences

- [Network use cases](https://github.com/apoorvgupta25/news-shots-kmp/tree/main/data/network/src/commonMain/kotlin/com/apoorvgupta/network/usecase): `data/network/src/commonMain/kotlin/com/apoorvgupta/network/usecase`
- [News repository](https://github.com/apoorvgupta25/news-shots-kmp/blob/main/data/network/src/commonMain/kotlin/com/apoorvgupta/network/repo/NewsShotsRepoImpl.kt): `data/network/src/commonMain/kotlin/com/apoorvgupta/network/repo/NewsShotsRepoImpl.kt`
- [Remote news source](https://github.com/apoorvgupta25/news-shots-kmp/tree/main/data/network/src/commonMain/kotlin/com/apoorvgupta/network/datasource): `data/network/src/commonMain/kotlin/com/apoorvgupta/network/datasource`
- [HTTP client](https://github.com/apoorvgupta25/news-shots-kmp/blob/main/data/network/src/commonMain/kotlin/com/apoorvgupta/network/datasource/HttpClientFactory.kt): `data/network/src/commonMain/kotlin/com/apoorvgupta/network/datasource/HttpClientFactory.kt`
- [Theme use cases](https://github.com/apoorvgupta25/news-shots-kmp/tree/main/data/datastore/src/commonMain/kotlin/com/apoorvgupta/datastore/usecase): `data/datastore/src/commonMain/kotlin/com/apoorvgupta/datastore/usecase`
- [Theme repository](https://github.com/apoorvgupta25/news-shots-kmp/blob/main/data/datastore/src/commonMain/kotlin/com/apoorvgupta/datastore/repo/AppThemeRepoImpl.kt): `data/datastore/src/commonMain/kotlin/com/apoorvgupta/datastore/repo/AppThemeRepoImpl.kt`
- [Platform preferences](https://github.com/apoorvgupta25/news-shots-kmp/tree/main/data/datastore/src/commonMain/kotlin/com/apoorvgupta/datastore): `data/datastore/src/commonMain/kotlin/com/apoorvgupta/datastore`

### Other components

- **Reader**

## Connections

- Reader → Android entry: opens
- Reader → iOS entry: opens
- Android entry → Shared app: renders
- iOS entry → iOS controller: hosts
- iOS controller → Shared app: renders
- Shared app → Navigation host: renders
- Shared app → Theme view model: loads theme
- Theme use cases → Theme repository: uses
- Theme repository → Platform preferences: persists theme
- Network use cases → News repository contract: calls
- News repository → Remote news source: fetches news
- Remote news source → HTTP client: uses client
