# 1391959853/jd-ios-ck architecture

> Architecture diagram of the GitHub repository 1391959853/jd-ios-ck, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/1391959853/jd-ios-ck
- Repository: https://github.com/1391959853/jd-ios-ck

## Overview

This repository provides Quantumult X rewrite, traffic-routing, and reusable snippet rules, alongside automation that synchronizes those artifacts from an upstream repository. The user workflow is to import rules locally or reference them remotely in Quantumult X. The documented sync script also copies upstream rule directories, calculates rule statistics, and updates repository status documentation. Edges rely on the README or the shown portions of sync.py; unsampled workflow details are not inferred.

Main entry points: [`sync.py`](https://github.com/1391959853/jd-ios-ck/blob/main/sync.py) (Sync automation), [`qx/rewrite`](https://github.com/1391959853/jd-ios-ck/tree/main/qx/rewrite) (Rewrite rules), [`qx/rules`](https://github.com/1391959853/jd-ios-ck/tree/main/qx/rules) (Routing rules), [`qx/snippet`](https://github.com/1391959853/jd-ios-ck/tree/main/qx/snippet) (Reusable snippets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sync["Rule synchronization"]
  node_sync_script["Sync automation<br/>[sync.py]"]
end

subgraph group_artifacts["QX rule artifacts"]
  node_rewrite["Rewrite rules"]
  node_routing["Routing rules"]
  node_snippets["Reusable snippets"]
end

subgraph group_reporting["Sync reporting"]
  node_statistics["Rule statistics<br/>[sync.py]"]
  node_status_docs["Sync status docs<br/>[sync.py]"]
end

node_upstream(("Upstream rules"))
node_quantumult(("Quantumult X"))

node_upstream -->|"syncs from"| node_sync_script
node_sync_script -->|"copies rules"| node_rewrite
node_sync_script -->|"copies rules"| node_routing
node_sync_script -->|"copies snippets"| node_snippets
node_quantumult -->|"imports or fetches"| node_rewrite
node_quantumult -->|"imports or fetches"| node_routing
node_quantumult -->|"includes"| node_snippets
node_sync_script -->|"calculates"| node_statistics
node_sync_script -->|"updates"| node_status_docs

click node_sync_script "https://github.com/1391959853/jd-ios-ck/blob/main/sync.py"
click node_rewrite "https://github.com/1391959853/jd-ios-ck/tree/main/qx/rewrite"
click node_routing "https://github.com/1391959853/jd-ios-ck/tree/main/qx/rules"
click node_snippets "https://github.com/1391959853/jd-ios-ck/tree/main/qx/snippet"
click node_statistics "https://github.com/1391959853/jd-ios-ck/blob/main/sync.py"
click node_status_docs "https://github.com/1391959853/jd-ios-ck/blob/main/sync.py"

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_sync_script toneBlue
class node_rewrite,node_routing,node_snippets toneAmber
class node_statistics,node_status_docs toneMint
class node_upstream,node_quantumult toneIndigo
```

## Components

### Rule synchronization

- [Sync automation](https://github.com/1391959853/jd-ios-ck/blob/main/sync.py): `sync.py`

### QX rule artifacts

- [Rewrite rules](https://github.com/1391959853/jd-ios-ck/tree/main/qx/rewrite): `qx/rewrite`
- [Routing rules](https://github.com/1391959853/jd-ios-ck/tree/main/qx/rules): `qx/rules`
- [Reusable snippets](https://github.com/1391959853/jd-ios-ck/tree/main/qx/snippet): `qx/snippet`

### Sync reporting

- [Rule statistics](https://github.com/1391959853/jd-ios-ck/blob/main/sync.py): `sync.py`
- [Sync status docs](https://github.com/1391959853/jd-ios-ck/blob/main/sync.py): `sync.py`

### Other components

- **Upstream rules**
- **Quantumult X**

## Connections

- Upstream rules → Sync automation: syncs from (evidence: `README.md`)
- Sync automation → Rewrite rules: copies rules (evidence: `sync.py`)
- Sync automation → Routing rules: copies rules (evidence: `sync.py`)
- Sync automation → Reusable snippets: copies snippets (evidence: `sync.py`)
- Quantumult X → Rewrite rules: imports or fetches (evidence: `README.md`)
- Quantumult X → Routing rules: imports or fetches (evidence: `README.md`)
- Quantumult X → Reusable snippets: includes (evidence: `README.md`)
- Sync automation → Rule statistics: calculates (evidence: `sync.py`)
- Sync automation → Sync status docs: updates (evidence: `sync.py`)
