# nathann-275/jumpshot_dailygame architecture

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

- Interactive diagram: https://gitdiagram.com/nathann-275/jumpshot_dailygame
- Repository: https://github.com/nathann-275/jumpshot_dailygame

## Overview

Jumpshot is a browser-based basketball trivia arcade with a daily game and a separate live-versus mode. The daily flow presents shared NBA player prompts and league trivia, scores accepted answers, and saves a browser-local attempt and personal best. Versus uses a frontend to join matchmaking and play timed matches; a Cloudflare Worker coordinates queues and Durable Object matches using an exported question bank. Frontend implementation was not sampled, so its component links reflect README descriptions; backend links are limited to relationships visible in the Worker excerpt.

Main entry points: [`dist/game.js`](https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/game.js) (Daily Game UI), [`worker/index.mjs`](https://github.com/nathann-275/jumpshot_dailygame/blob/main/worker/index.mjs) (Live Match), [`dist/versus.js`](https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/versus.js) (Versus Client), [`dist/versus.html`](https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/versus.html) (Versus Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_daily["Daily Trivia"]
  node_daily_ui["Daily Game UI<br/>[game.js]"]
  node_daily_storage[("Browser Storage<br/>[game.js]")]
end

subgraph group_versus_ui["Versus Frontend"]
  node_versus_page["Versus Page<br/>[versus.html]"]
  node_versus_client["Versus Client<br/>[versus.js]"]
  node_versus_config["Worker Endpoint Config<br/>[versus-config.js]"]
end

subgraph group_backend["Versus Backend"]
  node_worker_api["Worker API<br/>[index.mjs]"]
  node_queue["Matchmaking Queue<br/>[index.mjs]"]
  node_match["Live Match<br/>[index.mjs]"]
  node_match_storage[("Match State Storage<br/>[index.mjs]")]
end

subgraph group_content["Question Content"]
  node_player_prompts["Player Prompts<br/>[players.js]"]
  node_trivia_bank["Trivia Questions<br/>[questions.js]"]
  node_league_questions["League Questions"]
  node_dated_trivia["Dated Trivia<br/>[dated-trivia.js]"]
  node_bank_data["Versus Question Bank<br/>[bank.json]"]
end

node_player(("Player"))
node_browser(("Web Browser"))
node_cloudflare[("Cloudflare Durable Objects")]

node_player -->|"plays daily"| node_daily_ui
node_daily_ui -->|"presents prompts"| node_player_prompts
node_daily_ui -->|"selects questions"| node_trivia_bank
node_daily_ui -->|"draws league trivia"| node_league_questions
node_daily_ui -->|"includes dated prompts"| node_dated_trivia
node_daily_ui -->|"saves attempt"| node_daily_storage
node_player -->|"opens versus"| node_versus_page
node_versus_page -.->|"loads client"| node_versus_client
node_versus_client -.->|"reads endpoint"| node_versus_config
node_versus_client -->|"sends match requests"| node_worker_api
node_worker_api -->|"dispatches queue requests"| node_queue
node_worker_api -->|"dispatches match requests"| node_match
node_queue -->|"initializes assignment"| node_match
node_match -->|"reads and saves state"| node_match_storage
node_match -->|"selects and checks answers"| node_bank_data
node_queue -.->|"uses durable storage"| node_cloudflare
node_match -.->|"runs as durable object"| node_cloudflare
node_versus_client -.->|"runs in"| node_browser

click node_daily_ui "https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/game.js"
click node_player_prompts "https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/players.js"
click node_trivia_bank "https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/questions.js"
click node_league_questions "https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/league-questions.js"
click node_dated_trivia "https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/dated-trivia.js"
click node_daily_storage "https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/game.js"
click node_versus_page "https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/versus.html"
click node_versus_client "https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/versus.js"
click node_versus_config "https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/versus-config.js"
click node_worker_api "https://github.com/nathann-275/jumpshot_dailygame/blob/main/worker/index.mjs"
click node_queue "https://github.com/nathann-275/jumpshot_dailygame/blob/main/worker/index.mjs"
click node_match "https://github.com/nathann-275/jumpshot_dailygame/blob/main/worker/index.mjs"
click node_match_storage "https://github.com/nathann-275/jumpshot_dailygame/blob/main/worker/index.mjs"
click node_bank_data "https://github.com/nathann-275/jumpshot_dailygame/blob/main/worker/bank.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_daily_ui,node_daily_storage,node_browser toneBlue
class node_versus_page,node_versus_client,node_versus_config,node_cloudflare toneAmber
class node_worker_api,node_queue,node_match,node_match_storage toneMint
class node_player_prompts,node_trivia_bank,node_league_questions,node_dated_trivia,node_bank_data toneRose
class node_player toneIndigo
```

## Components

### Daily Trivia

- [Daily Game UI](https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/game.js): `dist/game.js`
- [Browser Storage](https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/game.js): `dist/game.js`

### Versus Frontend

- [Versus Page](https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/versus.html): `dist/versus.html`
- [Versus Client](https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/versus.js): `dist/versus.js`
- [Worker Endpoint Config](https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/versus-config.js): `dist/versus-config.js`

### Versus Backend

- [Worker API](https://github.com/nathann-275/jumpshot_dailygame/blob/main/worker/index.mjs): `worker/index.mjs`
- [Matchmaking Queue](https://github.com/nathann-275/jumpshot_dailygame/blob/main/worker/index.mjs): `worker/index.mjs`
- [Live Match](https://github.com/nathann-275/jumpshot_dailygame/blob/main/worker/index.mjs): `worker/index.mjs`
- [Match State Storage](https://github.com/nathann-275/jumpshot_dailygame/blob/main/worker/index.mjs): `worker/index.mjs`

### Question Content

- [Player Prompts](https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/players.js): `dist/players.js`
- [Trivia Questions](https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/questions.js): `dist/questions.js`
- [League Questions](https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/league-questions.js): `dist/league-questions.js`
- [Dated Trivia](https://github.com/nathann-275/jumpshot_dailygame/blob/main/dist/dated-trivia.js): `dist/dated-trivia.js`
- [Versus Question Bank](https://github.com/nathann-275/jumpshot_dailygame/blob/main/worker/bank.json): `worker/bank.json`

### Other components

- **Player**
- **Web Browser**
- **Cloudflare Durable Objects**

## Connections

- Player → Daily Game UI: plays daily (evidence: `README.md`)
- Daily Game UI → Player Prompts: presents prompts (evidence: `README.md`)
- Daily Game UI → Trivia Questions: selects questions (evidence: `README.md`)
- Daily Game UI → League Questions: draws league trivia (evidence: `README.md`)
- Daily Game UI → Dated Trivia: includes dated prompts (evidence: `README.md`)
- Daily Game UI → Browser Storage: saves attempt (evidence: `README.md`)
- Player → Versus Page: opens versus (evidence: `README.md`)
- Versus Page → Versus Client: loads client
- Versus Client → Worker Endpoint Config: reads endpoint
- Versus Client → Worker API: sends match requests (evidence: `README.md`)
- Worker API → Matchmaking Queue: dispatches queue requests (evidence: `worker/index.mjs`)
- Worker API → Live Match: dispatches match requests (evidence: `worker/index.mjs`)
- Matchmaking Queue → Live Match: initializes assignment (evidence: `worker/index.mjs`)
- Live Match → Match State Storage: reads and saves state (evidence: `worker/index.mjs`)
- Live Match → Versus Question Bank: selects and checks answers (evidence: `worker/index.mjs`)
- Matchmaking Queue → Cloudflare Durable Objects: uses durable storage
- Live Match → Cloudflare Durable Objects: runs as durable object
- Versus Client → Web Browser: runs in
