# qajulio/gha-run architecture

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

- Interactive diagram: https://gitdiagram.com/qajulio/gha-run
- Repository: https://github.com/qajulio/gha-run

## Overview

Corridas SP collects São Paulo running-event listings from sports websites and APIs, consolidates and date-orders the results, then generates HTML and Markdown reports. The main runtime path is visible in `src/main.js`; `src/scrapers.js` contains multiple provider integrations and parsing logic, while `src/report.js` handles deduplication and presentation. The excerpts do not expose every scraper or the complete `scrapeAll` implementation, so provider wiring is represented collectively. Report destinations are described by the runner and README, but are not present in the supplied tree.

Main entry points: [`src/main.js`](https://github.com/qajulio/gha-run/blob/main/src/main.js) (Run collection), [`src/scrapers.js`](https://github.com/qajulio/gha-run/blob/main/src/scrapers.js) (Provider scrapers), [`src/report.js`](https://github.com/qajulio/gha-run/blob/main/src/report.js) (Deduplicate events)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Event collection"]
  node_scrapers["Provider scrapers<br/>[scrapers.js]"]
  node_events["Collected events<br/>[scrapers.js]"]
end

subgraph group_processing["Consolidation"]
  node_dedupe["Deduplicate events<br/>[report.js]"]
  node_date_order["Date ordering<br/>[main.js]"]
end

subgraph group_presentation["Report generation"]
  node_html_report["HTML report<br/>[report.js]"]
  node_markdown_report["Markdown report<br/>[report.js]"]
end

node_runner["Run collection<br/>[main.js]"]
node_race_sites{{"Sports sites and APIs"}}
node_html_file["HTML output"]
node_markdown_file["Markdown output"]
node_reader(("Report reader"))

node_runner -->|"calls collection"| node_scrapers
node_scrapers -->|"fetches listings"| node_race_sites
node_scrapers -->|"returns events"| node_events
node_runner -->|"deduplicates"| node_dedupe
node_runner -->|"sorts dates"| node_date_order
node_runner -->|"generates HTML"| node_html_report
node_runner -->|"generates Markdown"| node_markdown_report
node_runner -->|"writes report"| node_html_file
node_runner -->|"writes report"| node_markdown_file
node_reader -.->|"views report"| node_html_file

click node_runner "https://github.com/qajulio/gha-run/blob/main/src/main.js"
click node_scrapers "https://github.com/qajulio/gha-run/blob/main/src/scrapers.js"
click node_events "https://github.com/qajulio/gha-run/blob/main/src/scrapers.js"
click node_dedupe "https://github.com/qajulio/gha-run/blob/main/src/report.js"
click node_date_order "https://github.com/qajulio/gha-run/blob/main/src/main.js"
click node_html_report "https://github.com/qajulio/gha-run/blob/main/src/report.js"
click node_markdown_report "https://github.com/qajulio/gha-run/blob/main/src/report.js"

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_scrapers,node_events toneBlue
class node_dedupe,node_date_order toneAmber
class node_html_report,node_markdown_report,node_race_sites toneMint
class node_runner toneTeal
class node_html_file,node_markdown_file,node_reader toneIndigo
```

## Components

### Event collection

- [Provider scrapers](https://github.com/qajulio/gha-run/blob/main/src/scrapers.js): `src/scrapers.js`
- [Collected events](https://github.com/qajulio/gha-run/blob/main/src/scrapers.js): `src/scrapers.js`

### Consolidation

- [Deduplicate events](https://github.com/qajulio/gha-run/blob/main/src/report.js): `src/report.js`
- [Date ordering](https://github.com/qajulio/gha-run/blob/main/src/main.js): `src/main.js`

### Report generation

- [HTML report](https://github.com/qajulio/gha-run/blob/main/src/report.js): `src/report.js`
- [Markdown report](https://github.com/qajulio/gha-run/blob/main/src/report.js): `src/report.js`

### Other components

- [Run collection](https://github.com/qajulio/gha-run/blob/main/src/main.js): `src/main.js`
- **Sports sites and APIs**
- **HTML output**
- **Markdown output**
- **Report reader**

## Connections

- Run collection → Provider scrapers: calls collection (evidence: `src/main.js`)
- Provider scrapers → Sports sites and APIs: fetches listings (evidence: `src/scrapers.js`)
- Provider scrapers → Collected events: returns events (evidence: `src/main.js`)
- Run collection → Deduplicate events: deduplicates (evidence: `src/main.js`)
- Run collection → Date ordering: sorts dates (evidence: `src/main.js`)
- Run collection → HTML report: generates HTML (evidence: `src/main.js`)
- Run collection → Markdown report: generates Markdown (evidence: `src/main.js`)
- Run collection → HTML output: writes report (evidence: `src/main.js`)
- Run collection → Markdown output: writes report (evidence: `src/main.js`)
- Report reader → HTML output: views report (evidence: `README.md`)
