# rajat-kes/the-number-hunt architecture

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

- Interactive diagram: https://gitdiagram.com/rajat-kes/the-number-hunt
- Repository: https://github.com/rajat-kes/the-number-hunt

## Overview

Number Hunt is a browser-based, local two-player number-search game. Players configure a match, take turns choosing a target and searching a generated board, and compete by elapsed-time scores; results and player history are retained locally. The game script also owns session recovery, profile/theme presentation, and match state. Configuration supplies shared defaults, while audio and runtime SEO are separate browser features. The README is empty, so capability coverage is based on the sampled source; the game excerpt is partial, and links to its internal stages are not asserted where calls were not shown.

Main entry points: [`game.js`](https://github.com/rajat-kes/the-number-hunt/blob/main/game.js) (Game flow), [`audio.js`](https://github.com/rajat-kes/the-number-hunt/blob/main/audio.js) (Sound controls), [`config.js`](https://github.com/rajat-kes/the-number-hunt/blob/main/config.js) (Game configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_match["Match play"]
  node_game["Game flow<br/>[game.js]"]
  node_config["Game configuration<br/>[config.js]"]
  node_match_setup["Match setup<br/>[game.js]"]
  node_target_entry["Target entry<br/>[game.js]"]
  node_number_search["Number search<br/>[game.js]"]
  node_match_results["Match results<br/>[game.js]"]
  node_session_recovery["Session recovery<br/>[game.js]"]
end

subgraph group_profile["Player profile"]
  node_player_profile["Player profile<br/>[game.js]"]
  node_theme_selection["Theme selection<br/>[game.js]"]
  node_game_history["Game history<br/>[game.js]"]
  node_local_storage[("Browser storage")]
end

subgraph group_platform["Browser features"]
  node_sound_controls["Sound controls<br/>[audio.js]"]
  node_web_audio["Web Audio API"]
  node_runtime_seo["Runtime SEO<br/>[seo.js]"]
end

node_players(("Players"))

node_players -->|"play"| node_game
node_game -->|"reads settings"| node_config
node_game -->|"handles setup"| node_match_setup
node_game -->|"handles target"| node_target_entry
node_game -->|"handles search"| node_number_search
node_game -.->|"handles results"| node_match_results
node_game -->|"restores session"| node_session_recovery
node_game -->|"renders profile"| node_player_profile
node_game -->|"renders themes"| node_theme_selection
node_game -->|"renders history"| node_game_history
node_game -->|"reads/writes"| node_local_storage
node_player_profile -->|"reads/writes"| node_local_storage
node_game -->|"starts audio"| node_sound_controls
node_sound_controls -->|"plays tones"| node_web_audio
node_sound_controls -->|"persists mute"| node_local_storage

click node_game "https://github.com/rajat-kes/the-number-hunt/blob/main/game.js"
click node_config "https://github.com/rajat-kes/the-number-hunt/blob/main/config.js"
click node_match_setup "https://github.com/rajat-kes/the-number-hunt/blob/main/game.js"
click node_target_entry "https://github.com/rajat-kes/the-number-hunt/blob/main/game.js"
click node_number_search "https://github.com/rajat-kes/the-number-hunt/blob/main/game.js"
click node_match_results "https://github.com/rajat-kes/the-number-hunt/blob/main/game.js"
click node_session_recovery "https://github.com/rajat-kes/the-number-hunt/blob/main/game.js"
click node_player_profile "https://github.com/rajat-kes/the-number-hunt/blob/main/game.js"
click node_theme_selection "https://github.com/rajat-kes/the-number-hunt/blob/main/game.js"
click node_game_history "https://github.com/rajat-kes/the-number-hunt/blob/main/game.js"
click node_sound_controls "https://github.com/rajat-kes/the-number-hunt/blob/main/audio.js"
click node_runtime_seo "https://github.com/rajat-kes/the-number-hunt/blob/main/seo.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_game,node_config,node_match_setup,node_target_entry,node_number_search,node_match_results,node_session_recovery toneBlue
class node_player_profile,node_theme_selection,node_game_history,node_local_storage toneAmber
class node_sound_controls,node_web_audio,node_runtime_seo toneMint
class node_players toneIndigo
```

## Components

### Match play

- [Game flow](https://github.com/rajat-kes/the-number-hunt/blob/main/game.js): `game.js`
- [Game configuration](https://github.com/rajat-kes/the-number-hunt/blob/main/config.js): `config.js`
- [Match setup](https://github.com/rajat-kes/the-number-hunt/blob/main/game.js): `game.js`
- [Target entry](https://github.com/rajat-kes/the-number-hunt/blob/main/game.js): `game.js`
- [Number search](https://github.com/rajat-kes/the-number-hunt/blob/main/game.js): `game.js`
- [Match results](https://github.com/rajat-kes/the-number-hunt/blob/main/game.js): `game.js`
- [Session recovery](https://github.com/rajat-kes/the-number-hunt/blob/main/game.js): `game.js`

### Player profile

- [Player profile](https://github.com/rajat-kes/the-number-hunt/blob/main/game.js): `game.js`
- [Theme selection](https://github.com/rajat-kes/the-number-hunt/blob/main/game.js): `game.js`
- [Game history](https://github.com/rajat-kes/the-number-hunt/blob/main/game.js): `game.js`
- **Browser storage**

### Browser features

- [Sound controls](https://github.com/rajat-kes/the-number-hunt/blob/main/audio.js): `audio.js`
- **Web Audio API**
- [Runtime SEO](https://github.com/rajat-kes/the-number-hunt/blob/main/seo.js): `seo.js`

### Other components

- **Players**

## Connections

- Players → Game flow: play
- Game flow → Game configuration: reads settings (evidence: `game.js`)
- Game flow → Match setup: handles setup (evidence: `game.js`)
- Game flow → Target entry: handles target (evidence: `game.js`)
- Game flow → Number search: handles search (evidence: `game.js`)
- Game flow → Match results: handles results (evidence: `game.js`)
- Game flow → Session recovery: restores session (evidence: `game.js`)
- Game flow → Player profile: renders profile (evidence: `game.js`)
- Game flow → Theme selection: renders themes (evidence: `game.js`)
- Game flow → Game history: renders history (evidence: `game.js`)
- Game flow → Browser storage: reads/writes (evidence: `game.js`)
- Player profile → Browser storage: reads/writes
- Game flow → Sound controls: starts audio (evidence: `game.js`)
- Sound controls → Web Audio API: plays tones (evidence: `audio.js`)
- Sound controls → Browser storage: persists mute (evidence: `audio.js`)
