# nitishratre45/tilakvarmafanclub architecture

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

- Interactive diagram: https://gitdiagram.com/nitishratre45/tilakvarmafanclub
- Repository: https://github.com/nitishratre45/tilakvarmafanclub

## Overview

The repository is a static Tilak Varma fan site with a browser-based stats and fan experience, Cloudflare Pages API endpoints, and scheduled scripts that refresh committed data snapshots. The main visitor path is browsing the site’s stored content and match features; refresh jobs maintain verified snapshots rather than providing a live-score feed. README statements support the documented capabilities and data flow; several frontend and admin connections are not visible in the sampled source, so those links are omitted or marked unverified.

Main entry points: [`admin/index.html`](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/admin/index.html) (Admin studio), [`functions/_lib/admin.js`](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/_lib/admin.js) (Admin session), [`data/site-data.json`](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/data/site-data.json) (Site snapshots), [`index.html`](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/index.html) (Fan website)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Fan experience"]
  node_site["Fan website<br/>[index.html]"]
  node_stats["Stats explorer<br/>[features.js]"]
  node_records["Records and milestones<br/>[features.js]"]
  node_analytics["Performance analytics<br/>[features.js]"]
  node_fan["Fan zone and poll<br/>[fan-zone-plus.js]"]
  node_wallpaper["Wallpaper maker<br/>[features.js]"]
  node_search["Website search<br/>[app.js]"]
  node_matchcenter["Match center"]
end

subgraph group_content["Static content"]
  node_stored[("Site snapshots<br/>[site-data.json]")]
  node_fancontent[("Fan resources<br/>[fan-zone.json]")]
end

subgraph group_refresh["Data refresh"]
  node_recentrefresh["Recent innings refresh<br/>[refresh_data.py]"]
  node_statsguru["Batting stats refresh"]
  node_bowling["Bowling refresh<br/>[refresh_bowling.py]"]
  node_otherrefresh["Other data refreshes"]
  node_actions["Scheduled workflows"]
end

subgraph group_services["APIs and admin"]
  node_matchesapi["Matches API<br/>[matches.js]"]
  node_scorecardapi["Scorecard API<br/>[scoreboard.js]"]
  node_adminstudio["Admin studio<br/>[index.html]"]
  node_adminauth["Admin session<br/>[admin.js]"]
  node_adminstatus["Data status<br/>[data-status.js]"]
  node_adminmonitor["Workflow monitor<br/>[monitor.js]"]
  node_admincontent["Content editing<br/>[content.js]"]
  node_upload["Signed upload<br/>[sign-upload.js]"]
end

node_visitor(("Site visitor"))
node_github[("GitHub repository")]
node_cricapi["CricAPI"]

node_visitor -->|"browses"| node_site
node_site -->|"shows snapshots"| node_stored
node_site -->|"shows resources"| node_fancontent
node_actions -.->|"runs refresh"| node_recentrefresh
node_recentrefresh -->|"updates innings"| node_stored
node_actions -.->|"runs refresh"| node_statsguru
node_actions -.->|"runs refresh"| node_bowling
node_statsguru -.->|"updates snapshots"| node_stored
node_bowling -.->|"updates snapshots"| node_stored
node_actions -.->|"runs refreshes"| node_otherrefresh
node_matchcenter -.->|"requests matches"| node_matchesapi
node_matchcenter -.->|"requests scorecard"| node_scorecardapi
node_matchesapi -->|"fetches matches"| node_cricapi
node_scorecardapi -->|"fetches scorecard"| node_cricapi
node_adminstudio -.->|"authenticates"| node_adminauth
node_adminstudio -.->|"checks status"| node_adminstatus
node_adminstudio -.->|"monitors runs"| node_adminmonitor
node_adminstudio -.->|"edits content"| node_admincontent
node_adminstudio -.->|"requests signature"| node_upload
node_adminstatus -->|"checks session"| node_adminauth
node_adminmonitor -->|"checks session"| node_adminauth
node_admincontent -->|"checks session"| node_adminauth
node_upload -->|"checks session"| node_adminauth
node_admincontent -->|"saves JSON"| node_github
node_adminstatus -->|"reads status"| node_github
node_adminmonitor -->|"reads workflows"| node_github

