# bchatard/alfred-jetbrains architecture

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

- Interactive diagram: https://gitdiagram.com/bchatard/alfred-jetbrains
- Repository: https://github.com/bchatard/alfred-jetbrains

## Overview

##### Main Components

a. User Interface Layer:
- Alfred 5 Interface (entry point)
- As a top-level component with keyword inputs (jb, pstorm, idea, etc.)

b. Core Components:
- Alfred Workflow Engine
- Node.js Runtime Environment
- JetBrains Project Scanner
- Shell Script Integration Layer

c. External Components:
- JetBrains IDEs
- JetBrains Toolbox (optional integration)
- Project Directory Storage

##### Component Relationships

- User Input → Alfred Interface
- Alfred Interface → Workflow Engine
- Workflow Engine → Node.js Runtime
- Node.js Runtime → Project Scanner
- Project Scanner → JetBrains Configuration Directories
- Workflow Engine → Shell Script Integration
- Shell Script Integration → JetBrains IDEs

##### Specific Implementation Details

Create sections for:
- Configuration Management
- .editorconfig
- Package configuration (package.json)
- Custom settings (edition.md, bin.md)

- Project Discovery Flow
- Project scanning mechanism
- Cache management
- Project filtering

##### Technical Details to Highlight

- Shell script initialization process
- Project detection mechanisms
- IDE-specific customization options
- Cross-product search functionality

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph User_Layer
        UI[Alfred 5 Interface]:::ui
        Keywords["Keywords (jb, pstorm, idea)"]:::ui
    end

    subgraph Core_Processing
        WF[Alfred Workflow Engine]:::core
        Node[Node.js Runtime]:::core
        Scanner[JetBrains Project Scanner]:::core
        Shell[Shell Script Integration]:::core
    end

    subgraph Configuration
        Config[Workflow Configuration]:::config
        EditorConfig[Editor Configuration]:::config
        PackageConfig[Package Configuration]:::config
        CustomSettings[Customization Settings]:::config
    end

    subgraph External_Systems
        JB[JetBrains IDEs]:::external
        Toolbox[JetBrains Toolbox]:::external
        ProjectDir[Project Directory Storage]:::external
    end

    subgraph Documentation
        TroubleshootDocs[Troubleshooting Guide]:::docs
        IssueTemplate[Bug Report Template]:::docs
        DependencyMgmt[Dependency Management]:::docs
    end

    %% Relationships
    UI --> |User Input| Keywords
    Keywords --> WF
    WF --> Node
    Node --> Scanner
    Scanner --> ProjectDir
    WF --> Shell
    Shell --> JB
    Scanner -.-> Toolbox
    
    %% Configuration Relationships
    Config --> WF
    EditorConfig --> Node
    PackageConfig --> Node
    CustomSettings --> Shell

    %% Documentation Relationships
    TroubleshootDocs -.-> WF
    IssueTemplate -.-> WF
    DependencyMgmt -.-> Node

    %% Styling
    classDef ui fill:#2196F3,stroke:#fff,stroke-width:2px,color:#fff
    classDef core fill:#4CAF50,stroke:#fff,stroke-width:2px,color:#fff
    classDef config fill:#FF9800,stroke:#fff,stroke-width:2px,color:#fff
    classDef external fill:#FFC107,stroke:#fff,stroke-width:2px,color:#fff
    classDef docs fill:#9C27B0,stroke:#fff,stroke-width:2px,color:#fff

    %% Click Events
    click Config "https://github.com/bchatard/alfred-jetbrains/blob/main/info.plist"
    click Shell "https://github.com/bchatard/alfred-jetbrains/tree/main/bin/alfred_jetbrains_cli"
    click PackageConfig "https://github.com/bchatard/alfred-jetbrains/blob/main/package.json"
    click EditorConfig "https://github.com/bchatard/alfred-jetbrains/blob/main/.editorconfig"
    click CustomSettings "https://github.com/bchatard/alfred-jetbrains/tree/main/doc/customisation/"
    click TroubleshootDocs "https://github.com/bchatard/alfred-jetbrains/blob/main/doc/troubleshooting.md"
    click DependencyMgmt "https://github.com/bchatard/alfred-jetbrains/blob/main/.github/dependabot.yml"
    click IssueTemplate "https://github.com/bchatard/alfred-jetbrains/blob/main/.github/ISSUE_TEMPLATE/bug-report.yml"

    %% Legend
    subgraph Legend
        L1[User Interface]:::ui
        L2[Core Components]:::core
        L3[Configuration]:::config
        L4[External Systems]:::external
        L5[Documentation]:::docs
    end
```
