# m4ykey/kmp-stos architecture

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

- Interactive diagram: https://gitdiagram.com/m4ykey/kmp-stos
- Repository: https://github.com/m4ykey/kmp-stos

## Overview

Stos is a cross-platform Compose app for browsing StackExchange and Stack Overflow. Users can browse questions and details, search with filters, explore tags and related questions, read comments and answers, and view user and site information. The common app connects presentation and domain features to remote API services; shared paging and Markdown rendering support result lists and readable content. The source index and excerpts show several service and search relationships, but not most presentation-to-domain wiring, so those links are omitted rather than inferred.

Main entry points: [`composeApp/src/jvmMain/kotlin/com/m4ykey/stos/main.kt`](https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/jvmMain/kotlin/com/m4ykey/stos/main.kt) (App entry), [`composeApp/src/commonMain/kotlin/com/m4ykey/stos/app/App.kt`](https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/app/App.kt) (App UI), [`composeApp/src/commonMain/kotlin/com/m4ykey/stos/search/data/network/service/SearchService.kt`](https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/search/data/network/service/SearchService.kt) (Search service), [`composeApp/src/commonMain/kotlin/com/m4ykey/stos/question/data/network/service/QuestionService.kt`](https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/question/data/network/service/QuestionService.kt) (Question services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_app_entry["App entry<br/>[main.kt]"]
  node_app_ui["App UI<br/>[App.kt]"]
  node_navigation["Navigation"]
end

subgraph group_questions["Question browsing"]
  node_question_ui["Question screens"]
  node_question_data["Question services<br/>[QuestionService.kt]"]
  node_question_domain["Question domain<br/>[Question.kt]"]
  node_answer_ui["Answer comments"]
  node_answer_service["Answer service"]
end

subgraph group_discovery["Search and sites"]
  node_search_ui["Search screens"]
  node_search_repo["Search repository"]
  node_search_service["Search service<br/>[SearchService.kt]"]
  node_sites_feature["Site browser"]
end

subgraph group_accounts["Users and comments"]
  node_user_feature["User profiles"]
end

subgraph group_shared["Network and rendering"]
  node_shared_paging["Paging core"]
  node_markdown["Markdown renderer<br/>[TextMarkdown.kt]"]
end

node_reader(("Reader"))
node_stackexchange{{"StackExchange API"}}

node_reader -->|"opens app"| node_app_entry
node_app_entry -->|"starts"| node_app_ui
node_app_ui -.->|"uses"| node_navigation
node_question_data -->|"requests data"| node_stackexchange
node_search_service -->|"searches"| node_stackexchange
node_search_repo -->|"uses"| node_search_service
node_answer_service -.->|"requests comments"| node_stackexchange
node_user_feature -.->|"loads profiles"| node_stackexchange
node_sites_feature -.->|"loads sites"| node_stackexchange

click node_app_entry "https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/jvmMain/kotlin/com/m4ykey/stos/main.kt"
click node_app_ui "https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/app/App.kt"
click node_navigation "https://github.com/m4ykey/kmp-stos/tree/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/app/navigation"
click node_question_ui "https://github.com/m4ykey/kmp-stos/tree/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/question/presentation"
click node_question_data "https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/question/data/network/service/QuestionService.kt"
click node_question_domain "https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/question/domain/model/Question.kt"
click node_answer_ui "https://github.com/m4ykey/kmp-stos/tree/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/answer/presentation"
click node_answer_service "https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/answer/data/network/service/RemoteAnswerService.kt"
click node_search_ui "https://github.com/m4ykey/kmp-stos/tree/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/search/presentation"
click node_search_repo "https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/search/data/repository/RemoteSearchRepository.kt"
click node_search_service "https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/search/data/network/service/SearchService.kt"
click node_sites_feature "https://github.com/m4ykey/kmp-stos/tree/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/sites"
click node_user_feature "https://github.com/m4ykey/kmp-stos/tree/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/user"
click node_shared_paging "https://github.com/m4ykey/kmp-stos/blob/master/core/src/commonMain/kotlin/com/m4ykey/core/paging/BasePagingSource.kt"
click node_markdown "https://github.com/m4ykey/kmp-stos/blob/master/text-markdown/src/commonMain/kotlin/com/m4ykey/markdown/TextMarkdown.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_app_entry,node_app_ui,node_navigation toneBlue
class node_question_ui,node_question_data,node_question_domain,node_answer_ui,node_answer_service toneAmber
class node_search_ui,node_search_repo,node_search_service,node_sites_feature,node_stackexchange toneMint
class node_user_feature toneRose
class node_shared_paging,node_markdown,node_reader toneIndigo
```

## Components

### App and navigation

- [App entry](https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/jvmMain/kotlin/com/m4ykey/stos/main.kt): `composeApp/src/jvmMain/kotlin/com/m4ykey/stos/main.kt`
- [App UI](https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/app/App.kt): `composeApp/src/commonMain/kotlin/com/m4ykey/stos/app/App.kt`
- [Navigation](https://github.com/m4ykey/kmp-stos/tree/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/app/navigation): `composeApp/src/commonMain/kotlin/com/m4ykey/stos/app/navigation`

### Question browsing

- [Question screens](https://github.com/m4ykey/kmp-stos/tree/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/question/presentation): `composeApp/src/commonMain/kotlin/com/m4ykey/stos/question/presentation`
- [Question services](https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/question/data/network/service/QuestionService.kt): `composeApp/src/commonMain/kotlin/com/m4ykey/stos/question/data/network/service/QuestionService.kt`
- [Question domain](https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/question/domain/model/Question.kt): `composeApp/src/commonMain/kotlin/com/m4ykey/stos/question/domain/model/Question.kt`
- [Answer comments](https://github.com/m4ykey/kmp-stos/tree/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/answer/presentation): `composeApp/src/commonMain/kotlin/com/m4ykey/stos/answer/presentation`
- [Answer service](https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/answer/data/network/service/RemoteAnswerService.kt): `composeApp/src/commonMain/kotlin/com/m4ykey/stos/answer/data/network/service/RemoteAnswerService.kt`

### Search and sites

- [Search screens](https://github.com/m4ykey/kmp-stos/tree/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/search/presentation): `composeApp/src/commonMain/kotlin/com/m4ykey/stos/search/presentation`
- [Search repository](https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/search/data/repository/RemoteSearchRepository.kt): `composeApp/src/commonMain/kotlin/com/m4ykey/stos/search/data/repository/RemoteSearchRepository.kt`
- [Search service](https://github.com/m4ykey/kmp-stos/blob/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/search/data/network/service/SearchService.kt): `composeApp/src/commonMain/kotlin/com/m4ykey/stos/search/data/network/service/SearchService.kt`
- [Site browser](https://github.com/m4ykey/kmp-stos/tree/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/sites): `composeApp/src/commonMain/kotlin/com/m4ykey/stos/sites`

### Users and comments

- [User profiles](https://github.com/m4ykey/kmp-stos/tree/master/composeApp/src/commonMain/kotlin/com/m4ykey/stos/user): `composeApp/src/commonMain/kotlin/com/m4ykey/stos/user`

### Network and rendering

- [Paging core](https://github.com/m4ykey/kmp-stos/blob/master/core/src/commonMain/kotlin/com/m4ykey/core/paging/BasePagingSource.kt): `core/src/commonMain/kotlin/com/m4ykey/core/paging/BasePagingSource.kt`
- [Markdown renderer](https://github.com/m4ykey/kmp-stos/blob/master/text-markdown/src/commonMain/kotlin/com/m4ykey/markdown/TextMarkdown.kt): `text-markdown/src/commonMain/kotlin/com/m4ykey/markdown/TextMarkdown.kt`

### Other components

- **Reader**
- **StackExchange API**

## Connections

- Reader → App entry: opens app (evidence: `README.md`)
- App entry → App UI: starts (evidence: `composeApp/src/jvmMain/kotlin/com/m4ykey/stos/main.kt`)
- App UI → Navigation: uses (evidence: `composeApp/src/commonMain/kotlin/com/m4ykey/stos/app/App.kt`)
- Question services → StackExchange API: requests data (evidence: `composeApp/src/commonMain/kotlin/com/m4ykey/stos/question/data/network/service/QuestionService.kt`)
- Search service → StackExchange API: searches (evidence: `composeApp/src/commonMain/kotlin/com/m4ykey/stos/search/data/network/service/SearchService.kt`)
- Search repository → Search service: uses (evidence: `composeApp/src/commonMain/kotlin/com/m4ykey/stos/search/data/repository/RemoteSearchRepository.kt`)
- Answer service → StackExchange API: requests comments
- User profiles → StackExchange API: loads profiles
- Site browser → StackExchange API: loads sites
