# kingmaker1234/cricbuzz_cricket_score architecture

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

- Interactive diagram: https://gitdiagram.com/kingmaker1234/cricbuzz_cricket_score
- Repository: https://github.com/kingmaker1234/cricbuzz_cricket_score

## Overview

This is a manual cricket-data collection and reporting dashboard. A user clicks Fetch Latest Cricket Data; the Streamlit app launches the scraper, which visits Cricbuzz, extracts match-card details, captures a screenshot, and saves records to SQLite. The dashboard reads latest matches and history for its views, and can generate and offer an Excel workbook. The graph separates collection, persistence, and presentation/reporting responsibilities. The scraper excerpt is partial, so some implementation details are represented only where the README documents them.

Main entry points: [`app.py`](https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/app.py) (Streamlit Dashboard), [`scraper.py`](https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/scraper.py) (Scraper Process), [`database.py`](https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/database.py) (SQLite Storage API), [`reports.py`](https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/reports.py) (Excel Report Builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Match Collection"]
  node_scraper_process["Scraper Process<br/>[scraper.py]"]
  node_browser["Playwright Browser<br/>[scraper.py]"]
  node_match_extraction["Match Extraction<br/>[scraper.py]"]
  node_score_status["Score and Status Parsing<br/>[scraper.py]"]
  node_screenshots["Screenshot Archive"]
end

subgraph group_storage["Data Storage"]
  node_database_api["SQLite Storage API<br/>[database.py]"]
  node_score_store[("Score History Store<br/>[cricket_scores.db]")]
end

subgraph group_presentation["Dashboard and Reports"]
  node_dashboard["Streamlit Dashboard<br/>[app.py]"]
  node_dashboard_views["Match and History Views<br/>[app.py]"]
  node_report_builder["Excel Report Builder<br/>[reports.py]"]
  node_workbooks["Excel Reports"]
end

node_user(("Dashboard User"))
node_cricbuzz["Cricbuzz"]

node_user -->|"uses"| node_dashboard
node_dashboard -->|"launches"| node_scraper_process
node_scraper_process -->|"launches"| node_browser
node_browser -->|"opens page"| node_cricbuzz
node_browser -->|"provides page"| node_match_extraction
node_match_extraction -->|"parses text"| node_score_status
node_scraper_process -->|"captures"| node_screenshots
node_scraper_process -->|"saves matches"| node_database_api
node_database_api -->|"reads and writes"| node_score_store
node_dashboard -->|"initializes and queries"| node_database_api
node_dashboard -->|"reads run output"| node_scraper_process
node_dashboard -->|"renders"| node_dashboard_views
node_dashboard -->|"requests report"| node_report_builder
node_report_builder -->|"queries records"| node_database_api
node_report_builder -->|"writes workbook"| node_workbooks
node_dashboard -->|"offers download"| node_workbooks

click node_dashboard "https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/app.py"
click node_scraper_process "https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/scraper.py"
click node_browser "https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/scraper.py"
click node_match_extraction "https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/scraper.py"
click node_score_status "https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/scraper.py"
click node_screenshots "https://github.com/kingmaker1234/cricbuzz_cricket_score/tree/main/screenshots"
click node_database_api "https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/database.py"
click node_score_store "https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/data/cricket_scores.db"
click node_dashboard_views "https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/app.py"
click node_report_builder "https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/reports.py"
click node_workbooks "https://github.com/kingmaker1234/cricbuzz_cricket_score/tree/main/reports"

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_scraper_process,node_browser,node_match_extraction,node_score_status,node_screenshots,node_user toneBlue
class node_database_api,node_score_store toneAmber
class node_dashboard,node_dashboard_views,node_report_builder,node_workbooks toneMint
class node_cricbuzz toneIndigo
```

## Components

### Match Collection

- [Scraper Process](https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/scraper.py): `scraper.py`
- [Playwright Browser](https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/scraper.py): `scraper.py`
- [Match Extraction](https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/scraper.py): `scraper.py`
- [Score and Status Parsing](https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/scraper.py): `scraper.py`
- [Screenshot Archive](https://github.com/kingmaker1234/cricbuzz_cricket_score/tree/main/screenshots): `screenshots`

### Data Storage

- [SQLite Storage API](https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/database.py): `database.py`
- [Score History Store](https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/data/cricket_scores.db): `data/cricket_scores.db`

### Dashboard and Reports

- [Streamlit Dashboard](https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/app.py): `app.py`
- [Match and History Views](https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/app.py): `app.py`
- [Excel Report Builder](https://github.com/kingmaker1234/cricbuzz_cricket_score/blob/main/reports.py): `reports.py`
- [Excel Reports](https://github.com/kingmaker1234/cricbuzz_cricket_score/tree/main/reports): `reports`

### Other components

- **Dashboard User**
- **Cricbuzz**

## Connections

- Dashboard User → Streamlit Dashboard: uses (evidence: `README.md`)
- Streamlit Dashboard → Scraper Process: launches (evidence: `app.py`)
- Scraper Process → Playwright Browser: launches (evidence: `README.md`)
- Playwright Browser → Cricbuzz: opens page (evidence: `README.md`)
- Playwright Browser → Match Extraction: provides page (evidence: `README.md`)
- Match Extraction → Score and Status Parsing: parses text (evidence: `scraper.py`)
- Scraper Process → Screenshot Archive: captures (evidence: `README.md`)
- Scraper Process → SQLite Storage API: saves matches (evidence: `scraper.py`)
- SQLite Storage API → Score History Store: reads and writes (evidence: `database.py`)
- Streamlit Dashboard → SQLite Storage API: initializes and queries (evidence: `app.py`)
- Streamlit Dashboard → Scraper Process: reads run output (evidence: `app.py`)
- Streamlit Dashboard → Match and History Views: renders (evidence: `app.py`)
- Streamlit Dashboard → Excel Report Builder: requests report (evidence: `app.py`)
- Excel Report Builder → SQLite Storage API: queries records (evidence: `reports.py`)
- Excel Report Builder → Excel Reports: writes workbook (evidence: `README.md`)
- Streamlit Dashboard → Excel Reports: offers download (evidence: `app.py`)
