# yuxiaopeng/github-ranking-ai architecture

> Architecture diagram of the GitHub repository yuxiaopeng/github-ranking-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yuxiaopeng/github-ranking-ai
- Repository: https://github.com/yuxiaopeng/github-ranking-ai

## Overview

This repository generates category-based GitHub repository rankings: it queries GitHub’s GraphQL API for star-sorted repositories, normalizes the results, then publishes top-10 tables and top-100 pages and archives the collected data as a dated CSV. The main entry point coordinates retrieval and these output stages. The graph follows the sampled Python code and README; the scheduled-update workflow is not included because its implementation was not sampled.

Main entry points: [`source/process.py`](https://github.com/yuxiaopeng/github-ranking-ai/blob/main/source/process.py) (Output builder), [`source/common.py`](https://github.com/yuxiaopeng/github-ranking-ai/blob/main/source/common.py) (GitHub API helpers), [`README.md`](https://github.com/yuxiaopeng/github-ranking-ai/blob/main/README.md) (Ranking README), [`Top100`](https://github.com/yuxiaopeng/github-ranking-ai/tree/main/Top100) (Category rankings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Collection"]
  node_entry["Ranking runner<br/>[process.py]"]
  node_queries["Category queries<br/>[process.py]"]
  node_helpers["GitHub API helpers<br/>[common.py]"]
end

subgraph group_publishing["Publishing"]
  node_writer["Output builder<br/>[process.py]"]
  node_readme["Ranking README<br/>[README.md]"]
  node_top100["Category rankings"]
end

subgraph group_archive["Data archive"]
  node_csv["Dated ranking CSV"]
end

node_operator(("Update runner"))
node_github{{"GitHub GraphQL"}}

node_operator -.->|"runs"| node_entry
node_entry -->|"loads categories"| node_queries
node_queries -->|"requests data"| node_helpers
node_helpers -->|"posts query"| node_github
node_entry -->|"builds outputs"| node_writer
node_writer -->|"writes top ten"| node_readme
node_writer -->|"writes top hundred"| node_top100
node_writer -->|"saves rankings"| node_csv

click node_entry "https://github.com/yuxiaopeng/github-ranking-ai/blob/main/source/process.py"
click node_queries "https://github.com/yuxiaopeng/github-ranking-ai/blob/main/source/process.py"
click node_helpers "https://github.com/yuxiaopeng/github-ranking-ai/blob/main/source/common.py"
click node_writer "https://github.com/yuxiaopeng/github-ranking-ai/blob/main/source/process.py"
click node_readme "https://github.com/yuxiaopeng/github-ranking-ai/blob/main/README.md"
click node_top100 "https://github.com/yuxiaopeng/github-ranking-ai/tree/main/Top100"
click node_csv "https://github.com/yuxiaopeng/github-ranking-ai/tree/main/Data"

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_entry,node_queries,node_helpers toneBlue
class node_writer,node_readme,node_top100 toneAmber
class node_csv toneMint
class node_operator,node_github toneIndigo
```

## Components

### Collection

- [Ranking runner](https://github.com/yuxiaopeng/github-ranking-ai/blob/main/source/process.py): `source/process.py`
- [Category queries](https://github.com/yuxiaopeng/github-ranking-ai/blob/main/source/process.py): `source/process.py`
- [GitHub API helpers](https://github.com/yuxiaopeng/github-ranking-ai/blob/main/source/common.py): `source/common.py`

### Publishing

- [Output builder](https://github.com/yuxiaopeng/github-ranking-ai/blob/main/source/process.py): `source/process.py`
- [Ranking README](https://github.com/yuxiaopeng/github-ranking-ai/blob/main/README.md): `README.md`
- [Category rankings](https://github.com/yuxiaopeng/github-ranking-ai/tree/main/Top100): `Top100`

### Data archive

- [Dated ranking CSV](https://github.com/yuxiaopeng/github-ranking-ai/tree/main/Data): `Data`

### Other components

- **Update runner**
- **GitHub GraphQL**

## Connections

- Update runner → Ranking runner: runs
- Ranking runner → Category queries: loads categories (evidence: `source/process.py`)
- Category queries → GitHub API helpers: requests data (evidence: `source/process.py`)
- GitHub API helpers → GitHub GraphQL: posts query (evidence: `source/common.py`)
- Ranking runner → Output builder: builds outputs (evidence: `source/process.py`)
- Output builder → Ranking README: writes top ten (evidence: `source/process.py`)
- Output builder → Category rankings: writes top hundred (evidence: `source/process.py`)
- Output builder → Dated ranking CSV: saves rankings (evidence: `source/process.py`)
