flowchart TD
subgraph group_policy["Policy and lifecycle"]
node_plugin["Plugin lifecycle<br/>[PicbedPlugin.java]"]
node_watcher["Policy watcher"]
node_policy_config["Storage policy"]
end
subgraph group_attachment["Attachment workflow"]
node_handler["Attachment handler"]
node_filename["Object-key generator"]
node_attachment_record["Halo attachment"]
end
subgraph group_github["GitHub storage"]
node_token_secret[("Halo token Secret")]
node_github_api["GitHub REST API"]
node_repository[("GitHub repository")]
node_custom_domain["Custom public domain"]
end
node_halo(("Halo administrator"))
node_plugin -->|"disposes"| node_watcher
node_halo -->|"configures"| node_policy_config
node_watcher -->|"watches changes"| node_policy_config
node_halo -->|"uploads or deletes"| node_handler
node_handler -->|"reads settings"| node_policy_config
node_handler -->|"generates object key"| node_filename
node_handler -->|"reads token"| node_token_secret
node_handler -->|"sends upload/delete requests"| node_github_api
node_github_api -->|"writes or deletes files"| node_repository
node_handler -->|"creates metadata"| node_attachment_record
node_attachment_record -->|"builds public link"| node_custom_domain
click node_plugin "https://github.com/dominic-kk/halo-plugin-picbed/blob/main/src/main/java/top/dominickk/picbed/PicbedPlugin.java"
click node_watcher "https://github.com/dominic-kk/halo-plugin-picbed/blob/main/src/main/java/top/dominickk/picbed/PolicyConfigWatcher.java"
click node_policy_config "https://github.com/dominic-kk/halo-plugin-picbed/blob/main/src/main/resources/extensions/setting-picbed.yaml"
click node_handler "https://github.com/dominic-kk/halo-plugin-picbed/blob/main/src/main/java/top/dominickk/picbed/provider/GitHubAttachmentHandler.java"
click node_filename "https://github.com/dominic-kk/halo-plugin-picbed/blob/main/src/main/java/top/dominickk/picbed/tools/FileNameGenerator.java"
click node_attachment_record "https://github.com/dominic-kk/halo-plugin-picbed/blob/main/src/main/java/top/dominickk/picbed/provider/GitHubAttachmentHandler.java"
click node_token_secret "https://github.com/dominic-kk/halo-plugin-picbed/blob/main/src/main/java/top/dominickk/picbed/provider/GitHubAttachmentHandler.java"
classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_plugin,node_watcher,node_policy_config toneBlue
class node_handler,node_filename,node_attachment_record toneAmber
class node_token_secret,node_github_api,node_repository,node_custom_domain toneMint
class node_halo toneIndigo