# rmiguel1985/quitsmoking architecture

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

- Interactive diagram: https://gitdiagram.com/rmiguel1985/quitsmoking
- Repository: https://github.com/rmiguel1985/quitsmoking

## Overview

QuitSmoking is a privacy-first Kotlin app for tracking a smoke-free journey across Android and iOS. Users configure their quit date, smoking habits, and cigarette cost; the app presents elapsed-time and savings progress alongside health-recovery milestones. Adaptive navigation also exposes settings and about information. The graph reflects documented capabilities and the sampled navigation, settings repository, and dependency-registration links; health and overview internals are represented from the tree, with unverified connections left dashed.

Main entry points: [`composeApp/src/commonMain/kotlin/org/project/quitsmoking/di/RepositoryModule.kt`](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/di/RepositoryModule.kt) (Repository bindings), [`composeApp/src/commonMain/kotlin/org/project/quitsmoking/ui/navigation/AdaptiveNavigation.kt`](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/ui/navigation/AdaptiveNavigation.kt) (Adaptive navigation), [`composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/data/repository/SettingsRepository.kt`](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/data/repository/SettingsRepository.kt) (Settings repository), [`composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/data/datasource/OverviewDiskDataSource.kt`](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/data/datasource/OverviewDiskDataSource.kt) (Progress data source)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_app["Compose app<br/>[App.kt]"]
  node_navigation["Adaptive navigation"]
  node_about["About screen<br/>[AboutScreen.kt]"]
end

subgraph group_progress["Progress and savings"]
  node_overview_ui["Overview screen<br/>[OverviewScreen.kt]"]
  node_overview_vm["Overview state"]
  node_overview_usecase["Progress calculations<br/>[OverviewUseCase.kt]"]
  node_overview_repo["Progress repository"]
  node_overview_store["Progress data source"]
end

subgraph group_health["Health recovery"]
  node_health_ui["Health screen<br/>[HealthScreen.kt]"]
  node_health_vm["Health state<br/>[HealthViewModel.kt]"]
  node_health_usecase["Health milestones<br/>[HealthUseCase.kt]"]
  node_health_repo["Health repository"]
  node_health_source["Health data source"]
end

subgraph group_settings["Quit settings"]
  node_settings_ui["Settings screen<br/>[SettingsScreen.kt]"]
  node_settings_vm["Settings state"]
  node_settings_usecase["Settings operations<br/>[SettingsUseCase.kt]"]
  node_settings_repo["Settings repository"]
  node_settings_store["Settings data source"]
  node_settings_model["Quit configuration<br/>[SettingsModel.kt]"]
end

subgraph group_shared["Shared data"]
  node_repository_di["Repository bindings"]
  node_local_storage[("On-device storage")]
end

node_user(("App user"))

node_user -->|"opens"| node_app
node_app -->|"renders"| node_navigation
node_navigation -->|"routes to"| node_overview_ui
node_navigation -->|"routes to"| node_health_ui
node_navigation -->|"routes to"| node_settings_ui
node_navigation -->|"routes to"| node_about
node_settings_ui -->|"reads state"| node_settings_vm
node_settings_ui -.->|"displays"| node_settings_model
node_settings_vm -.->|"invokes"| node_settings_usecase
node_settings_usecase -.->|"delegates to"| node_settings_repo
node_settings_repo -->|"reads and writes"| node_settings_store
node_settings_repo -->|"combines into"| node_settings_model
node_settings_store -.->|"persists locally"| node_local_storage
node_overview_ui -.->|"observes"| node_overview_vm
node_overview_vm -.->|"invokes"| node_overview_usecase
node_overview_usecase -.->|"delegates to"| node_overview_repo
node_overview_repo -->|"reads"| node_overview_store
node_overview_store -.->|"reads locally"| node_local_storage
node_settings_repo -.->|"shares quit data"| node_overview_store
node_health_ui -.->|"observes"| node_health_vm
node_health_vm -.->|"invokes"| node_health_usecase
node_health_usecase -.->|"delegates to"| node_health_repo
node_health_repo -.->|"reads"| node_health_source
node_repository_di -->|"registers"| node_settings_repo
node_repository_di -->|"registers"| node_settings_store
node_repository_di -->|"registers"| node_overview_repo
node_repository_di -->|"registers"| node_overview_store
node_repository_di -->|"registers"| node_health_repo
node_repository_di -->|"registers"| node_health_source

