# yuangezhizao/6dylan6-jdpro architecture

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

- Interactive diagram: https://gitdiagram.com/yuangezhizao/6dylan6-jdpro
- Repository: https://github.com/yuangezhizao/6dylan6-jdpro

## Overview

##### Main Components
- Task Executor/Script Engine: Represent the many individual scripts (named “jd_*”, “jx_*”, etc.) that perform operations. These scripts form the core of the application.
- Configuration Management: Depicted by the “config” directory and the dynamic environment variables (e.g., JD_COOKIE, notification keys, proxy settings). This component loads system configurations.
- Notification Module: Highlight components like “sendNotify.js/sendNotify.py” and references in the README that cover multiple notification methods (server酱, tg bot, enterprise chat bots, etc.).
- Utility Modules: Include “function” and “utils” directories. These include helper functions, caching (e.g., function/cache), common libraries, proxies, and specialized modules like “Rebels” for enhanced operations.
- Backup/Safe Scripts: The “backUp” directory with additional scripts to manage or kill keys shows that there is a secondary safety or management layer.

##### Relationships and Data Flow
- The Configuration Module feeds critical information (such as cookies, proxies, and API keys) into both the Task Executor and Notification Module.
- The Task Executor reads from the configuration to run the JD (and related) tasks. It concurrently executes scripts as determined by Cron jobs in Qinglong.
- The Notification Module receives status updates or alerts from the Task Executor and then dispatches messages via various integrated platforms.
- The Utility Modules support common operations (like encryption, token generation, cache management) that are used by many JD task scripts.
- Docker (and its associated scripts) acts as the deployment and orchestration layer, ensuring that all modules are correctly containerized and that tasks run in the intended environment.

##### Architectural Patterns & Design Principles
- Modularity: The file structure is clearly modular (with separate directories for functions, utilities, backUp, and docker). Each module is responsible for a distinct aspect of the system.
- Configuration Driven: Environment variables and configuration files (found in “config”) are central in determining behavior. This separation ensures that deployments can be customized easily.
- Extensibility: The use of multiple similarly prefixed scripts (jd_, jx_, etc.) suggests that new tasks can be added modularly.
- Deployment and Containerization: The docker directory demonstrates a best practice of containerization for deployment in stable environments (like the specified Qinglong Docker image).

##### Relevant Technologies, Frameworks, and Libraries
- JavaScript: The core language used for tasks.
- Python: Some Python scripts indicate cross-language support.
- Docker & Docker Compose: For containerization and orchestration.
- Qinglong Environment: As the scheduling and execution system.
- Notification APIs: Integration with various messaging platforms (server酱, go-cqhttp, etc.).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Core Modules"
        subgraph "Configuration Management"
            configDir["Config Directory (config)"]:::config
            configUtil["Config Utility (function/config.js)"]:::config
        end
        subgraph "Utility Modules"
            utilFunc["Utility Functions (function)"]:::utility
            utils["Utilities (utils)"]:::utility
        end
        taskExec["Task Executor/Script Engine"]:::core
        subgraph "Notification Module"
            notifRoot["SendNotify (sendNotify.js/sendNotify.py)"]:::notif
            notifUtil["Notification Utility (function/sendNotify.js)"]:::notif
        end
    end

    subgraph "Deployment & Backup"
        docker["Docker Infrastructure"]:::deploy
        backUp["Backup/Safe Scripts"]:::deploy
    end

    %% Relationships
    configDir -->|"feeds"| taskExec
    configUtil -->|"feeds"| taskExec
    utilFunc -->|"supports"| taskExec
    utils -->|"supports"| taskExec

    taskExec -->|"alerts"| notifRoot
    utilFunc -->|"supports"| notifRoot
    utils -->|"supports"| notifRoot

    docker -->|"orchestrates"| taskExec
    docker -->|"manages"| backUp

    %% Styles
    classDef core fill:#AED6F1,stroke:#2471A3,stroke-width:2px;
    classDef config fill:#A9DFBF,stroke:#28B463,stroke-width:2px;
    classDef notif fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
    classDef utility fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef deploy fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px;

    %% Click Events
    click taskExec "https://github.com/yuangezhizao/6dylan6-jdpro/blob/main/jd_3c_task.js"
    click configDir "https://github.com/yuangezhizao/6dylan6-jdpro/blob/main/config/CK_WxPusherUid.json"
    click configUtil "https://github.com/yuangezhizao/6dylan6-jdpro/blob/main/function/config.js"
    click notifRoot "https://github.com/yuangezhizao/6dylan6-jdpro/blob/main/sendNotify.js"
    click notifUtil "https://github.com/yuangezhizao/6dylan6-jdpro/blob/main/function/sendNotify.js"
    click utilFunc "https://github.com/yuangezhizao/6dylan6-jdpro/tree/main/function"
    click utils "https://github.com/yuangezhizao/6dylan6-jdpro/tree/main/utils"
    click docker "https://github.com/yuangezhizao/6dylan6-jdpro/tree/main/docker"
    click backUp "https://github.com/yuangezhizao/6dylan6-jdpro/tree/main/backUp"
```
