# omchachad/linkeeper architecture

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

- Interactive diagram: https://gitdiagram.com/omchachad/linkeeper
- Repository: https://github.com/omchachad/linkeeper

## Overview

Based on our analysis of the project’s file tree and README, Linkeeper is a multi-target Apple ecosystem application—a bookmark management tool designed for platforms including iOS, macOS, iPadOS, and visionOS. It uses SwiftUI for its user interfaces, leverages Core Data for local storage and iCloud sync for cross-device updates, and includes specialized components such as a widget extension and share extensions (for Mac and Vision).

##### Main Components
- Main Application (Linkeeper):
– Includes core SwiftUI views (e.g., ContentView.swift, Bookmarks View directories) and UI components for displaying, editing, and managing bookmarks.
– Handles creation and modification through “Creation Sheets” and “Modification” directories.
- Data Management Layer:
– CoreData is used for bookmark and folder storage (see the CoreData directory containing Bookmark+CoreData and Folder+CoreData files).
– Includes DataController and managers (e.g., FoldersManager, BookmarksManager) that handle persistence.
– Syncing with iCloud to ensure cross-device data consistency.
- App Intents & Integrations:
– Contains App Intents for Siri Shortcuts and other quick actions (provided in the App Intents folder).
– Integrates several open-source Swift packages (Pow for animations, SimpleToast for notifications, SwiftSoup for HTML parsing, and SwiftUI-Shimmer for effects).
- Widget Extension:
– The BookmarksWidget directory represents a detached widget component that allows users to quickly interact with their bookmarks via home screen or desktop widgets.
- Share Extensions:
– There are multiple share extension targets (a generic share extension plus specialized ones for Mac and visionOS) that enable users to share content from other apps to Linkeeper.
- Additional Utilities:

##### Relationships and Interactions
- The Main Application interacts directly with:
– The UI layer (various SwiftUI views, including grid, list, and tabular displays).
– The Data Management layer via CoreData controllers to perform CRUD operations on bookmarks.
– App intents that connect user actions (like Siri automation) with app functionality.
- The Widget Extension functions as a read-only portal, interfacing with a shared CoreData source or a service API (if applicable) to display bookmarks.
- Share Extensions provide input mechanisms which, when triggered, pass data back to the main application (or directly update the shared data store).
- External libraries augment functionality in the UI and processing of content (e.g., HTML parsing for import features).

##### Architectural Patterns and Design Principles
- Separation of Concerns: The project is divided clearly between UI (views), business logic (controllers and managers), and data persistence (CoreData).
- Cross-Platform Consistency: The project uses SwiftUI throughout, ensuring that the UI components are reusable across devices.
- Modular Design: With dedicated folders for Helpers, App Intents, and Extensions, the design separates functionality for easier maintainability and testing.

##### Detail and Clarity
- That the relationships (dependencies and data flows) between the Main App, Widget, Share Extensions, and the Data Management layer are well highlighted.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Main Application Components
    subgraph "Main Application Components"
        MainApp["Main Application (Linkeeper)"]:::app
        Creation["Creation Sheets"]:::creation
        Modification["Modification Components"]:::modification
        Utilities["Additional Utilities (Helpers & Extensions)"]:::utils
    end

    %% Data Management Layer
    subgraph "Data Management Layer"
        DataMgmt["Data Management Layer (CoreData & Managers)"]:::data
    end

    %% App Intents & Integrations
    subgraph "App Intents & Integrations"
        AppIntents["App Intents & Integrations"]:::intents
    end

    %% Widget Extension
    subgraph "Widget Extension"
        Widget["Widget Extension"]:::widget
    end

    %% Share Extensions
    subgraph "Share Extensions"
        ShareGeneric["Generic Share Extension"]:::share
        ShareMac["Mac Share Extension"]:::share
        ShareVision["Vision Share Extension"]:::share
    end

    %% Connections between components
    MainApp -->|"CRUD"| DataMgmt
    MainApp -->|"triggers"| AppIntents
    AppIntents -->|"updates"| DataMgmt
    Widget -->|"reads_from"| DataMgmt
    ShareGeneric -->|"sends_to"| MainApp
    ShareMac -->|"sends_to"| MainApp
    ShareVision -->|"sends_to"| MainApp
    MainApp -->|"invokes"| Creation
    MainApp -->|"invokes"| Modification
    MainApp -->|"utilizes"| Utilities

    %% Click Events
    click MainApp "https://github.com/omchachad/linkeeper/tree/main/Linkeeper/"
    click DataMgmt "https://github.com/omchachad/linkeeper/tree/main/Linkeeper/CoreData"
    click AppIntents "https://github.com/omchachad/linkeeper/tree/main/Linkeeper/App Intents"
    click Widget "https://github.com/omchachad/linkeeper/tree/main/BookmarksWidget"
    click ShareGeneric "https://github.com/omchachad/linkeeper/tree/main/Share Extension"
    click ShareMac "https://github.com/omchachad/linkeeper/tree/main/Share Extension Mac"
    click ShareVision "https://github.com/omchachad/linkeeper/tree/main/Share Extension Vision"
    click Utilities "https://github.com/omchachad/linkeeper/tree/main/Linkeeper/Helpers"
    click Creation "https://github.com/omchachad/linkeeper/tree/main/Linkeeper/Creation Sheets"
    click Modification "https://github.com/omchachad/linkeeper/tree/main/Linkeeper/Modification"

    %% Styles
    classDef app fill:#f9e79f,stroke:#b9770e,stroke-width:2px;
    classDef data fill:#aed6f1,stroke:#1b4f72,stroke-width:2px;
    classDef intents fill:#f5cba7,stroke:#b03a2e,stroke-width:2px;
    classDef widget fill:#abebc6,stroke:#1e8449,stroke-width:2px;
    classDef share fill:#d2b4de,stroke:#6c3483,stroke-width:2px;
    classDef utils fill:#f9e79f,stroke:#7d6608,stroke-width:2px;
    classDef creation fill:#d0ece7,stroke:#117864,stroke-width:2px;
    classDef modification fill:#f5b7b1,stroke:#943126,stroke-width:2px;
```
