# tahir-khokhar/universal-sports-scoreboard-system architecture

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

- Interactive diagram: https://gitdiagram.com/tahir-khokhar/universal-sports-scoreboard-system
- Repository: https://github.com/tahir-khokhar/universal-sports-scoreboard-system

## Overview

This is a Django sports-scoreboard application, with cricket as its detailed live-scoring workflow. A user creates a match and teams, records the toss, submits deliveries through the live scoring controller, and views refreshed match state and a scoreboard; cricket logic handles innings, strike, wickets, and statistics. The generic scoreboard also supports match history and score updates. The README documents several capabilities beyond the sampled excerpts; those are represented at subsystem level where exact implementation paths are not established. Some UI-to-endpoint wiring is therefore shown as unverified.

Main entry points: [`cricket/views.py`](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/views.py) (Cricket match views), [`scoreboard/views.py`](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/scoreboard/views.py) (Scoreboard views), [`scoreboard/models.py`](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/scoreboard/models.py) (Match record), [`cricket/models.py`](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/models.py) (Cricket records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_score_urls["Scoreboard routes<br/>[urls.py]"]
  node_cricket_urls["Cricket routes<br/>[urls.py]"]
  node_live_controller["Live scoring UI<br/>[cricket_scoring.js]"]
  node_match_templates["Match pages"]
  node_scoreboard_template["Cricket scoreboard"]
  node_creation_template["Cricket setup"]
end

subgraph group_scoreboard["Sports scoreboard"]
  node_score_views["Scoreboard views<br/>[views.py]"]
  node_match_creation["Match creation<br/>[views.py]"]
  node_history["Match history<br/>[views.py]"]
end

subgraph group_cricket["Cricket scoring"]
  node_cricket_views["Cricket match views<br/>[views.py]"]
  node_toss["Toss handling<br/>[views.py]"]
  node_delivery["Delivery scoring<br/>[views.py]"]
  node_innings["Innings transitions<br/>[views.py]"]
  node_scoring_rules["Scoring rules<br/>[scoring.py]"]
end

subgraph group_state["Match state"]
  node_match_model[("Match record<br/>[models.py]")]
  node_cricket_model[("Cricket records<br/>[models.py]")]
  node_sqlite[("SQLite database<br/>[settings.py]")]
end

node_user(("User"))

node_user -.->|"uses"| node_score_urls
node_score_urls -->|"routes"| node_score_views
node_cricket_urls -->|"routes"| node_cricket_views
node_score_views -->|"reads/writes"| node_match_model
node_score_views -->|"uses"| node_cricket_model
node_cricket_views -->|"uses"| node_match_model
node_cricket_views -->|"reads/writes"| node_cricket_model
node_cricket_views -->|"calls"| node_scoring_rules
node_live_controller -.->|"posts scores"| node_cricket_views
node_live_controller -.->|"refreshes state"| node_cricket_views
node_score_views -->|"handles"| node_match_creation
node_score_views -.->|"serves"| node_history
node_cricket_views -->|"handles"| node_toss
node_cricket_views -->|"handles"| node_delivery
node_cricket_views -->|"starts/ends"| node_innings
node_cricket_views -.->|"renders"| node_match_templates
node_cricket_views -->|"renders"| node_scoreboard_template
node_cricket_views -.->|"renders"| node_creation_template
node_match_model -.->|"persists in"| node_sqlite
node_cricket_model -.->|"persists in"| node_sqlite

click node_score_urls "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/scoreboard/urls.py"
click node_cricket_urls "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/urls.py"
click node_score_views "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/scoreboard/views.py"
click node_match_creation "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/scoreboard/views.py"
click node_history "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/scoreboard/views.py"
click node_cricket_views "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/views.py"
click node_toss "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/views.py"
click node_delivery "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/views.py"
click node_innings "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/views.py"
click node_scoring_rules "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/scoring.py"
click node_live_controller "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/static/js/cricket_scoring.js"
click node_match_templates "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/Templates/cricket_match_detail.html"
click node_scoreboard_template "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/Templates/cricket_scoreboard.html"
click node_creation_template "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/Templates/create_cricket_match.html"
click node_match_model "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/scoreboard/models.py"
click node_cricket_model "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/models.py"
click node_sqlite "https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/Universal_Sports_Scoreboard_System/settings.py"

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_score_urls,node_cricket_urls,node_live_controller,node_match_templates,node_scoreboard_template,node_creation_template,node_user toneBlue
class node_score_views,node_match_creation,node_history toneAmber
class node_cricket_views,node_toss,node_delivery,node_innings,node_scoring_rules toneMint
class node_match_model,node_cricket_model,node_sqlite toneRose
```

## Components

### Web interface

- [Scoreboard routes](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/scoreboard/urls.py): `scoreboard/urls.py`
- [Cricket routes](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/urls.py): `cricket/urls.py`
- [Live scoring UI](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/static/js/cricket_scoring.js): `static/js/cricket_scoring.js`
- [Match pages](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/Templates/cricket_match_detail.html): `Templates/cricket_match_detail.html`
- [Cricket scoreboard](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/Templates/cricket_scoreboard.html): `Templates/cricket_scoreboard.html`
- [Cricket setup](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/Templates/create_cricket_match.html): `Templates/create_cricket_match.html`

### Sports scoreboard

- [Scoreboard views](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/scoreboard/views.py): `scoreboard/views.py`
- [Match creation](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/scoreboard/views.py): `scoreboard/views.py`
- [Match history](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/scoreboard/views.py): `scoreboard/views.py`

### Cricket scoring

- [Cricket match views](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/views.py): `cricket/views.py`
- [Toss handling](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/views.py): `cricket/views.py`
- [Delivery scoring](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/views.py): `cricket/views.py`
- [Innings transitions](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/views.py): `cricket/views.py`
- [Scoring rules](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/scoring.py): `cricket/scoring.py`

### Match state

- [Match record](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/scoreboard/models.py): `scoreboard/models.py`
- [Cricket records](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/cricket/models.py): `cricket/models.py`
- [SQLite database](https://github.com/tahir-khokhar/universal-sports-scoreboard-system/blob/main/Universal_Sports_Scoreboard_System/settings.py): `Universal_Sports_Scoreboard_System/settings.py`

### Other components

- **User**

## Connections

- User → Scoreboard routes: uses
- Scoreboard routes → Scoreboard views: routes (evidence: `scoreboard/urls.py`)
- Cricket routes → Cricket match views: routes (evidence: `cricket/urls.py`)
- Scoreboard views → Match record: reads/writes (evidence: `scoreboard/views.py`)
- Scoreboard views → Cricket records: uses (evidence: `scoreboard/views.py`)
- Cricket match views → Match record: uses (evidence: `cricket/views.py`)
- Cricket match views → Cricket records: reads/writes (evidence: `cricket/views.py`)
- Cricket match views → Scoring rules: calls (evidence: `cricket/views.py`)
- Live scoring UI → Cricket match views: posts scores (evidence: `README.md`)
- Live scoring UI → Cricket match views: refreshes state (evidence: `README.md`)
- Scoreboard views → Match creation: handles (evidence: `scoreboard/views.py`)
- Scoreboard views → Match history: serves (evidence: `scoreboard/urls.py`)
- Cricket match views → Toss handling: handles (evidence: `cricket/views.py`)
- Cricket match views → Delivery scoring: handles (evidence: `cricket/views.py`)
- Cricket match views → Innings transitions: starts/ends (evidence: `cricket/views.py`)
- Cricket match views → Match pages: renders
- Cricket match views → Cricket scoreboard: renders (evidence: `cricket/views.py`)
- Cricket match views → Cricket setup: renders
- Match record → SQLite database: persists in
- Cricket records → SQLite database: persists in
