# agluo/ql-script-hub architecture

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

- Interactive diagram: https://gitdiagram.com/agluo/ql-script-hub
- Repository: https://github.com/agluo/ql-script-hub

## Overview

##### Project Type and Purpose
- QL Script Hub is not a web app or microservice suite but a scheduler-driven automation toolkit.
- It lives inside the QingLong 面板 (a Node.js-based cron scheduler) and provides a library of standalone Python scripts for “签到” (check-in) and “薅羊毛” (coupon-hunting) tasks against various target websites.

##### File‐Structure Analysis
- Top‐level: a flat list of .py scripts, each named after a target (e.g., aliyunpan_checkin.py, enshan_checkin.py).
- archive/: older or deprecated scripts.
- No frontend, no database, no shared library code—each script is self-contained.
- Configuration is 100% via environment variables (set in QingLong).

##### README Insights
- Key components: QingLong 面板 (scheduler), Python 运行时, environment-vars (cookies, tokens), external target sites (Alipay, NGA, Tieba, etc.), and notification endpoints (Telegram, Server酱, Push+).
- Usage pattern: subscribe repo in QingLong → set env vars → scripts run on cron → notifications on each run.

a. Main Components
- QingLong 面板 (Cron Scheduler on Node.js)
- Python Runtime Environment (hosted on the same server as QingLong)
- Script Modules (one per .py file)
- Environment‐Variable Store (within QingLong)
- External Target Websites (各大论坛/网盘)
- Notification Services (Telegram Bot, Server酱, Push+, DingTalk, Bark)

b. Relationships & Interactions
- Scheduler → launches Python interpreter → loads specific script module
- Script → reads its required env vars → makes HTTP(S) requests to target website → parses response
- Script → on success/failure → posts message to selected notification service via its API → user receives notification

c. Architectural Patterns & Principles
- Modular/Plugin Architecture: each script acts as an independent plugin with a uniform interface (read config, perform task, emit result).
- Centralized Configuration: environment variables decouple code from credentials.
- Single Responsibility: each script handles exactly one target site.
- Cron‐Driven Event Loop: no persistent servers or message queues—purely scheduled runs.

d. Key Technologies & Frameworks
- QingLong 面板 (Node.js, Express, Cron)
- Python 3.x (requests, json, os.environ)
- External HTTP APIs (web scraping or official REST endpoints)
- Notification APIs (Telegram Bot API, Server酱 HTTP, Push+ HTTP, DingTalk Robot webhook, Bark)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Internal Components
    subgraph "Internal Components"
        QL["QingLong 面板 (Scheduler)"]:::internal
        PY["Python Runtime Environment"]:::internal
        CFG["Config Store (Env Vars)"]:::config
        subgraph "Script Modules"
            SMGroup(["Script Modules"]):::internal
            SFSU["SFSU Check-in"] 
            SMZDM["SMZDM Check-in"]
            ALI["Aliyun Pan (Cloud Drive)"]
            BAIDU["Baidu Wangpan"]
            DEEP["DeepFlood"]
            ENSHAN["Enshan Forum"]
            IKUUU["IkuuU"]
            NGA["NGA Forum"]
            NODE["NodeSeek"]
            QUARK["Quark Sign-in"]
            TIEBA["Tieba Forum"]
            TYNET["Tianyi Netdisk"]
            ARCH["leaflow_checkin.py (Deprecated)"]
        end
    end

    %% External Integrations
    subgraph "External Integrations"
        TW["Target Websites"]:::integration
        NS["Notification Services"]:::integration
    end

    %% Documentation
    subgraph "Documentation"
        README["README.md"]
        LICENSE["LICENSE"]
    end

    %% Connections
    QL -->|"trigger"| PY
    PY -->|"load config"| CFG
    PY -->|"execute plugin"| SMGroup
    SMGroup -->|"load config"| CFG
    SMGroup -->|"request/check-in"| TW
    SMGroup -->|"notify"| NS

    %% Click Events
    click SFSU "https://github.com/agluo/ql-script-hub/blob/master/SFSU_checkin.py"
    click SMZDM "https://github.com/agluo/ql-script-hub/blob/master/SMZDM_checkin.py"
    click ALI "https://github.com/agluo/ql-script-hub/blob/master/aliyunpan_checkin.py"
    click BAIDU "https://github.com/agluo/ql-script-hub/blob/master/baiduwangpan_checkin.py"
    click DEEP "https://github.com/agluo/ql-script-hub/blob/master/deepflood_checkin.py"
    click ENSHAN "https://github.com/agluo/ql-script-hub/blob/master/enshan_checkin.py"
    click IKUUU "https://github.com/agluo/ql-script-hub/blob/master/ikuuu_checkin.py"
    click NGA "https://github.com/agluo/ql-script-hub/blob/master/nga_checkin.py"
    click NODE "https://github.com/agluo/ql-script-hub/blob/master/nodeseek_checkin.py"
    click QUARK "https://github.com/agluo/ql-script-hub/blob/master/quark_signin.py"
    click TIEBA "https://github.com/agluo/ql-script-hub/blob/master/tieba_checkin.py"
    click TYNET "https://github.com/agluo/ql-script-hub/blob/master/ty_netdisk_checkin.py"
    click ARCH "https://github.com/agluo/ql-script-hub/blob/master/archive/leaflow_checkin.py"
    click README "https://github.com/agluo/ql-script-hub/blob/master/README.md"
    click LICENSE "https://github.com/agluo/ql-script-hub/tree/master/LICENSE"

    %% Styles
    classDef internal fill:#cce5ff,stroke:#3399ff
    classDef config fill:#ffe5cc,stroke:#ff9933
    classDef integration fill:#e6ffe6,stroke:#33cc33
```
