# pradyumnakrishna/git-icon architecture

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

- Interactive diagram: https://gitdiagram.com/pradyumnakrishna/git-icon
- Repository: https://github.com/pradyumnakrishna/git-icon

## Overview

##### Main Components
- Application Host (gitIcon):
– Contains the main app files (AppDelegate.swift, Assets.xcassets, Info.plist, etc.).
– Responsible for holding assets, configuration, and launching the application.
- FinderSync Extension (gitIconSync):
– Contains the FinderSync extension code (FinderSync.swift) and its associated Info.plist, entitlements, and configuration file (URLs).
- Build & Configuration Infrastructure:
– The Xcode project (gitIcon.xcodeproj) and its configurations (project.pbxproj, workspace files) indicate how the two components are bundled and built.
- Documentation & Licensing:
– The docs folder (with assets like the screenshots) and LICENSE/README files provide user and developer context.

##### Relationships and Interactions
- The main application and the FinderSync extension are built into one app bundle. The FinderSync extension is a separate target that gets loaded by the macOS Finder.
- Configuration files (such as the URLs file in gitIconSync and Info.plist settings) guide the behavior of the FinderSync and the main app.
- The Assets.xcassets and iconset (which is compiled to an icns file) serve as a shared resource between the two parts.

##### Architectural Patterns and Design Principles
- Modular Separation: The project is separated into at least two distinct modules— the main macOS app and the FinderSync extension.
- Extension-based Integration: Utilizing the macOS FinderSync extension pattern to safely and effectively integrate with the Finder without the need to disable SIP.
- Configuration Driven: The use of external configuration (e.g., updating the git folder path in the URLs file) makes the project flexible.

##### Relevant Technologies and Frameworks
- Swift is the primary language used.
- FinderSync framework is crucial for the extension.
- macOS-specific configuration files (Info.plist, entitlements) and Xcode build project structures.
- Command-line tools like iconutil are used to convert the iconset to an icns file.

##### Elements
- Detailed annotations:

- Review the architectural elements ensuring each module (Application, Extension, Resources, and external integration with Finder) is clearly represented.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Main Application (gitIcon) Subgraph
    subgraph "Main Application (gitIcon)"
        A1["AppDelegate.swift"]
        A2["Assets.xcassets"]
        A3["Info.plist"]
        A4["gitIcon.entitlements"]
        A5["Icon.icns"]
    end

    %% FinderSync Extension (gitIconSync) Subgraph
    subgraph "FinderSync Extension (gitIconSync)"
        B1["FinderSync.swift"]
        B2["Info.plist"]
        B3["URLs"]
        B4["gitIconSync.entitlements"]
    end

    %% Resource & Configuration Subgraph
    subgraph "Resource & Configuration"
        R1["Asset & Icon Resources"]
        R2["Configuration Files"]
    end

    %% Build & Configuration Infrastructure Subgraph
    subgraph "Build & Configuration Infrastructure"
        C1["gitIcon.xcodeproj"]
    end

    %% Documentation & Licensing Subgraph
    subgraph "Documentation & Licensing"
        D1["LICENSE.md"]
        D2["README.md"]
        D3["docs folder"]
    end

    %% External Integration: macOS Finder
    F["macOS Finder"]:::external

    %% Connections between components
    %% Main Application to Resource & Configuration
    A2 -->|"containsAssets"| R1
    A3 -->|"configures"| R2
    %% FinderSync Extension to Resource & Configuration
    B2 -->|"usesConfig"| R2
    %% FinderSync Extension and macOS Finder interaction
    B3 -->|"monitors"| F
    %% Main Application provides icon resource to macOS Finder
    A5 -->|"appliesIcon"| F
    %% Build process for Main App and FinderSync Extension
    C1 -->|"builds"| A1
    C1 -->|"builds"| B1
    %% Sync of entitlements between Main App and Extension
    A4 -->|"syncsEntitlements"| B4
    %% Indicate bundling of components inside the app bundle
    A1 -.->|"bundled"| B1

    %% Click Events for Main Application Host
    click A1 "https://github.com/pradyumnakrishna/git-icon/blob/main/gitIcon/AppDelegate.swift"
    click A2 "https://github.com/pradyumnakrishna/git-icon/blob/main/gitIcon/Assets.xcassets"
    click A3 "https://github.com/pradyumnakrishna/git-icon/blob/main/gitIcon/Info.plist"
    click A4 "https://github.com/pradyumnakrishna/git-icon/blob/main/gitIcon/gitIcon.entitlements"
    click A5 "https://github.com/pradyumnakrishna/git-icon/blob/main/gitIcon/Icon.icns"

    %% Click Events for FinderSync Extension
    click B1 "https://github.com/pradyumnakrishna/git-icon/blob/main/gitIconSync/FinderSync.swift"
    click B2 "https://github.com/pradyumnakrishna/git-icon/blob/main/gitIconSync/Info.plist"
    click B3 "https://github.com/pradyumnakrishna/git-icon/tree/main/gitIconSync/URLs"
    click B4 "https://github.com/pradyumnakrishna/git-icon/blob/main/gitIconSync/gitIconSync.entitlements"

    %% Click Event for Build & Configuration Infrastructure
    click C1 "https://github.com/pradyumnakrishna/git-icon/blob/main/gitIcon.xcodeproj"

    %% Click Events for Documentation & Licensing
    click D1 "https://github.com/pradyumnakrishna/git-icon/blob/main/LICENSE.md"
    click D2 "https://github.com/pradyumnakrishna/git-icon/blob/main/README.md"
    click D3 "https://github.com/pradyumnakrishna/git-icon/tree/main/docs/assets"

    %% Styles
    classDef app fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef ext fill:#ABEBC6,stroke:#196F3D,stroke-width:2px;
    classDef resource fill:#FAD7A0,stroke:#D35400,stroke-width:2px;
    classDef build fill:#D2B4DE,stroke:#5D6D7E,stroke-width:2px;
    classDef doc fill:#F5B7B1,stroke:#922B21,stroke-width:2px;
    classDef external fill:#F9E79F,stroke:#B7950B,stroke-width:2px;

    %% Applying styles to nodes
    class A1,A2,A3,A4,A5 app;
    class B1,B2,B3,B4 ext;
    class R1,R2 resource;
    class C1 build;
    class D1,D2,D3 doc;
```
