# sntl84/sntl84-repo-counter architecture

> Architecture diagram of the GitHub repository sntl84/sntl84-repo-counter, 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/sntl84/sntl84-repo-counter
- Repository: https://github.com/sntl84/sntl84-repo-counter

## Overview

This repository automates a GitHub repository-statistics report and provides a separate live browser dashboard. The scheduled workflow runs the counter, which gathers GitHub data, aggregates it, and updates marked sections of the README; dashboard visitors fetch GitHub data directly and view rendered statistics. The README documents the workflow and dashboard capabilities; source excerpts show the counter’s API requests and README update. Dashboard internals and workflow implementation were not sampled, so those details are limited to documented behavior.

Main entry points: [`scripts/count_repos.py`](https://github.com/sntl84/sntl84-repo-counter/blob/main/scripts/count_repos.py) (Counter Engine), [`sntl84-Client-Dashboard.html`](https://github.com/sntl84/sntl84-repo-counter/blob/main/sntl84-Client-Dashboard.html) (Browser Dashboard), [`.github/workflows/update-repo-count.yml`](https://github.com/sntl84/sntl84-repo-counter/blob/main/.github/workflows/update-repo-count.yml) (Update Workflow), [`README.md`](https://github.com/sntl84/sntl84-repo-counter/blob/main/README.md) (README Report)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_automation["Scheduled Counter"]
  node_workflow["Update Workflow"]
  node_counter["Counter Engine<br/>[count_repos.py]"]
end

subgraph group_reporting["README Report"]
  node_stats["Stats and Repo List<br/>[count_repos.py]"]
  node_readme["README Report<br/>[README.md]"]
end

subgraph group_dashboard["Live Dashboard"]
  node_dashboard["Browser Dashboard"]
end

subgraph group_integrations["GitHub Services"]
  node_rest["GitHub REST API"]
  node_graphql["GitHub GraphQL API"]
end

node_schedule(("Timer or Push"))
node_visitor(("Dashboard Visitor"))

node_schedule -->|"triggers"| node_workflow
node_workflow -->|"runs"| node_counter
node_counter -->|"queries"| node_graphql
node_counter -->|"fetches repos"| node_rest
node_counter -->|"aggregates"| node_stats
node_counter -->|"patches"| node_readme
node_visitor -->|"opens"| node_dashboard
node_dashboard -->|"fetches data"| node_rest
node_dashboard -->|"fetches contributions"| node_graphql

click node_workflow "https://github.com/sntl84/sntl84-repo-counter/blob/main/.github/workflows/update-repo-count.yml"
click node_counter "https://github.com/sntl84/sntl84-repo-counter/blob/main/scripts/count_repos.py"
click node_stats "https://github.com/sntl84/sntl84-repo-counter/blob/main/scripts/count_repos.py"
click node_readme "https://github.com/sntl84/sntl84-repo-counter/blob/main/README.md"
click node_dashboard "https://github.com/sntl84/sntl84-repo-counter/blob/main/sntl84-Client-Dashboard.html"

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_workflow,node_counter toneBlue
class node_stats,node_readme toneAmber
class node_dashboard toneMint
class node_rest,node_graphql toneRose
class node_schedule,node_visitor toneIndigo
```

## Components

### Scheduled Counter

- [Update Workflow](https://github.com/sntl84/sntl84-repo-counter/blob/main/.github/workflows/update-repo-count.yml): `.github/workflows/update-repo-count.yml`
- [Counter Engine](https://github.com/sntl84/sntl84-repo-counter/blob/main/scripts/count_repos.py): `scripts/count_repos.py`

### README Report

- [Stats and Repo List](https://github.com/sntl84/sntl84-repo-counter/blob/main/scripts/count_repos.py): `scripts/count_repos.py`
- [README Report](https://github.com/sntl84/sntl84-repo-counter/blob/main/README.md): `README.md`

### Live Dashboard

- [Browser Dashboard](https://github.com/sntl84/sntl84-repo-counter/blob/main/sntl84-Client-Dashboard.html): `sntl84-Client-Dashboard.html`

### GitHub Services

- **GitHub REST API**
- **GitHub GraphQL API**

### Other components

- **Timer or Push**
- **Dashboard Visitor**

## Connections

- Timer or Push → Update Workflow: triggers (evidence: `README.md`)
- Update Workflow → Counter Engine: runs (evidence: `README.md`)
- Counter Engine → GitHub GraphQL API: queries (evidence: `scripts/count_repos.py`)
- Counter Engine → GitHub REST API: fetches repos (evidence: `scripts/count_repos.py`)
- Counter Engine → Stats and Repo List: aggregates (evidence: `scripts/count_repos.py`)
- Counter Engine → README Report: patches (evidence: `scripts/count_repos.py`)
- Dashboard Visitor → Browser Dashboard: opens (evidence: `README.md`)
- Browser Dashboard → GitHub REST API: fetches data (evidence: `README.md`)
- Browser Dashboard → GitHub GraphQL API: fetches contributions (evidence: `README.md`)
