# langgenius/dify-plugins architecture

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

- Interactive diagram: https://gitdiagram.com/langgenius/dify-plugins
- Repository: https://github.com/langgenius/dify-plugins

## Overview

##### Project type and purpose
- This repository is an open-source plugin registry for the Dify AI platform, acting as the source of truth for all community and official “.difypkg” plugin packages.
- Its purpose is to provide a standardized layout for plugin code/artifacts, enforce publishing workflows, and feed the Dify Marketplace with ready-to-install plugins.

##### File structure
- Top-level directories:
- .github/ – PR templates & GitHub Actions workflows
- .assets/ – images used in README
- \<organization>/\<plugin>/… – subtree per publisher, containing one or more versioned .difypkg files
- Key files:
- README.md – project overview, plugin types, publishing guide
- CONTRIBUTING.md – contribution guidelines
- .github/workflows/*.yaml – CI: validation, packaging checks, auto-publish PRs

##### README for additional insights
- Describes Dify Plugins ecosystem: Models, Tools, Agent Strategies, Extensions, Bundles
- Outlines a multi-step publishing process: develop → package (`.difypkg`) → fork repository → open PR → merge → appear in Dify Marketplace
- Points to marketplace (marketplace.dify.ai) and docs (docs.dify.ai) consumed by end users

##### Elements
- Clear labels: “Contributor”, “GitHub Repo”, “CI/CD”, “Artifact Store”, “Marketplace Backend”, “Dify Cloud”, “End User”
-> PR open/merge
-> CI validation
-> Artifact publishing
-> Catalog indexing
-> Plugin installation requests
- Blue rectangles for repositories/services (GitHub, Marketplace)
- Orange parallelograms for CI/CD pipelines

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Users and External Actors
    Contributor(["Contributor"]):::user
    EndUser(["End User"]):::user

    %% GitHub Repository Subgraph
    subgraph "GitHub Repository" 
        direction TB
        RepoRoot["GitHub Repo"]:::repo
        README["README.md"]:::repo
        CONTRIBUTING["CONTRIBUTING.md"]:::repo
        PRTemplate[".github/pull_request_template.md"]:::repo
        Gitignore[".gitignore"]:::repo
        subgraph "Workflows" 
            direction TB
            PreCheck["pre-check-plugin.yaml"]:::ci
            UploadMerged["upload-merged-plugin.yaml"]:::ci
        end
        subgraph "Plugin Namespaces"
            direction TB
            FAI["financialdatasets.difypkg"]:::storage
            LO["openai_audio-0.0.4.difypkg"]:::storage
            AQL["agentql_tool_1.0.0.difypkg"]:::storage
        end
        Assets[".assets/"]:::repo
    end

    %% CI/CD Pipeline
    CICD["CI/CD Pipeline"]:::ci

    %% Artifact Storage
    ArtifactStore["Plugin Artifact Storage"]:::storage

    %% Marketplace Backend
    Marketplace["Dify Marketplace Backend"]:::service

    %% Cloud Instances
    subgraph "Dify Cloud / Self-Hosted"
        direction TB
        CloudInstance["Cloud Instance"]:::cloud
    end

    %% Relationships
    Contributor -->|push & open PR| RepoRoot
    RepoRoot -->|triggers on pull_request| PreCheck
    RepoRoot -->|triggers on push to main| UploadMerged
    PreCheck -->|validate & lint| CICD
    UploadMerged -->|publish artifacts| ArtifactStore
    ArtifactStore -->|index new versions| Marketplace
    Marketplace -->|serve plugin catalog API| CloudInstance
    CloudInstance -->|end user install| EndUser

    %% Click Events
    click README "https://github.com/langgenius/dify-plugins/blob/main/README.md"
    click CONTRIBUTING "https://github.com/langgenius/dify-plugins/blob/main/CONTRIBUTING.md"
    click PRTemplate "https://github.com/langgenius/dify-plugins/blob/main/.github/pull_request_template.md"
    click Gitignore "https://github.com/langgenius/dify-plugins/blob/main/.gitignore"
    click PreCheck "https://github.com/langgenius/dify-plugins/blob/main/.github/workflows/pre-check-plugin.yaml"
    click UploadMerged "https://github.com/langgenius/dify-plugins/blob/main/.github/workflows/upload-merged-plugin.yaml"
    click FAI "https://github.com/langgenius/dify-plugins/blob/main/FinancialAI/financialdatasets/financialdatasets.difypkg"
    click LO "https://github.com/langgenius/dify-plugins/blob/main/LogicOber/openai_audio/openai_audio-0.0.4.difypkg"
    click AQL "https://github.com/langgenius/dify-plugins/blob/main/AgentQL/agentql/agentql_tool_1.0.0.difypkg"
    click Assets "https://github.com/langgenius/dify-plugins/tree/main/.assets/"

    %% Styles
    classDef repo fill:#cce5ff,stroke:#000,stroke-width:1px
    classDef ci fill:#ffe5b4,stroke:#000,stroke-width:1px
    classDef storage fill:#b3ffb3,stroke:#000,stroke-width:1px
    classDef service fill:#cce5ff,stroke:#000,stroke-width:1px
    classDef cloud fill:#d9b3ff,stroke:#000,stroke-width:1px
    classDef user fill:#ffeb99,stroke:#000,stroke-width:1px
```
