# stranger0071/beyond-the-score architecture

> Architecture diagram of the GitHub repository stranger0071/beyond-the-score, 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/stranger0071/beyond-the-score
- Repository: https://github.com/stranger0071/beyond-the-score

## Overview

Beyond The Score is a cricket analytics dashboard for IPL and ICC Men’s Cricket World Cup data. Users choose a tournament, browse and select a match, then explore its scorecard, play-by-play narration, analytics, player details, and squad; separate views compare teams, venues, and tournament-wide statistics. Precompiled match data feeds the client, while match narration can request AI summaries through the documented backend proxy. The README describes CSV-to-JSON ingestion tools, but their build-time role is distinct from the runtime dashboard. Some component routing and proxy details are documented rather than shown in the sampled source.

Main entry points: [`src/App.jsx`](https://github.com/stranger0071/beyond-the-score/blob/main/src/App.jsx) (Dashboard shell), [`src/data/loadMatches.js`](https://github.com/stranger0071/beyond-the-score/blob/main/src/data/loadMatches.js) (Match data loader), [`src/data/loadPlayers.js`](https://github.com/stranger0071/beyond-the-score/blob/main/src/data/loadPlayers.js) (Player enrichment), [`src/components/MatchesView.jsx`](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/MatchesView.jsx) (Match browser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Dashboard experience"]
  node_app["Dashboard shell<br/>[App.jsx]"]
  node_navigation["Navigation<br/>[NavBar.jsx]"]
  node_match_browse["Match browser<br/>[MatchesView.jsx]"]
  node_header["Tournament selector<br/>[Header.jsx]"]
end

subgraph group_analytics["Match intelligence"]
  node_stats["Dataset overview<br/>[DatasetStats.jsx]"]
  node_scorecard["Match scorecard<br/>[MatchScorecard.jsx]"]
  node_match_analytics["Match analytics<br/>[MatchAnalytics.jsx]"]
  node_insights["Insight cards<br/>[InsightCards.jsx]"]
  node_moments["Key moments<br/>[KeyMoments.jsx]"]
  node_squad["Match squad<br/>[MatchSquad.jsx]"]
  node_player_spotlight["Player spotlight"]
  node_head_to_head["Head-to-head<br/>[HeadToHead.jsx]"]
  node_venue_stats["Venue insights<br/>[VenueStats.jsx]"]
  node_glossary["Cricket glossary<br/>[Glossary.jsx]"]
  node_narration["AI match narration<br/>[MatchNarration.jsx]"]
end

subgraph group_data["Cricket data"]
  node_players_loader["Player enrichment<br/>[loadPlayers.js]"]
  node_player_lookup["Player lookup<br/>[playerLookup.js]"]
  node_team_meta["Team metadata<br/>[teamMeta.js]"]
  node_match_loader["Match data loader<br/>[loadMatches.js]"]
  node_match_data[("Tournament match data")]
  node_player_data[("Player registry<br/>[players.json]")]
  node_glossary_data["Glossary terms<br/>[glossary.js]"]
  node_ingestion["CSV ingestion tools"]
  node_csv_parser["CSV parser<br/>[csvParser.js]"]
end

subgraph group_services["Narration service"]
  node_proxy["Express AI proxy<br/>[index.js]"]
  node_gemini["Gemini API"]
end

node_fan(("Cricket fan"))

node_fan -->|"opens"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"renders"| node_header
node_app -->|"shows"| node_match_browse
node_app -->|"renders"| node_stats
node_app -->|"loads matches"| node_match_loader
node_app -->|"loads players"| node_players_loader
node_app -->|"renders"| node_scorecard
node_app -->|"renders"| node_match_analytics
node_app -->|"renders"| node_narration
node_app -->|"renders"| node_player_spotlight
node_app -->|"provides view"| node_head_to_head
node_app -->|"provides view"| node_venue_stats
node_app -->|"provides view"| node_insights
node_app -->|"provides view"| node_moments
node_app -->|"provides view"| node_squad
node_app -->|"provides view"| node_glossary
node_match_browse -->|"uses match list"| node_match_loader
node_match_loader -->|"loads by year"| node_match_data
node_head_to_head -->|"reads matches"| node_match_loader
node_venue_stats -->|"reads matches"| node_match_loader
node_players_loader -->|"enriches profiles"| node_player_data
node_players_loader -->|"finds profiles"| node_player_lookup
node_players_loader -->|"gets team details"| node_team_meta
node_match_loader -->|"uses generated data"| node_ingestion
node_ingestion -->|"parses CSV"| node_csv_parser
node_narration -->|"requests summary"| node_proxy
node_proxy -->|"calls"| node_gemini

click node_app "https://github.com/stranger0071/beyond-the-score/blob/main/src/App.jsx"
click node_navigation "https://github.com/stranger0071/beyond-the-score/blob/main/src/components/NavBar.jsx"
click node_match_browse "https://github.com/stranger0071/beyond-the-score/blob/main/src/components/MatchesView.jsx"
click node_header "https://github.com/stranger0071/beyond-the-score/blob/main/src/components/Header.jsx"
click node_stats "https://github.com/stranger0071/beyond-the-score/blob/main/src/components/DatasetStats.jsx"
click node_scorecard "https://github.com/stranger0071/beyond-the-score/blob/main/src/components/MatchScorecard.jsx"
click node_match_analytics "https://github.com/stranger0071/beyond-the-score/blob/main/src/components/MatchAnalytics.jsx"
click node_insights "https://github.com/stranger0071/beyond-the-score/blob/main/src/components/InsightCards.jsx"
click node_moments "https://github.com/stranger0071/beyond-the-score/blob/main/src/components/KeyMoments.jsx"
click node_squad "https://github.com/stranger0071/beyond-the-score/blob/main/src/components/MatchSquad.jsx"
click node_player_spotlight "https://github.com/stranger0071/beyond-the-score/blob/main/src/components/PlayerSpotlight.jsx"
click node_head_to_head "https://github.com/stranger0071/beyond-the-score/blob/main/src/components/HeadToHead.jsx"
click node_venue_stats "https://github.com/stranger0071/beyond-the-score/blob/main/src/components/VenueStats.jsx"
click node_glossary "https://github.com/stranger0071/beyond-the-score/blob/main/src/components/Glossary.jsx"
click node_narration "https://github.com/stranger0071/beyond-the-score/blob/main/src/components/MatchNarration.jsx"
click node_players_loader "https://github.com/stranger0071/beyond-the-score/blob/main/src/data/loadPlayers.js"
click node_player_lookup "https://github.com/stranger0071/beyond-the-score/blob/main/src/utils/playerLookup.js"
click node_team_meta "https://github.com/stranger0071/beyond-the-score/blob/main/src/utils/teamMeta.js"
click node_match_loader "https://github.com/stranger0071/beyond-the-score/blob/main/src/data/loadMatches.js"
click node_match_data "https://github.com/stranger0071/beyond-the-score/tree/main/src/data/ipl-by-year"
click node_player_data "https://github.com/stranger0071/beyond-the-score/blob/main/src/data/players.json"
click node_glossary_data "https://github.com/stranger0071/beyond-the-score/blob/main/src/data/glossary.js"
click node_ingestion "https://github.com/stranger0071/beyond-the-score/tree/main/scripts"
click node_csv_parser "https://github.com/stranger0071/beyond-the-score/blob/main/src/utils/csvParser.js"
click node_proxy "https://github.com/stranger0071/beyond-the-score/blob/main/server/index.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_app,node_navigation,node_match_browse,node_header toneBlue
class node_stats,node_scorecard,node_match_analytics,node_insights,node_moments,node_squad,node_player_spotlight,node_head_to_head,node_venue_stats,node_glossary,node_narration toneAmber
class node_players_loader,node_player_lookup,node_team_meta,node_match_loader,node_match_data,node_player_data,node_glossary_data,node_ingestion,node_csv_parser toneMint
class node_proxy,node_gemini toneRose
class node_fan toneIndigo
```

## Components

### Dashboard experience

- [Dashboard shell](https://github.com/stranger0071/beyond-the-score/blob/main/src/App.jsx): `src/App.jsx`
- [Navigation](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/NavBar.jsx): `src/components/NavBar.jsx`
- [Match browser](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/MatchesView.jsx): `src/components/MatchesView.jsx`
- [Tournament selector](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/Header.jsx): `src/components/Header.jsx`

### Match intelligence

- [Dataset overview](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/DatasetStats.jsx): `src/components/DatasetStats.jsx`
- [Match scorecard](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/MatchScorecard.jsx): `src/components/MatchScorecard.jsx`
- [Match analytics](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/MatchAnalytics.jsx): `src/components/MatchAnalytics.jsx`
- [Insight cards](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/InsightCards.jsx): `src/components/InsightCards.jsx`
- [Key moments](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/KeyMoments.jsx): `src/components/KeyMoments.jsx`
- [Match squad](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/MatchSquad.jsx): `src/components/MatchSquad.jsx`
- [Player spotlight](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/PlayerSpotlight.jsx): `src/components/PlayerSpotlight.jsx`
- [Head-to-head](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/HeadToHead.jsx): `src/components/HeadToHead.jsx`
- [Venue insights](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/VenueStats.jsx): `src/components/VenueStats.jsx`
- [Cricket glossary](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/Glossary.jsx): `src/components/Glossary.jsx`
- [AI match narration](https://github.com/stranger0071/beyond-the-score/blob/main/src/components/MatchNarration.jsx): `src/components/MatchNarration.jsx`

### Cricket data

- [Player enrichment](https://github.com/stranger0071/beyond-the-score/blob/main/src/data/loadPlayers.js): `src/data/loadPlayers.js`
- [Player lookup](https://github.com/stranger0071/beyond-the-score/blob/main/src/utils/playerLookup.js): `src/utils/playerLookup.js`
- [Team metadata](https://github.com/stranger0071/beyond-the-score/blob/main/src/utils/teamMeta.js): `src/utils/teamMeta.js`
- [Match data loader](https://github.com/stranger0071/beyond-the-score/blob/main/src/data/loadMatches.js): `src/data/loadMatches.js`
- [Tournament match data](https://github.com/stranger0071/beyond-the-score/tree/main/src/data/ipl-by-year): `src/data/ipl-by-year`
- [Player registry](https://github.com/stranger0071/beyond-the-score/blob/main/src/data/players.json): `src/data/players.json`
- [Glossary terms](https://github.com/stranger0071/beyond-the-score/blob/main/src/data/glossary.js): `src/data/glossary.js`
- [CSV ingestion tools](https://github.com/stranger0071/beyond-the-score/tree/main/scripts): `scripts`
- [CSV parser](https://github.com/stranger0071/beyond-the-score/blob/main/src/utils/csvParser.js): `src/utils/csvParser.js`

### Narration service

- [Express AI proxy](https://github.com/stranger0071/beyond-the-score/blob/main/server/index.js): `server/index.js`
- **Gemini API**

### Other components

- **Cricket fan**

## Connections

- Cricket fan → Dashboard shell: opens (evidence: `README.md`)
- Dashboard shell → Navigation: renders (evidence: `src/App.jsx`)
- Dashboard shell → Tournament selector: renders (evidence: `src/App.jsx`)
- Dashboard shell → Match browser: shows (evidence: `README.md`)
- Dashboard shell → Dataset overview: renders (evidence: `src/App.jsx`)
- Dashboard shell → Match data loader: loads matches (evidence: `src/App.jsx`)
- Dashboard shell → Player enrichment: loads players (evidence: `src/App.jsx`)
- Dashboard shell → Match scorecard: renders (evidence: `src/App.jsx`)
- Dashboard shell → Match analytics: renders (evidence: `src/App.jsx`)
- Dashboard shell → AI match narration: renders (evidence: `src/App.jsx`)
- Dashboard shell → Player spotlight: renders (evidence: `src/App.jsx`)
- Dashboard shell → Head-to-head: provides view (evidence: `README.md`)
- Dashboard shell → Venue insights: provides view (evidence: `README.md`)
- Dashboard shell → Insight cards: provides view (evidence: `README.md`)
- Dashboard shell → Key moments: provides view (evidence: `README.md`)
- Dashboard shell → Match squad: provides view (evidence: `README.md`)
- Dashboard shell → Cricket glossary: provides view (evidence: `README.md`)
- Match browser → Match data loader: uses match list (evidence: `README.md`)
- Match data loader → Tournament match data: loads by year (evidence: `src/data/loadMatches.js`)
- Head-to-head → Match data loader: reads matches (evidence: `src/components/HeadToHead.jsx`)
- Venue insights → Match data loader: reads matches (evidence: `src/components/VenueStats.jsx`)
- Player enrichment → Player registry: enriches profiles (evidence: `src/data/loadPlayers.js`)
- Player enrichment → Player lookup: finds profiles (evidence: `src/data/loadPlayers.js`)
- Player enrichment → Team metadata: gets team details (evidence: `src/data/loadPlayers.js`)
- Match data loader → CSV ingestion tools: uses generated data (evidence: `README.md`)
- CSV ingestion tools → CSV parser: parses CSV (evidence: `scripts/build-ipl-matches.mjs`)
- AI match narration → Express AI proxy: requests summary (evidence: `README.md`)
- Express AI proxy → Gemini API: calls (evidence: `README.md`)
