# manozworld/the-cca-pavilion architecture

> Architecture diagram of the GitHub repository manozworld/the-cca-pavilion, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manozworld/the-cca-pavilion
- Repository: https://github.com/manozworld/the-cca-pavilion

## Overview

#### Purpose and delivery model
CCA Pavilion is a scheduled static publishing pipeline for Carolina Cricket Alliance weekend cricket summaries. It collects CricClubs results and standings, derives highlights, and rewrites a self-contained GitHub Pages document at `docs/index.html`. There is no application server or database.

Core repository surfaces:
- Runtime implementation: `scraper/scrape.py`
- Input scope and league mapping: `config.json`
- Published artifact: `docs/index.html`
- Automation entry point: `.github/workflows/weekly_summary.yml`

#### Execution entry points
The primary execution command is `python scraper/scrape.py`, after installing dependencies from `scraper/requirements.txt`. The same script is invoked by the GitHub Actions workflow on a Monday schedule and can be manually dispatched in GitHub Actions.

The workflow’s durable side effect is a commit containing regenerated `docs/index.html`; GitHub Pages serves that directory directly. Local runs use the same output path, enabling browser preview without separate build or hosting infrastructure.

#### Configuration boundary
`config.json` defines the CricClubs club identity, URL/base-site details, season year, formats, divisions, and per-division league IDs. The scraper treats it as the source of truth for crawl scope.

Each configured format/division expands into a scrape target. Missing (`null`) league IDs are intentionally skipped rather than blocking the complete weekly publication. This separates league administration from scraper logic.

#### CricClubs ingestion stage
`scraper/scrape.py` is the integration boundary with CricClubs. It fetches previous-weekend matches across configured leagues, then requests relevant match scorecards and standings/points-table data.

The scraper is designed for unreliable external HTTP: scorecard requests are rate-limited and retried; failed matches can be skipped so a partial upstream failure does not prevent publication. CricClubs is the system of record; this repository persists only rendered output rather than normalized source data.

#### Parsing and aggregation stage
Within `scraper/scrape.py`, fetched scorecards are transformed into match-level data: results, batting figures, and bowling figures. The script aggregates this across the weekend to identify milestones (50s, 100s, four- and five-wicket hauls) and select overall top batter and bowler.

Standings remain division-scoped, while weekend highlights span the configured match set. This is the key domain boundary between raw per-match extraction and presentation-ready weekly summary data.

#### Static presentation generation
`scraper/scrape.py` renders the assembled summary into `docs/index.html`. The generated page contains the complete presentation layer—HTML, inline styling, and inline JavaScript—so the published site has no runtime API calls or backend dependency. Google Fonts are the noted external browser-side asset.

`docs/index.html` is both build output and deployable artifact; changes should normally be made through the generator rather than manually, because scheduled execution overwrites it.

#### Automation and infrastructure
`.github/workflows/weekly_summary.yml` supplies the hosted scheduler and execution environment. It installs the Python runtime dependencies, runs the scraper, and commits/pushes regenerated content to the repository.

GitHub Actions is therefore the orchestration runtime, GitHub repository history is the publication handoff, and GitHub Pages is the serving layer. The principal operational dependencies are GitHub Actions/Pages and CricClubs availability.

