# mangerlahn/latest architecture

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

- Interactive diagram: https://gitdiagram.com/mangerlahn/latest
- Repository: https://github.com/mangerlahn/latest

## Overview

##### Project type and purpose
- Latest is a standalone macOS desktop utility app, written in Swift, whose sole function is to check for updates in installed applications. It supports the Mac App Store, Sparkle‐enabled apps, and Homebrew-managed apps.
- It is structured as an MVVM/Cocoa application, with no server or backend—everything runs on the client machine.

##### File structure
- Top-level directories:
- Frameworks – contains in-tree copies of CommerceKit and StoreFoundation headers for App Store integration.
- Sparkle – contains Sparkle update framework.
- Latest – the Xcode project and main application code (AppDelegate.swift, Interface/, Model/, View Model/, Utilities/, Resources/).
- Tests – unit tests for version parsing and OS-version checks.
- Within Latest/:
- Interface – Storyboards, View Controllers, Views (the “View” layer).
- View Model – classes that expose state to the UI (“VM” layer).
- Model – domain types, update checkers, update queue, data stores (“Model” layer).
- Utilities – shared helpers (e.g., Observable, StatefulOperation).
- Resources – asset catalogs, localized strings, entitlements, Info.plist.
- Configuration/build files: Latest.xcodeproj, .gitmodules, .travis.yml.

##### README for additional insights
- Confirms it’s a free, open-source macOS app for checking updates.
- Mentions support for Mac App Store and Sparkle—two external systems.
- No server or third-party backends—purely local.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% UI Layer
    subgraph "UI Layer"
        UI["Storyboard, ViewControllers, Views"]:::ui
    end

    %% View Model Layer
    subgraph "View Model Layer"
        VM["View Model\n(data binding, snapshots, icon cache)"]:::vm
    end

    %% Domain Model Layer
    subgraph "Domain Model Layer"
        Coordinator["UpdateCheckCoordinator"]:::domain
        VersionModel["Version\nVersionParser"]:::domain
        subgraph "Checkers"
            AppStoreChecker["MacAppStoreCheckerOperation"]:::domain
            SparkleChecker["SparkleCheckerOperation"]:::domain
            HomebrewChecker["HomebrewCheckerOperation"]:::domain
        end
        subgraph "Repository & Cache"
            Repo["UpdateRepository"]:::domain
            RepoCache["UpdateRepositoryCache"]:::domain
        end
        subgraph "Updater Operations"
            Queue["UpdateQueue"]:::domain
            MASUpdateOp["MacAppStoreUpdateOperation"]:::domain
            SparkleUpdateOp["SparkleUpdateOperation"]:::domain
        end
    end

    %% Utilities
    subgraph "Utilities"
        SharedUtils["Latest/Utilities"]:::utils
        ModelUtils["Latest/Model/Utilities"]:::utils
    end

    %% External Services
    subgraph "External Services"
        MAS_Frameworks["CommerceKit\nStoreFoundation"]:::external
        SparkleSDK["Sparkle SDK"]:::external
        HomebrewCLI["Homebrew CLI"]:::external
    end

    %% Connections
    UI -->|"user actions"| VM
    VM -->|"check updates"| Coordinator
    Coordinator -->|"dispatch to"| AppStoreChecker
    Coordinator -->|"dispatch to"| SparkleChecker
    Coordinator -->|"dispatch to"| HomebrewChecker
    AppStoreChecker -->|"uses"| MAS_Frameworks
    SparkleChecker -->|"uses"| SparkleSDK
    HomebrewChecker -->|"invokes"| HomebrewCLI
    AppStoreChecker -->|"returns results"| Repo
    SparkleChecker -->|"returns results"| Repo
    HomebrewChecker -->|"returns results"| Repo
    VersionModel -->|parses versions| Repo
    Repo -->|"caches in"| RepoCache
    RepoCache -->|"provides snapshot"| VM
    VM -->|"update request"| Queue
    Queue -->|"enqueues"| MASUpdateOp
    Queue -->|"enqueues"| SparkleUpdateOp
    MASUpdateOp -->|"downloads/installs via"| MAS_Frameworks
    SparkleUpdateOp -->|"downloads/installs via"| SparkleSDK

    %% Click Events
    click UI "https://github.com/mangerlahn/latest/tree/main/Latest/Interface"
    click VM "https://github.com/mangerlahn/latest/tree/main/Latest/View Model"
    click Coordinator "https://github.com/mangerlahn/latest/blob/main/Latest/Model/UpdateCheckCoordinator.swift"
    click AppStoreChecker "https://github.com/mangerlahn/latest/blob/main/Latest/Model/Update Checker Extensions/App Store/MacAppStoreCheckerOperation.swift"
    click SparkleChecker "https://github.com/mangerlahn/latest/blob/main/Latest/Model/Update Checker Extensions/Sparkle/SparkleCheckerOperation.swift"
    click HomebrewChecker "https://github.com/mangerlahn/latest/blob/main/Latest/Model/Update Checker Extensions/Homebrew/HomebrewCheckerOperation.swift"
    click Repo "https://github.com/mangerlahn/latest/blob/main/Latest/Model/Update Repository/UpdateRepository.swift"
    click RepoCache "https://github.com/mangerlahn/latest/blob/main/Latest/Model/Update Repository/UpdateRepositoryCache.swift"
    click Queue "https://github.com/mangerlahn/latest/blob/main/Latest/Model/Updater/UpdateQueue.swift"
    click MASUpdateOp "https://github.com/mangerlahn/latest/blob/main/Latest/Model/Updater/MacAppStoreUpdateOperation.swift"
    click SparkleUpdateOp "https://github.com/mangerlahn/latest/blob/main/Latest/Model/Updater/SparkleUpdateOperation.swift"
    click VersionModel "https://github.com/mangerlahn/latest/blob/main/Latest/Model/Version/Version.swift"
    click VersionModel "https://github.com/mangerlahn/latest/blob/main/Latest/Model/Version/VersionParser.swift"
    click SharedUtils "https://github.com/mangerlahn/latest/tree/main/Latest/Utilities"
    click ModelUtils "https://github.com/mangerlahn/latest/tree/main/Latest/Model/Utilities"
    click SparkleSDK "https://github.com/mangerlahn/latest/tree/main/Sparkle"
    click MAS_Frameworks "https://github.com/mangerlahn/latest/tree/main/Frameworks/CommerceKit"
    click MAS_Frameworks "https://github.com/mangerlahn/latest/tree/main/Frameworks/StoreFoundation"

    %% Styles
    classDef ui fill:#ddeeff,stroke:#80bfff,stroke-width:2px
    classDef vm fill:#ddffdd,stroke:#33cc33,stroke-width:2px
    classDef domain fill:#ffffcc,stroke:#ffcc00,stroke-width:2px
    classDef utils fill:#ffd9b3,stroke:#ff9933,stroke-width:2px
    classDef external fill:#eeeeee,stroke:#999999,stroke-width:2px
```
