# suho/bluffxcodes architecture

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

- Interactive diagram: https://gitdiagram.com/suho/bluffxcodes
- Repository: https://github.com/suho/bluffxcodes

## Overview

##### Main Components

A. Core Components:
- Command Line Interface (Entry Point)
- Xcode Version Manager
- File System Interface
- System Permission Handler

B. Key Actions:
- Xcode Version Detection
- Bundle Version Modification
- Version Selection Interface
- System Integration

**┌─ User Interface Layer ─────────────────────┐**
- Terminal Interface (Sources/Main.swift)     │
- ┬─────────────────────────┘
- ↓
**┌─ Action Layer ────────────────────────────┐**
- ┌─ Xcode.swift ─┐ ┌─ XcodeBluff.swift ─┐ │
- Version Detection│ │Bundle Modification │ │
- ┘ └──────────────────────┘ │
- ┌─ XcodeSelection.swift ─────────────────┐ │
- Version Selection Handler           │ │
- ┘ │
- ┬─────────────────────────┘
- ↓
**┌─ Helper Layer ───────────────────────────┐**
- ┌─ Terminal ─┐ ┌─ Picker ─┐ ┌─ Error ─┐ │
- CLI Utils   │ │Selection │ │Handler  │ │
- ┘ └──────────┘ └─────────┘ │
- ┌─ Constants ────────────────────────┐  │
- System-wide Configuration      │  │
- ┘ │
- ┬─────────────────────────┘
- ↓
**┌─ System Layer ───────────────────────────┐**
- macOS File System                        │
- Xcode.app Bundles                        │
- ┘

##### Important Elements to Highlight

a. System Requirements:
- macOS Sonoma compatibility
- Full Disk Access permissions
- Multiple Xcode installations

b. Core Workflows:
- Version detection flow
- Bundle modification process
- User selection interface

##### Implementation Details to Note

- The Sources/Actions directory contains the core business logic
- The Sources/Helpers directory provides supporting functionality
- Main.swift serves as the entry point and orchestrator

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef action fill:#2ecc71,stroke:#27ae60,color:white
    classDef helper fill:#f1c40f,stroke:#f39c12,color:black
    classDef system fill:#95a5a6,stroke:#7f8c8d,color:white
    
    %% User Interface Layer
    subgraph UI
        CLI["Terminal Interface"]:::ui
    end
    
    %% Action Layer
    subgraph Actions
        XD["Version Detection"]:::action
        XB["Bundle Modification"]:::action
        XS["Version Selection Handler"]:::action
    end
    
    %% Helper Layer
    subgraph Helpers
        TU["CLI Utils"]:::helper
        PI["Selection Interface"]:::helper
        EH["Error Handler"]:::helper
        CN["System Configuration"]:::helper
    end
    
    %% System Layer
    subgraph System
        FS["macOS File System"]:::system
        XA["Xcode.app Bundles"]:::system
        FDA["Full Disk Access"]:::system
    end
    
    %% Relationships
    CLI --> XD
    CLI --> XB
    CLI --> XS
    XD --> TU
    XB --> TU
    XS --> PI
    XD --> EH
    XB --> EH
    XS --> EH
    XD --> CN
    XB --> CN
    XS --> CN
    TU --> FS
    PI --> FS
    FS --> XA
    FDA --> FS
    
    %% Click Events
    click CLI "https://github.com/suho/bluffxcodes/blob/main/Sources/Main.swift"
    click XD "https://github.com/suho/bluffxcodes/blob/main/Sources/Actions/Xcode.swift"
    click XB "https://github.com/suho/bluffxcodes/blob/main/Sources/Actions/XcodeBluff.swift"
    click XS "https://github.com/suho/bluffxcodes/blob/main/Sources/Actions/XcodeSelection.swift"
    click TU "https://github.com/suho/bluffxcodes/blob/main/Sources/Helpers/Terminal.swift"
    click PI "https://github.com/suho/bluffxcodes/blob/main/Sources/Helpers/Picker.swift"
    click EH "https://github.com/suho/bluffxcodes/blob/main/Sources/Helpers/Error.swift"
    click CN "https://github.com/suho/bluffxcodes/blob/main/Sources/Helpers/Constants.swift"
    click Actions "https://github.com/suho/bluffxcodes/tree/main/Sources/Actions"
    click Helpers "https://github.com/suho/bluffxcodes/tree/main/Sources/Helpers"
    
    %% Legend
    subgraph Legend
        UI_L["User Interface"]:::ui
        AC_L["Action Component"]:::action
        HE_L["Helper Component"]:::helper
        SY_L["System Component"]:::system
    end
```
