# cricketmaestro18/team_game_js architecture

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

- Interactive diagram: https://gitdiagram.com/cricketmaestro18/team_game_js
- Repository: https://github.com/cricketmaestro18/team_game_js

## Overview

Cricket Mini Games is a browser-based cricket game service with account/profile features, saved game history and themes, and player-stat lookups. The user-facing flow is to choose a game, configure it, play through its game-specific stages, and view a result; the excerpts show Team Draft, Stats Winner, and Chase Master. The browser app and Node server are the principal layers. API wiring in the browser was not shown, so that connection is marked unverified; the README documents persistent account, history, profile-picture, and theme data.

Main entry points: [`app.js`](https://github.com/cricketmaestro18/team_game_js/blob/main/app.js) (Game interface), [`server.mjs`](https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs) (Player stats lookup), [`index.html`](https://github.com/cricketmaestro18/team_game_js/blob/main/index.html) (Web shell), [`style.css`](https://github.com/cricketmaestro18/team_game_js/blob/main/style.css) (Game styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Browser experience"]
  node_webshell["Web shell<br/>[index.html]"]
  node_browserapp["Game interface<br/>[app.js]"]
  node_styles["Game styling<br/>[style.css]"]
end

subgraph group_games["Cricket games"]
  node_teamdraft["Team Draft<br/>[app.js]"]
  node_statswinner["Stats Winner<br/>[app.js]"]
  node_chasemaster["Chase Master<br/>[app.js]"]
end

subgraph group_server["Server features"]
  node_accounts["Accounts and profile<br/>[server.mjs]"]
  node_history["Game history<br/>[server.mjs]"]
  node_themefeatures["Theme settings<br/>[server.mjs]"]
  node_statlookup["Player stats lookup<br/>[server.mjs]"]
  node_playerimages["Player images<br/>[server.mjs]"]
  node_squadservice["Chase squads<br/>[server.mjs]"]
end

subgraph group_data["Saved data"]
  node_accountdata[("Account and history data<br/>[server.mjs]")]
  node_themedata[("Saved themes<br/>[server.mjs]")]
  node_draftpool["Draft player pool<br/>[draft-players.json]"]
  node_playerindex["Player index<br/>[player-index.json]"]
  node_squadfile["Squad fallback<br/>[chase-squads.json]"]
end

subgraph group_integrations["External cricket data"]
  node_cricketstats["Cricket stats sites"]
  node_imageproviders["Player image sources"]
  node_cricketnews["Squad news source"]
end

node_player(("Player"))

node_player -->|"opens"| node_webshell
node_webshell -->|"hosts"| node_browserapp
node_player -->|"plays"| node_browserapp
node_browserapp -->|"uses styles"| node_styles
node_browserapp -->|"configures"| node_teamdraft
node_browserapp -->|"configures"| node_statswinner
node_browserapp -->|"configures"| node_chasemaster
node_browserapp -.->|"calls API"| node_accounts
node_browserapp -.->|"saves results"| node_history
node_browserapp -.->|"loads themes"| node_themefeatures
node_browserapp -.->|"requests stats"| node_statlookup
node_browserapp -.->|"requests images"| node_playerimages
node_browserapp -.->|"loads squads"| node_squadservice
node_accounts -->|"reads and writes"| node_accountdata
node_history -->|"persists history"| node_accountdata
node_themefeatures -->|"reads and writes"| node_themedata
node_teamdraft -->|"loads players"| node_draftpool
node_statlookup -->|"fetches stats"| node_cricketstats
node_playerimages -->|"looks up images"| node_imageproviders
node_squadservice -->|"reads fallback"| node_squadfile
node_squadservice -->|"fetches squads"| node_cricketnews
node_statlookup -.->|"uses index"| node_playerindex

click node_webshell "https://github.com/cricketmaestro18/team_game_js/blob/main/index.html"
click node_browserapp "https://github.com/cricketmaestro18/team_game_js/blob/main/app.js"
click node_styles "https://github.com/cricketmaestro18/team_game_js/blob/main/style.css"
click node_teamdraft "https://github.com/cricketmaestro18/team_game_js/blob/main/app.js"
click node_statswinner "https://github.com/cricketmaestro18/team_game_js/blob/main/app.js"
click node_chasemaster "https://github.com/cricketmaestro18/team_game_js/blob/main/app.js"
click node_accounts "https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs"
click node_history "https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs"
click node_themefeatures "https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs"
click node_statlookup "https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs"
click node_playerimages "https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs"
click node_squadservice "https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs"
click node_accountdata "https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs"
click node_themedata "https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs"
click node_draftpool "https://github.com/cricketmaestro18/team_game_js/blob/main/server/draft-players.json"
click node_playerindex "https://github.com/cricketmaestro18/team_game_js/blob/main/server/player-index.json"
click node_squadfile "https://github.com/cricketmaestro18/team_game_js/blob/main/server/chase-squads.json"

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_webshell,node_browserapp,node_styles toneBlue
class node_teamdraft,node_statswinner,node_chasemaster toneAmber
class node_accounts,node_history,node_themefeatures,node_statlookup,node_playerimages,node_squadservice toneMint
class node_accountdata,node_themedata,node_draftpool,node_playerindex,node_squadfile toneRose
class node_cricketstats,node_imageproviders,node_cricketnews,node_player toneIndigo
```

## Components

### Browser experience

- [Web shell](https://github.com/cricketmaestro18/team_game_js/blob/main/index.html): `index.html`
- [Game interface](https://github.com/cricketmaestro18/team_game_js/blob/main/app.js): `app.js`
- [Game styling](https://github.com/cricketmaestro18/team_game_js/blob/main/style.css): `style.css`

### Cricket games

- [Team Draft](https://github.com/cricketmaestro18/team_game_js/blob/main/app.js): `app.js`
- [Stats Winner](https://github.com/cricketmaestro18/team_game_js/blob/main/app.js): `app.js`
- [Chase Master](https://github.com/cricketmaestro18/team_game_js/blob/main/app.js): `app.js`

### Server features

- [Accounts and profile](https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs): `server.mjs`
- [Game history](https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs): `server.mjs`
- [Theme settings](https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs): `server.mjs`
- [Player stats lookup](https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs): `server.mjs`
- [Player images](https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs): `server.mjs`
- [Chase squads](https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs): `server.mjs`

### Saved data

- [Account and history data](https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs): `server.mjs`
- [Saved themes](https://github.com/cricketmaestro18/team_game_js/blob/main/server.mjs): `server.mjs`
- [Draft player pool](https://github.com/cricketmaestro18/team_game_js/blob/main/server/draft-players.json): `server/draft-players.json`
- [Player index](https://github.com/cricketmaestro18/team_game_js/blob/main/server/player-index.json): `server/player-index.json`
- [Squad fallback](https://github.com/cricketmaestro18/team_game_js/blob/main/server/chase-squads.json): `server/chase-squads.json`

### External cricket data

- **Cricket stats sites**
- **Player image sources**
- **Squad news source**

### Other components

- **Player**

## Connections

- Player → Web shell: opens
- Web shell → Game interface: hosts
- Player → Game interface: plays (evidence: `app.js`)
- Game interface → Game styling: uses styles
- Game interface → Team Draft: configures (evidence: `app.js`)
- Game interface → Stats Winner: configures (evidence: `app.js`)
- Game interface → Chase Master: configures (evidence: `app.js`)
- Game interface → Accounts and profile: calls API
- Game interface → Game history: saves results
- Game interface → Theme settings: loads themes
- Game interface → Player stats lookup: requests stats
- Game interface → Player images: requests images
- Game interface → Chase squads: loads squads
- Accounts and profile → Account and history data: reads and writes (evidence: `server.mjs`)
- Game history → Account and history data: persists history (evidence: `README.md`)
- Theme settings → Saved themes: reads and writes (evidence: `server.mjs`)
- Team Draft → Draft player pool: loads players (evidence: `README.md`)
- Player stats lookup → Cricket stats sites: fetches stats (evidence: `server.mjs`)
- Player images → Player image sources: looks up images (evidence: `server.mjs`)
- Chase squads → Squad fallback: reads fallback (evidence: `server.mjs`)
- Chase squads → Squad news source: fetches squads (evidence: `server.mjs`)
- Player stats lookup → Player index: uses index
