# directus-labs/extensions architecture

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

- Interactive diagram: https://gitdiagram.com/directus-labs/extensions
- Repository: https://github.com/directus-labs/extensions

## Overview

##### Main Components Structure

The system should be organized into these primary sections:

a. Extension Types (Top Level):
- Operations (AI services, integrations)
- Interfaces (UI components)
- Layouts (View layouts)
- Panels (Dashboard components)
- Modules (Larger feature sets)
- Bundles (Combined extensions)
- Themes (Visual customizations)
- Boilerplates (Template code)

b. Core Infrastructure:
- Package Management (pnpm workspace)
- Build System
- Type Definitions
- Shared Utilities

##### Key Relationships to Highlight

Create connection flows showing:
- How extensions interact with Directus core
- Shared dependencies between packages
- Integration points with external services (AI, Hubspot, etc.)
- Component inheritance and composition

##### Specific Implementation Details

- Blue: Operation extensions
- Green: Interface extensions
- Orange: Layout extensions
- Purple: Panel extensions
- Red: Module extensions
- Yellow: Bundle extensions
- Gray: Shared utilities/boilerplates

b. Connection Types:

##### Detailed Component Breakdown

**[Directus Extensions Repository]**
- [Operations]
- AI Services Group
- Text Operations
- Image Operations
- Speech Operations
- Integration Operations
- [Interfaces]
- Media Interfaces
- Input Interfaces
- Specialized Interfaces
- [Layouts]
- Spreadsheet
- Gantt Chart
- Tree View
- [Shared Infrastructure]
- Type Definitions
- Utilities
- Boilerplates

##### Documentation Integration

- README documentation
- Individual package documentation
- Marketplace listings
- Configuration options

Remember to include:
- Version compatibility matrix
- External service dependencies
- Build/deployment flow
- Extension initialization sequence
- Data flow patterns
- Security boundaries (especially for sandboxed operations)

This will provide a complete picture of how the extensions ecosystem works while maintaining clarity and usefulness for the principal software engineer.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Repository["Directus Extensions Repository"]
        direction TB
        
        subgraph Operations["Operations Layer"]
            direction TB
            AI["AI Services Group"]
            
            subgraph AIServices["AI Services"]
                direction TB
                TextOps["Text Operations"]:::operation
                ImageOps["Image Operations"]:::operation
                SpeechOps["Speech Operations"]:::operation
            end
            
            IntegrationOps["Integration Operations"]:::operation
        end
        
        subgraph UI["UI Components Layer"]
            direction TB
            
            subgraph Interfaces["Interface Components"]
                direction TB
                MediaInt["Media Interfaces"]:::interface
                InputInt["Input Interfaces"]:::interface
                SpecialInt["Specialized Interfaces"]:::interface
            end
            
            subgraph Layouts["Layout Components"]
                direction TB
                Spreadsheet["Spreadsheet"]:::layout
                Gantt["Gantt Chart"]:::layout
                TreeView["Tree View"]:::layout
            end
            
            subgraph Panels["Panel Components"]
                direction TB
                DataViz["Data Visualization"]:::panel
                Metrics["Metrics"]:::panel
            end
        end
        
        subgraph Extensions["Additional Extensions"]
            direction TB
            Themes["Themes"]:::theme
            Boilerplates["Boilerplates"]:::boilerplate
            Bundles["Bundles"]:::bundle
            Modules["Modules"]:::module
        end
        
        Infrastructure["Shared Infrastructure"]:::infra
    end
    
    %% Relationships
    AI --> AIServices
    AIServices --> Infrastructure
    Interfaces --> Infrastructure
    Layouts --> Infrastructure
    Panels --> Infrastructure
    Themes --> Infrastructure
    Boilerplates --> Infrastructure
    Bundles --> Infrastructure
    Modules --> Infrastructure
    
    %% Click Events
    click TextOps "https://github.com/directus-labs/extensions/tree/main/packages/ai-writer-operation"
    click ImageOps "https://github.com/directus-labs/extensions/tree/main/packages/ai-image-generation-operation"
    click SpeechOps "https://github.com/directus-labs/extensions/tree/main/packages/ai-speech-generation-operation"
    click MediaInt "https://github.com/directus-labs/extensions/tree/main/packages/audio-player-interface"
    click InputInt "https://github.com/directus-labs/extensions/tree/main/packages/switch-interface"
    click SpecialInt "https://github.com/directus-labs/extensions/tree/main/packages/address-completion-interface"
    click Spreadsheet "https://github.com/directus-labs/extensions/tree/main/packages/spreadsheet-layout"
    click Gantt "https://github.com/directus-labs/extensions/tree/main/packages/gantt-chart-layout"
    click TreeView "https://github.com/directus-labs/extensions/tree/main/packages/tree-view-table-layout"
    click DataViz "https://github.com/directus-labs/extensions/tree/main/packages/funnel-chart-panel"
    click Metrics "https://github.com/directus-labs/extensions/tree/main/packages/api-metric-panel"
    click Themes "https://github.com/directus-labs/extensions/tree/main/themes"
    click Boilerplates "https://github.com/directus-labs/extensions/tree/main/boilerplates"
    click Bundles "https://github.com/directus-labs/extensions/tree/main/packages/calculated-fields-bundle"
    click Modules "https://github.com/directus-labs/extensions/tree/main/packages/command-palette-module"
    
    %% Styling
    classDef operation fill:#2196F3,stroke:#1565C0,color:white
    classDef interface fill:#4CAF50,stroke:#2E7D32,color:white
    classDef layout fill:#FF9800,stroke:#EF6C00,color:white
    classDef panel fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef module fill:#F44336,stroke:#C62828,color:white
    classDef bundle fill:#FFD700,stroke:#FFA000,color:black
    classDef theme fill:#607D8B,stroke:#37474F,color:white
    classDef boilerplate fill:#795548,stroke:#4E342E,color:white
    classDef infra fill:#9E9E9E,stroke:#424242,color:white
```
