# altstoreio/altstore architecture

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

- Interactive diagram: https://gitdiagram.com/altstoreio/altstore
- Repository: https://github.com/altstoreio/altstore

## Overview

AltStore is an iOS alternative app store backed by AltServer on macOS. Users browse app sources, select an app, and AltStore downloads, signs, and sends it to AltServer for installation over Wi‑Fi; background refresh repeats the signing/install path to prevent expiration. The repository also includes app discovery and updates, source management, social/fediverse interactions, and a shared Core Data model. Paths and documented workflow are supported by the tree and README; sampled source excerpts support selected component links, while unsampled subsystems are represented at their known directory paths.

Main entry points: [`AltStore/Managing Apps/AppManager.swift`](https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Managing%20Apps/AppManager.swift) (App Manager), [`AltStore/Operations`](https://github.com/altstoreio/altstore/tree/marketplace/AltStore/Operations) (App Operations), [`AltStore/Fediverse/FederationManager.swift`](https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Fediverse/FederationManager.swift) (Federation Manager), [`AltStore/Browse/FeaturedViewController.swift`](https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Browse/FeaturedViewController.swift) (Browse Catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["iOS Storefront"]
  node_browse["Browse Catalog"]
  node_app_detail["App Details"]
  node_source_management["Manage Sources"]
  node_installed_apps["My Apps"]
end

subgraph group_app_lifecycle["App Lifecycle"]
  node_app_manager["App Manager<br/>[AppManager.swift]"]
  node_operations["App Operations"]
  node_patching["App Patching"]
  node_permissions["Review Permissions"]
  node_refresh["Background Refresh"]
end

subgraph group_desktop["Desktop Server"]
  node_server_manager["Server Discovery"]
  node_server_connection["Server Connection"]
  node_altserver["AltServer"]
  node_device_install["Device Installation"]
  node_jit["JIT Support<br/>[JITManager.swift]"]
end

subgraph group_shared["Shared Services"]
  node_core_data[("App Data")]
  node_store_models["Store Models<br/>[StoreApp.swift]"]
  node_keychain[("Credentials<br/>[Keychain.swift]")]
end

subgraph group_social["Social Features"]
  node_federation["Federation Manager"]
  node_social_apis["Social APIs"]
end

node_user(("Device User"))

node_user -->|"browses"| node_browse
node_user -->|"adds sources"| node_source_management
node_browse -->|"opens app"| node_app_detail
node_browse -->|"fetches apps"| node_store_models
node_app_detail -->|"requests action"| node_app_manager
node_installed_apps -->|"manages apps"| node_app_manager
node_app_manager -.->|"runs operations"| node_operations
node_app_manager -.->|"updates records"| node_core_data
node_operations -.->|"finds server"| node_server_manager
node_server_manager -->|"creates connection"| node_server_connection
node_server_connection -->|"sends app"| node_altserver
node_altserver -->|"installs app"| node_device_install
node_device_install -->|"supports JIT"| node_jit
node_refresh -.->|"refreshes apps"| node_app_manager
node_operations -.->|"verifies permissions"| node_permissions
node_operations -.->|"patches apps"| node_patching
node_store_models -->|"persists models"| node_core_data
node_federation -->|"calls APIs"| node_social_apis
node_federation -->|"updates interactions"| node_core_data
node_federation -->|"uses credentials"| node_keychain

click node_browse "https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Browse/FeaturedViewController.swift"
click node_app_detail "https://github.com/altstoreio/altstore/blob/marketplace/AltStore/App%20Detail/AppViewController.swift"
click node_source_management "https://github.com/altstoreio/altstore/tree/marketplace/AltStore/Sources"
click node_installed_apps "https://github.com/altstoreio/altstore/blob/marketplace/AltStore/My%20Apps/MyAppsViewController.swift"
click node_app_manager "https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Managing%20Apps/AppManager.swift"
click node_operations "https://github.com/altstoreio/altstore/tree/marketplace/AltStore/Operations"
click node_patching "https://github.com/altstoreio/altstore/tree/marketplace/AltStore/Operations/Patch%20App"
click node_permissions "https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Permissions/ReviewPermissionsViewController.swift"
click node_refresh "https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Operations/BackgroundRefreshAppsOperation.swift"
click node_server_manager "https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Server/ServerManager.swift"
click node_server_connection "https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Server/ServerConnection.swift"
click node_altserver "https://github.com/altstoreio/altstore/tree/marketplace/AltServer"
click node_device_install "https://github.com/altstoreio/altstore/blob/marketplace/AltServer/Devices/ALTDeviceManager%2BInstallation.swift"
click node_jit "https://github.com/altstoreio/altstore/blob/marketplace/AltServer/JIT/JITManager.swift"
click node_core_data "https://github.com/altstoreio/altstore/blob/marketplace/AltStoreCore/Model/DatabaseManager.swift"
click node_store_models "https://github.com/altstoreio/altstore/blob/marketplace/AltStoreCore/Model/StoreApp.swift"
click node_keychain "https://github.com/altstoreio/altstore/blob/marketplace/AltStoreCore/Components/Keychain.swift"
click node_federation "https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Fediverse/FederationManager.swift"
click node_social_apis "https://github.com/altstoreio/altstore/tree/marketplace/AltStore/Fediverse"

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_browse,node_app_detail,node_source_management,node_installed_apps,node_user toneBlue
class node_app_manager,node_operations,node_patching,node_permissions,node_refresh toneAmber
class node_server_manager,node_server_connection,node_altserver,node_device_install,node_jit toneMint
class node_core_data,node_store_models,node_keychain toneRose
class node_federation,node_social_apis toneIndigo
```

## Components

### iOS Storefront

- [Browse Catalog](https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Browse/FeaturedViewController.swift): `AltStore/Browse/FeaturedViewController.swift`
- [App Details](https://github.com/altstoreio/altstore/blob/marketplace/AltStore/App%20Detail/AppViewController.swift): `AltStore/App Detail/AppViewController.swift`
- [Manage Sources](https://github.com/altstoreio/altstore/tree/marketplace/AltStore/Sources): `AltStore/Sources`
- [My Apps](https://github.com/altstoreio/altstore/blob/marketplace/AltStore/My%20Apps/MyAppsViewController.swift): `AltStore/My Apps/MyAppsViewController.swift`

### App Lifecycle

- [App Manager](https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Managing%20Apps/AppManager.swift): `AltStore/Managing Apps/AppManager.swift`
- [App Operations](https://github.com/altstoreio/altstore/tree/marketplace/AltStore/Operations): `AltStore/Operations`
- [App Patching](https://github.com/altstoreio/altstore/tree/marketplace/AltStore/Operations/Patch%20App): `AltStore/Operations/Patch App`
- [Review Permissions](https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Permissions/ReviewPermissionsViewController.swift): `AltStore/Permissions/ReviewPermissionsViewController.swift`
- [Background Refresh](https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Operations/BackgroundRefreshAppsOperation.swift): `AltStore/Operations/BackgroundRefreshAppsOperation.swift`

### Desktop Server

- [Server Discovery](https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Server/ServerManager.swift): `AltStore/Server/ServerManager.swift`
- [Server Connection](https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Server/ServerConnection.swift): `AltStore/Server/ServerConnection.swift`
- [AltServer](https://github.com/altstoreio/altstore/tree/marketplace/AltServer): `AltServer`
- [Device Installation](https://github.com/altstoreio/altstore/blob/marketplace/AltServer/Devices/ALTDeviceManager%2BInstallation.swift): `AltServer/Devices/ALTDeviceManager+Installation.swift`
- [JIT Support](https://github.com/altstoreio/altstore/blob/marketplace/AltServer/JIT/JITManager.swift): `AltServer/JIT/JITManager.swift`

### Shared Services

- [App Data](https://github.com/altstoreio/altstore/blob/marketplace/AltStoreCore/Model/DatabaseManager.swift): `AltStoreCore/Model/DatabaseManager.swift`
- [Store Models](https://github.com/altstoreio/altstore/blob/marketplace/AltStoreCore/Model/StoreApp.swift): `AltStoreCore/Model/StoreApp.swift`
- [Credentials](https://github.com/altstoreio/altstore/blob/marketplace/AltStoreCore/Components/Keychain.swift): `AltStoreCore/Components/Keychain.swift`

### Social Features

- [Federation Manager](https://github.com/altstoreio/altstore/blob/marketplace/AltStore/Fediverse/FederationManager.swift): `AltStore/Fediverse/FederationManager.swift`
- [Social APIs](https://github.com/altstoreio/altstore/tree/marketplace/AltStore/Fediverse): `AltStore/Fediverse`

### Other components

- **Device User**

## Connections

- Device User → Browse Catalog: browses (evidence: `README.md`)
- Device User → Manage Sources: adds sources (evidence: `README.md`)
- Browse Catalog → App Details: opens app (evidence: `AltStore/Browse/FeaturedViewController.swift`)
- Browse Catalog → Store Models: fetches apps (evidence: `AltStore/Browse/FeaturedViewController.swift`)
- App Details → App Manager: requests action (evidence: `AltStore/App Detail/AppViewController.swift`)
- My Apps → App Manager: manages apps (evidence: `AltStore/My Apps/MyAppsViewController.swift`)
- App Manager → App Operations: runs operations
- App Manager → App Data: updates records
- App Operations → Server Discovery: finds server (evidence: `AltStore/Server/ServerManager.swift`)
- Server Discovery → Server Connection: creates connection (evidence: `AltStore/Server/ServerManager.swift`)
- Server Connection → AltServer: sends app (evidence: `README.md`)
- AltServer → Device Installation: installs app (evidence: `README.md`)
- Device Installation → JIT Support: supports JIT (evidence: `AltServer/Devices/ALTDeviceManager+Installation.swift`)
- Background Refresh → App Manager: refreshes apps
- App Operations → Review Permissions: verifies permissions (evidence: `AltStore/Permissions/ReviewPermissionsViewController.swift`)
- App Operations → App Patching: patches apps (evidence: `AltStore/Operations/Patch App/PatchViewController.swift`)
- Store Models → App Data: persists models (evidence: `AltStoreCore/Model/DatabaseManager.swift`)
- Federation Manager → Social APIs: calls APIs (evidence: `AltStore/Fediverse/FederationManager.swift`)
- Federation Manager → App Data: updates interactions (evidence: `AltStore/Fediverse/FederationManager.swift`)
- Federation Manager → Credentials: uses credentials (evidence: `AltStore/Fediverse/FederationManager.swift`)
