# urbanapps/armchair architecture

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

- Interactive diagram: https://gitdiagram.com/urbanapps/armchair
- Repository: https://github.com/urbanapps/armchair

## Overview

Armchair is a Swift app-review prompting library for iOS and macOS. An app configures its App Store ID and reports significant user activity; Armchair tracks usage and applies configurable prompt criteria before presenting a review prompt and routing the user toward the store. Its single central implementation also covers lifecycle notifications, localization, affiliate links, and optional cross-device usage storage. The source is one large file, so these are responsibilities within that implementation, not separate modules; unsampled internals limit some relationship detail.

Main entry points: [`Source/Armchair.swift`](https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift) (Review manager), [`Localization`](https://github.com/urbanapps/armchair/tree/master/Localization) (Prompt localization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_configuration["Configuration &amp; tracking"]
  node_api["Armchair API<br/>[Armchair.swift]"]
  node_manager["Review manager<br/>[Armchair.swift]"]
  node_usage["Usage criteria<br/>[Armchair.swift]"]
  node_defaults[("Usage persistence<br/>[Armchair.swift]")]
  node_localization["Prompt localization"]
end

subgraph group_prompting["Prompt &amp; review"]
  node_prompt["Review prompt<br/>[Armchair.swift]"]
  node_reviewchoice["Review choice<br/>[Armchair.swift]"]
end

subgraph group_platform["Platform integrations"]
  node_storekit["StoreKit product view<br/>[Armchair.swift]"]
end

node_app(("Integrating app"))
node_appstore["App Store"]
node_lifecycle["App lifecycle"]
node_cloudstore[("iCloud key-value store")]

node_app -->|"configures and reports"| node_api
node_api -->|"delegates settings"| node_manager
node_app -->|"reports events"| node_api
node_manager -.->|"checks criteria"| node_usage
node_manager -->|"reads and writes"| node_defaults
node_manager -->|"presents when eligible"| node_prompt
node_prompt -->|"captures choice"| node_reviewchoice
node_reviewchoice -->|"opens review"| node_appstore
node_manager -->|"loads product"| node_storekit
node_storekit -->|"loads product listing"| node_appstore
node_manager -.->|"uses localized strings"| node_localization
node_lifecycle -->|"notifies launch and foreground"| node_manager
node_manager -.->|"may store synced stats"| node_cloudstore

click node_api "https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift"
click node_manager "https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift"
click node_usage "https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift"
click node_defaults "https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift"
click node_localization "https://github.com/urbanapps/armchair/tree/master/Localization"
click node_prompt "https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift"
click node_reviewchoice "https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift"
click node_storekit "https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift"

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_api,node_manager,node_usage,node_defaults,node_localization toneBlue
class node_prompt,node_reviewchoice,node_cloudstore toneAmber
class node_storekit toneMint
class node_app,node_appstore,node_lifecycle toneIndigo
```

## Components

### Configuration & tracking

- [Armchair API](https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift): `Source/Armchair.swift`
- [Review manager](https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift): `Source/Armchair.swift`
- [Usage criteria](https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift): `Source/Armchair.swift`
- [Usage persistence](https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift): `Source/Armchair.swift`
- [Prompt localization](https://github.com/urbanapps/armchair/tree/master/Localization): `Localization`

### Prompt & review

- [Review prompt](https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift): `Source/Armchair.swift`
- [Review choice](https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift): `Source/Armchair.swift`

### Platform integrations

- [StoreKit product view](https://github.com/urbanapps/armchair/blob/master/Source/Armchair.swift): `Source/Armchair.swift`

### Other components

- **Integrating app**
- **App Store**
- **App lifecycle**
- **iCloud key-value store**

## Connections

- Integrating app → Armchair API: configures and reports (evidence: `README.md`)
- Armchair API → Review manager: delegates settings (evidence: `Source/Armchair.swift`)
- Integrating app → Armchair API: reports events (evidence: `README.md`)
- Review manager → Usage criteria: checks criteria (evidence: `Source/Armchair.swift`)
- Review manager → Usage persistence: reads and writes (evidence: `Source/Armchair.swift`)
- Review manager → Review prompt: presents when eligible (evidence: `README.md`)
- Review prompt → Review choice: captures choice (evidence: `Source/Armchair.swift`)
- Review choice → App Store: opens review (evidence: `Source/Armchair.swift`)
- Review manager → StoreKit product view: loads product (evidence: `Source/Armchair.swift`)
- StoreKit product view → App Store: loads product listing (evidence: `Source/Armchair.swift`)
- Review manager → Prompt localization: uses localized strings (evidence: `README.md`)
- App lifecycle → Review manager: notifies launch and foreground (evidence: `Source/Armchair.swift`)
- Review manager → iCloud key-value store: may store synced stats (evidence: `README.md`)