Main entry points: [`scraper/scrape.py`](https://github.com/manozworld/the-cca-pavilion/blob/main/scraper/scrape.py) (Weekly summary generator), [`.github/workflows/weekly_summary.yml`](https://github.com/manozworld/the-cca-pavilion/blob/main/.github/workflows/weekly_summary.yml) (Weekly workflow), [`docs/index.html`](https://github.com/manozworld/the-cca-pavilion/blob/main/docs/index.html) (Generated summary page), [`config.json`](https://github.com/manozworld/the-cca-pavilion/blob/main/config.json) (League scope)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_automation["Automation"]
  node_workflow["Weekly workflow<br/>GitHub Actions workflow<br/>[weekly_summary.yml]"]
  node_requirements["Python dependencies<br/>dependency manifest<br/>[requirements.txt]"]
end

subgraph group_pipeline["Weekly pipeline"]
  node_config["League scope<br/>crawl configuration<br/>[config.json]"]
  node_scraper["Weekly summary generator<br/>Python pipeline<br/>[scrape.py]"]
  node_targets(("Configured league targets<br/>target expansion"))
  node_fetch["Resilient fetch<br/>HTTP ingestion<br/>[scrape.py]"]
  node_match_data["Match-level results<br/>parsed data<br/>[scrape.py]"]
  node_summary["Weekly highlights<br/>aggregation<br/>[scrape.py]"]
end

subgraph group_publishing["Publishing"]
  node_page["Generated summary page<br/>static HTML artifact<br/>[index.html]"]
  node_repository[("GitHub repository history<br/>publication handoff")]
  node_pages{{"GitHub Pages<br/>static hosting"}}
end

node_cricclubs{{"CricClubs<br/>external results system"}}
node_browser(("Readers' browser<br/>client"))

node_workflow -->|"installs"| node_requirements
node_workflow -->|"runs"| node_scraper
node_config -->|"expands"| node_targets
node_targets -->|"sets crawl scope"| node_scraper
node_scraper -->|"uses"| node_fetch
node_fetch -->|"fetches matches, scorecards, standings"| node_cricclubs
node_cricclubs -->|"source data"| node_match_data
node_match_data -->|"aggregates"| node_summary
node_summary -->|"renders"| node_page
node_scraper -->|"writes"| node_page
node_workflow -->|"commits and pushes"| node_repository
node_page -->|"published content"| node_repository
node_repository -->|"deployment handoff"| node_pages
node_pages -->|"serves"| node_browser

click node_workflow "https://github.com/manozworld/the-cca-pavilion/blob/main/.github/workflows/weekly_summary.yml"
click node_requirements "https://github.com/manozworld/the-cca-pavilion/blob/main/scraper/requirements.txt"
click node_config "https://github.com/manozworld/the-cca-pavilion/blob/main/config.json"
click node_scraper "https://github.com/manozworld/the-cca-pavilion/blob/main/scraper/scrape.py"
click node_fetch "https://github.com/manozworld/the-cca-pavilion/blob/main/scraper/scrape.py"
click node_match_data "https://github.com/manozworld/the-cca-pavilion/blob/main/scraper/scrape.py"
click node_summary "https://github.com/manozworld/the-cca-pavilion/blob/main/scraper/scrape.py"
click node_page "https://github.com/manozworld/the-cca-pavilion/blob/main/docs/index.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_requirements toneBlue
class node_config,node_scraper,node_targets,node_fetch,node_match_data,node_summary toneAmber
class node_page,node_repository,node_pages toneMint
class node_cricclubs,node_browser toneNeutral
```

## Components

### Automation

- [Weekly workflow](https://github.com/manozworld/the-cca-pavilion/blob/main/.github/workflows/weekly_summary.yml): GitHub Actions workflow · Scheduled Monday run with manual dispatch. · `.github/workflows/weekly_summary.yml`
- [Python dependencies](https://github.com/manozworld/the-cca-pavilion/blob/main/scraper/requirements.txt): dependency manifest · `scraper/requirements.txt`

### Weekly pipeline

- [League scope](https://github.com/manozworld/the-cca-pavilion/blob/main/config.json): crawl configuration · Formats, divisions, and league IDs define scrape targets. · `config.json`
- [Weekly summary generator](https://github.com/manozworld/the-cca-pavilion/blob/main/scraper/scrape.py): Python pipeline · Single runtime for ingestion, aggregation, and rendering. · `scraper/scrape.py`
- **Configured league targets**: target expansion · Null league IDs are skipped.
- [Resilient fetch](https://github.com/manozworld/the-cca-pavilion/blob/main/scraper/scrape.py): HTTP ingestion · Rate-limits and retries scorecards; failed matches may be skipped. · `scraper/scrape.py`
- [Match-level results](https://github.com/manozworld/the-cca-pavilion/blob/main/scraper/scrape.py): parsed data · Results plus batting and bowling figures. · `scraper/scrape.py`
- [Weekly highlights](https://github.com/manozworld/the-cca-pavilion/blob/main/scraper/scrape.py): aggregation · Weekend milestones and top performers; standings stay division-scoped. · `scraper/scrape.py`

### Publishing

- [Generated summary page](https://github.com/manozworld/the-cca-pavilion/blob/main/docs/index.html): static HTML artifact · Self-contained HTML with inline CSS and JavaScript. · `docs/index.html`
- **GitHub repository history**: publication handoff · Workflow commits regenerated page content.
- **GitHub Pages**: static hosting · Serves the docs directory directly.

### Other components

- **CricClubs**: external results system · System of record for matches, scorecards, and standings.
- **Readers' browser**: client · Loads Google Fonts as the only noted browser-side external asset.

## Connections

- Weekly workflow → Python dependencies: installs
- Weekly workflow → Weekly summary generator: runs
- League scope → Configured league targets: expands
- Configured league targets → Weekly summary generator: sets crawl scope
- Weekly summary generator → Resilient fetch: uses
- Resilient fetch → CricClubs: fetches matches, scorecards, standings
- CricClubs → Match-level results: source data
- Match-level results → Weekly highlights: aggregates
- Weekly highlights → Generated summary page: renders
- Weekly summary generator → Generated summary page: writes
- Weekly workflow → GitHub repository history: commits and pushes
- Generated summary page → GitHub repository history: published content
- GitHub repository history → GitHub Pages: deployment handoff
- GitHub Pages → Readers' browser: serves
