# ajith-poojari/cric-scorer architecture

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

- Interactive diagram: https://gitdiagram.com/ajith-poojari/cric-scorer
- Repository: https://github.com/ajith-poojari/cric-scorer

## Overview

Scoreboard is a single-page live cricket scorer. The documented workflow is: a scorer sets up a match and records deliveries; viewers join with its match code and see updates, while results remain hidden until completion. The README also describes scoring rules, bowling constraints, substitutions, run-outs, and undo. The tree contains no source excerpts, so implementation details and any backend or transport are not shown; relationships below reflect documented behavior only.

Main entry points: [`index.html`](https://github.com/ajith-poojari/cric-scorer/blob/main/index.html) (Scoring engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Match setup"]
  node_match_setup["Match setup<br/>[index.html]"]
  node_team_toss["Teams and toss<br/>[index.html]"]
  node_match_code["Match code<br/>[index.html]"]
end

subgraph group_scoring["Scoring"]
  node_scoring_engine["Scoring engine<br/>[index.html]"]
  node_delivery_log[("Delivery log<br/>[index.html]")]
  node_bowling_rules["Bowling rules<br/>[index.html]"]
  node_dismissals["Dismissals and subs<br/>[index.html]"]
  node_undo["Undo<br/>[index.html]"]
  node_scorecard["Scorecard<br/>[index.html]"]
end

subgraph group_live["Live viewing"]
  node_live_sync["Live sync<br/>[index.html]"]
  node_viewer_board["Viewer scoreboard<br/>[index.html]"]
  node_result_gate["Finished-match results<br/>[index.html]"]
end

node_scorer(("Scorer"))
node_viewer(("Viewer"))

node_scorer -->|"starts match"| node_match_setup
node_match_setup -->|"sets up"| node_team_toss
node_match_setup -->|"gets code"| node_match_code
node_scorer -->|"records deliveries"| node_scoring_engine
node_scoring_engine -->|"logs deliveries"| node_delivery_log
node_scoring_engine -->|"enforces rules"| node_bowling_rules
node_scoring_engine -->|"handles events"| node_dismissals
node_scorer -->|"undoes scoring"| node_undo
node_delivery_log -->|"calculates stats"| node_scorecard
node_scoring_engine -->|"updates match"| node_live_sync
node_viewer -->|"enters code"| node_match_code
node_match_code -->|"joins match"| node_live_sync
node_live_sync -->|"syncs updates"| node_viewer_board
node_result_gate -->|"reveals on finish"| node_viewer_board

click node_match_setup "https://github.com/ajith-poojari/cric-scorer/blob/main/index.html"
click node_team_toss "https://github.com/ajith-poojari/cric-scorer/blob/main/index.html"
click node_match_code "https://github.com/ajith-poojari/cric-scorer/blob/main/index.html"
click node_scoring_engine "https://github.com/ajith-poojari/cric-scorer/blob/main/index.html"
click node_delivery_log "https://github.com/ajith-poojari/cric-scorer/blob/main/index.html"
click node_bowling_rules "https://github.com/ajith-poojari/cric-scorer/blob/main/index.html"
click node_dismissals "https://github.com/ajith-poojari/cric-scorer/blob/main/index.html"
click node_undo "https://github.com/ajith-poojari/cric-scorer/blob/main/index.html"
click node_scorecard "https://github.com/ajith-poojari/cric-scorer/blob/main/index.html"
click node_live_sync "https://github.com/ajith-poojari/cric-scorer/blob/main/index.html"
click node_viewer_board "https://github.com/ajith-poojari/cric-scorer/blob/main/index.html"
click node_result_gate "https://github.com/ajith-poojari/cric-scorer/blob/main/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_match_setup,node_team_toss,node_match_code,node_viewer toneBlue
class node_scoring_engine,node_delivery_log,node_bowling_rules,node_dismissals,node_undo,node_scorecard toneAmber
class node_live_sync,node_viewer_board,node_result_gate toneMint
class node_scorer toneIndigo
```

## Components

### Match setup

- [Match setup](https://github.com/ajith-poojari/cric-scorer/blob/main/index.html): `index.html`
- [Teams and toss](https://github.com/ajith-poojari/cric-scorer/blob/main/index.html): `index.html`
- [Match code](https://github.com/ajith-poojari/cric-scorer/blob/main/index.html): `index.html`

### Scoring

- [Scoring engine](https://github.com/ajith-poojari/cric-scorer/blob/main/index.html): `index.html`
- [Delivery log](https://github.com/ajith-poojari/cric-scorer/blob/main/index.html): `index.html`
- [Bowling rules](https://github.com/ajith-poojari/cric-scorer/blob/main/index.html): `index.html`
- [Dismissals and subs](https://github.com/ajith-poojari/cric-scorer/blob/main/index.html): `index.html`
- [Undo](https://github.com/ajith-poojari/cric-scorer/blob/main/index.html): `index.html`
- [Scorecard](https://github.com/ajith-poojari/cric-scorer/blob/main/index.html): `index.html`

### Live viewing

- [Live sync](https://github.com/ajith-poojari/cric-scorer/blob/main/index.html): `index.html`
- [Viewer scoreboard](https://github.com/ajith-poojari/cric-scorer/blob/main/index.html): `index.html`
- [Finished-match results](https://github.com/ajith-poojari/cric-scorer/blob/main/index.html): `index.html`

### Other components

- **Scorer**
- **Viewer**

## Connections

- Scorer → Match setup: starts match (evidence: `README.md`)
- Match setup → Teams and toss: sets up (evidence: `README.md`)
- Match setup → Match code: gets code (evidence: `README.md`)
- Scorer → Scoring engine: records deliveries (evidence: `README.md`)
- Scoring engine → Delivery log: logs deliveries (evidence: `README.md`)
- Scoring engine → Bowling rules: enforces rules (evidence: `README.md`)
- Scoring engine → Dismissals and subs: handles events (evidence: `README.md`)
- Scorer → Undo: undoes scoring (evidence: `README.md`)
- Delivery log → Scorecard: calculates stats (evidence: `README.md`)
- Scoring engine → Live sync: updates match (evidence: `README.md`)
- Viewer → Match code: enters code (evidence: `README.md`)
- Match code → Live sync: joins match (evidence: `README.md`)
- Live sync → Viewer scoreboard: syncs updates (evidence: `README.md`)
- Finished-match results → Viewer scoreboard: reveals on finish (evidence: `README.md`)