click node_app "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/App.kt"
click node_navigation "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/ui/navigation/AdaptiveNavigation.kt"
click node_about "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/about/AboutScreen.kt"
click node_overview_ui "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/ui/OverviewScreen.kt"
click node_overview_vm "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/ui/OverviewViewModel.kt"
click node_overview_usecase "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/domain/OverviewUseCase.kt"
click node_overview_repo "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/data/repository/OverviewRepository.kt"
click node_overview_store "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/data/datasource/OverviewDiskDataSource.kt"
click node_health_ui "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/ui/HealthScreen.kt"
click node_health_vm "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/ui/HealthViewModel.kt"
click node_health_usecase "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/domain/HealthUseCase.kt"
click node_health_repo "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/data/repository/HealthRepository.kt"
click node_health_source "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/data/datasource/HealthDataSource.kt"
click node_settings_ui "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/ui/SettingsScreen.kt"
click node_settings_vm "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/ui/SettingsViewModel.kt"
click node_settings_usecase "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/domain/SettingsUseCase.kt"
click node_settings_repo "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/data/repository/SettingsRepository.kt"
click node_settings_store "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/data/datasource/SettingsDiskDataSource.kt"
click node_settings_model "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/data/model/SettingsModel.kt"
click node_repository_di "https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/di/RepositoryModule.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,node_navigation,node_about,node_user toneBlue
class node_overview_ui,node_overview_vm,node_overview_usecase,node_overview_repo,node_overview_store toneAmber
class node_health_ui,node_health_vm,node_health_usecase,node_health_repo,node_health_source toneMint
class node_settings_ui,node_settings_vm,node_settings_usecase,node_settings_repo,node_settings_store,node_settings_model toneRose
class node_repository_di,node_local_storage toneIndigo
```

## Components

### App shell

- [Compose app](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/App.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/App.kt`
- [Adaptive navigation](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/ui/navigation/AdaptiveNavigation.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/ui/navigation/AdaptiveNavigation.kt`
- [About screen](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/about/AboutScreen.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/about/AboutScreen.kt`

### Progress and savings

- [Overview screen](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/ui/OverviewScreen.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/ui/OverviewScreen.kt`
- [Overview state](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/ui/OverviewViewModel.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/ui/OverviewViewModel.kt`
- [Progress calculations](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/domain/OverviewUseCase.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/domain/OverviewUseCase.kt`
- [Progress repository](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/data/repository/OverviewRepository.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/data/repository/OverviewRepository.kt`
- [Progress data source](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/data/datasource/OverviewDiskDataSource.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/data/datasource/OverviewDiskDataSource.kt`

### Health recovery

- [Health screen](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/ui/HealthScreen.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/ui/HealthScreen.kt`
- [Health state](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/ui/HealthViewModel.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/ui/HealthViewModel.kt`
- [Health milestones](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/domain/HealthUseCase.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/domain/HealthUseCase.kt`
- [Health repository](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/data/repository/HealthRepository.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/data/repository/HealthRepository.kt`
- [Health data source](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/data/datasource/HealthDataSource.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/health/data/datasource/HealthDataSource.kt`

### Quit settings

- [Settings screen](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/ui/SettingsScreen.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/ui/SettingsScreen.kt`
- [Settings state](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/ui/SettingsViewModel.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/ui/SettingsViewModel.kt`
- [Settings operations](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/domain/SettingsUseCase.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/domain/SettingsUseCase.kt`
- [Settings repository](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/data/repository/SettingsRepository.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/data/repository/SettingsRepository.kt`
- [Settings data source](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/data/datasource/SettingsDiskDataSource.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/data/datasource/SettingsDiskDataSource.kt`
- [Quit configuration](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/data/model/SettingsModel.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/data/model/SettingsModel.kt`

### Shared data

- [Repository bindings](https://github.com/rmiguel1985/quitsmoking/blob/master/composeApp/src/commonMain/kotlin/org/project/quitsmoking/di/RepositoryModule.kt): `composeApp/src/commonMain/kotlin/org/project/quitsmoking/di/RepositoryModule.kt`
- **On-device storage**

### Other components

- **App user**

## Connections

- App user → Compose app: opens
- Compose app → Adaptive navigation: renders (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/App.kt`)
- Adaptive navigation → Overview screen: routes to (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/ui/navigation/AdaptiveNavigation.kt`)
- Adaptive navigation → Health screen: routes to (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/ui/navigation/AdaptiveNavigation.kt`)
- Adaptive navigation → Settings screen: routes to (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/ui/navigation/AdaptiveNavigation.kt`)
- Adaptive navigation → About screen: routes to (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/ui/navigation/AdaptiveNavigation.kt`)
- Settings screen → Settings state: reads state (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/ui/SettingsScreen.kt`)
- Settings screen → Quit configuration: displays
- Settings state → Settings operations: invokes
- Settings operations → Settings repository: delegates to
- Settings repository → Settings data source: reads and writes (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/data/repository/SettingsRepository.kt`)
- Settings repository → Quit configuration: combines into (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/settings/data/repository/SettingsRepository.kt`)
- Settings data source → On-device storage: persists locally
- Overview screen → Overview state: observes (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/ui/OverviewScreen.kt`)
- Overview state → Progress calculations: invokes
- Progress calculations → Progress repository: delegates to
- Progress repository → Progress data source: reads (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/features/overview/data/repository/OverviewRepository.kt`)
- Progress data source → On-device storage: reads locally
- Settings repository → Progress data source: shares quit data
- Health screen → Health state: observes
- Health state → Health milestones: invokes
- Health milestones → Health repository: delegates to
- Health repository → Health data source: reads
- Repository bindings → Settings repository: registers (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/di/RepositoryModule.kt`)
- Repository bindings → Settings data source: registers (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/di/RepositoryModule.kt`)
- Repository bindings → Progress repository: registers (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/di/RepositoryModule.kt`)
- Repository bindings → Progress data source: registers (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/di/RepositoryModule.kt`)
- Repository bindings → Health repository: registers (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/di/RepositoryModule.kt`)
- Repository bindings → Health data source: registers (evidence: `composeApp/src/commonMain/kotlin/org/project/quitsmoking/di/RepositoryModule.kt`)