click node_site "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/index.html"
click node_stats "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/assets/features.js"
click node_records "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/assets/features.js"
click node_analytics "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/assets/features.js"
click node_fan "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/assets/fan-zone-plus.js"
click node_wallpaper "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/assets/features.js"
click node_search "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/assets/app.js"
click node_matchcenter "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/assets/match-center-live.js"
click node_stored "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/data/site-data.json"
click node_fancontent "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/data/fan-zone.json"
click node_recentrefresh "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/scripts/refresh_data.py"
click node_statsguru "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/scripts/refresh_statsguru.py"
click node_bowling "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/scripts/refresh_bowling.py"
click node_otherrefresh "https://github.com/nitishratre45/tilakvarmafanclub/tree/main/scripts"
click node_matchesapi "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/api/matches.js"
click node_scorecardapi "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/api/scoreboard.js"
click node_adminstudio "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/admin/index.html"
click node_adminauth "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/_lib/admin.js"
click node_adminstatus "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/api/admin/data-status.js"
click node_adminmonitor "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/api/admin/monitor.js"
click node_admincontent "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/api/admin/content.js"
click node_upload "https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/api/admin/sign-upload.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_site,node_stats,node_records,node_analytics,node_fan,node_wallpaper,node_search,node_matchcenter toneBlue
class node_stored,node_fancontent,node_github toneAmber
class node_recentrefresh,node_statsguru,node_bowling,node_otherrefresh,node_actions,node_cricapi toneMint
class node_matchesapi,node_scorecardapi,node_adminstudio,node_adminauth,node_adminstatus,node_adminmonitor,node_admincontent,node_upload toneRose
class node_visitor toneIndigo
```

## Components

### Fan experience

- [Fan website](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/index.html): `index.html`
- [Stats explorer](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/assets/features.js): `assets/features.js`
- [Records and milestones](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/assets/features.js): `assets/features.js`
- [Performance analytics](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/assets/features.js): `assets/features.js`
- [Fan zone and poll](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/assets/fan-zone-plus.js): `assets/fan-zone-plus.js`
- [Wallpaper maker](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/assets/features.js): `assets/features.js`
- [Website search](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/assets/app.js): `assets/app.js`
- [Match center](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/assets/match-center-live.js): `assets/match-center-live.js`

### Static content

- [Site snapshots](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/data/site-data.json): `data/site-data.json`
- [Fan resources](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/data/fan-zone.json): `data/fan-zone.json`

### Data refresh

- [Recent innings refresh](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/scripts/refresh_data.py): `scripts/refresh_data.py`
- [Batting stats refresh](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/scripts/refresh_statsguru.py): `scripts/refresh_statsguru.py`
- [Bowling refresh](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/scripts/refresh_bowling.py): `scripts/refresh_bowling.py`
- [Other data refreshes](https://github.com/nitishratre45/tilakvarmafanclub/tree/main/scripts): `scripts`
- **Scheduled workflows**

### APIs and admin

- [Matches API](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/api/matches.js): `functions/api/matches.js`
- [Scorecard API](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/api/scoreboard.js): `functions/api/scoreboard.js`
- [Admin studio](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/admin/index.html): `admin/index.html`
- [Admin session](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/_lib/admin.js): `functions/_lib/admin.js`
- [Data status](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/api/admin/data-status.js): `functions/api/admin/data-status.js`
- [Workflow monitor](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/api/admin/monitor.js): `functions/api/admin/monitor.js`
- [Content editing](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/api/admin/content.js): `functions/api/admin/content.js`
- [Signed upload](https://github.com/nitishratre45/tilakvarmafanclub/blob/main/functions/api/admin/sign-upload.js): `functions/api/admin/sign-upload.js`

### Other components

- **Site visitor**
- **GitHub repository**
- **CricAPI**

## Connections

- Site visitor → Fan website: browses (evidence: `README.md`)
- Fan website → Site snapshots: shows snapshots (evidence: `README.md`)
- Fan website → Fan resources: shows resources (evidence: `README.md`)
- Scheduled workflows → Recent innings refresh: runs refresh (evidence: `README.md`)
- Recent innings refresh → Site snapshots: updates innings (evidence: `README.md`)
- Scheduled workflows → Batting stats refresh: runs refresh (evidence: `README.md`)
- Scheduled workflows → Bowling refresh: runs refresh (evidence: `README.md`)
- Batting stats refresh → Site snapshots: updates snapshots
- Bowling refresh → Site snapshots: updates snapshots
- Scheduled workflows → Other data refreshes: runs refreshes (evidence: `README.md`)
- Match center → Matches API: requests matches
- Match center → Scorecard API: requests scorecard
- Matches API → CricAPI: fetches matches (evidence: `functions/api/matches.js`)
- Scorecard API → CricAPI: fetches scorecard (evidence: `functions/api/scoreboard.js`)
- Admin studio → Admin session: authenticates
- Admin studio → Data status: checks status
- Admin studio → Workflow monitor: monitors runs
- Admin studio → Content editing: edits content
- Admin studio → Signed upload: requests signature
- Data status → Admin session: checks session (evidence: `functions/api/admin/data-status.js`)
- Workflow monitor → Admin session: checks session (evidence: `functions/api/admin/monitor.js`)
- Content editing → Admin session: checks session (evidence: `functions/api/admin/content.js`)
- Signed upload → Admin session: checks session (evidence: `functions/api/admin/sign-upload.js`)
- Content editing → GitHub repository: saves JSON (evidence: `functions/api/admin/content.js`)
- Data status → GitHub repository: reads status (evidence: `functions/api/admin/data-status.js`)
- Workflow monitor → GitHub repository: reads workflows (evidence: `functions/api/admin/monitor.js`)
