# eniline/handle architecture

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

- Interactive diagram: https://gitdiagram.com/eniline/handle
- Repository: https://github.com/eniline/handle

## Overview

汉兜 is a browser-based Chinese idiom Wordle: players choose a daily, random, or custom game, enter guesses, receive feedback and hints, and can review results and career statistics. The graph also preserves the documented evaluation and language-input tooling branches. Evaluation-worker and UI connections are based on indexed imports or excerpts; unsampled components are represented only where their subsystem is clear, without inferring internal call sequences.

Main entry points: [`src/state.ts`](https://github.com/eniline/handle/blob/main/src/state.ts) (Game state), [`src/components/Play.vue`](https://github.com/eniline/handle/blob/main/src/components/Play.vue) (Play screen), [`packages/tools/src/pinyin/parse.ts`](https://github.com/eniline/handle/blob/main/packages/tools/src/pinyin/parse.ts) (Pinyin parsing), [`src/components/Dashboard.vue`](https://github.com/eniline/handle/blob/main/src/components/Dashboard.vue) (Career dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Game experience"]
  node_app["App shell<br/>[App.vue]"]
  node_play["Play screen<br/>[Play.vue]"]
  node_dashboard["Career dashboard<br/>[Dashboard.vue]"]
  node_sharing["Sharing UI<br/>[CustomShare.vue]"]
end

subgraph group_runtime["Game runtime"]
  node_game_state["Game state<br/>[state.ts]"]
  node_game_logic["Game rules<br/>[check.ts]"]
  node_random_answers["Random answers<br/>[random.ts]"]
  node_answer_schedule["Daily answers<br/>[list.ts]"]
  node_idioms[("Idiom data<br/>[idioms.ts]")]
end

subgraph group_evaluation["Guess evaluation"]
  node_evaluation_session["Evaluation session<br/>[worker.ts]"]
  node_evaluation_engine["Evaluation engine<br/>[index.ts]"]
  node_evaluation_worker["Worker factory<br/>[worker-factory.ts]"]
end

subgraph group_language["Language tools"]
  node_pinyin_parse["Pinyin parsing<br/>[parse.ts]"]
  node_pinyin_phonetics["Pinyin phonetics<br/>[phonetic.ts]"]
  node_shuangpin["Shuangpin conversion<br/>[covert.ts]"]
  node_zhuyin["Zhuyin conversion<br/>[convert.ts]"]
end

subgraph group_records["Data and records"]
  node_career_records["Career records<br/>[career.ts]"]
  node_browser_storage[("Browser storage<br/>[storage.ts]")]
end

node_player(("Player"))

node_player -->|"opens"| node_app
node_app -->|"renders"| node_play
node_play -->|"uses"| node_game_state
node_play -->|"uses"| node_browser_storage
node_play -->|"uses"| node_game_logic
node_game_state -->|"gets daily answer"| node_answer_schedule
node_game_state -->|"gets random answer"| node_random_answers
node_game_state -->|"reads and writes"| node_browser_storage
node_game_state -->|"creates worker"| node_evaluation_worker
node_evaluation_worker -->|"runs"| node_evaluation_session
node_evaluation_session -->|"calls"| node_evaluation_engine
node_evaluation_engine -->|"gets pinyin"| node_idioms
node_dashboard -->|"summarizes"| node_career_records
node_dashboard -->|"reads"| node_game_state
node_dashboard -->|"reads"| node_browser_storage
node_pinyin_phonetics -->|"uses"| node_pinyin_parse
node_shuangpin -->|"uses"| node_pinyin_parse
node_zhuyin -->|"uses"| node_pinyin_parse
node_play -->|"uses input tools"| node_pinyin_parse
node_sharing -.->|"shares game"| node_game_state

click node_app "https://github.com/eniline/handle/blob/main/src/App.vue"
click node_play "https://github.com/eniline/handle/blob/main/src/components/Play.vue"
click node_dashboard "https://github.com/eniline/handle/blob/main/src/components/Dashboard.vue"
click node_sharing "https://github.com/eniline/handle/blob/main/src/components/CustomShare.vue"
click node_game_state "https://github.com/eniline/handle/blob/main/src/state.ts"
click node_game_logic "https://github.com/eniline/handle/blob/main/src/logic/check.ts"
click node_random_answers "https://github.com/eniline/handle/blob/main/src/logic/random.ts"
click node_answer_schedule "https://github.com/eniline/handle/blob/main/src/answers/list.ts"
click node_idioms "https://github.com/eniline/handle/blob/main/src/data/idioms.ts"
click node_evaluation_session "https://github.com/eniline/handle/blob/main/src/eval/worker.ts"
click node_evaluation_engine "https://github.com/eniline/handle/blob/main/src/eval/index.ts"
click node_evaluation_worker "https://github.com/eniline/handle/blob/main/src/eval/worker-factory.ts"
click node_career_records "https://github.com/eniline/handle/blob/main/src/logic/career.ts"
click node_browser_storage "https://github.com/eniline/handle/blob/main/src/storage.ts"
click node_pinyin_parse "https://github.com/eniline/handle/blob/main/packages/tools/src/pinyin/parse.ts"
click node_pinyin_phonetics "https://github.com/eniline/handle/blob/main/packages/tools/src/pinyin/phonetic.ts"
click node_shuangpin "https://github.com/eniline/handle/blob/main/packages/tools/src/shuangpin/covert.ts"
click node_zhuyin "https://github.com/eniline/handle/blob/main/packages/tools/src/zhuyin/convert.ts"

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_play,node_dashboard,node_sharing toneBlue
class node_game_state,node_game_logic,node_random_answers,node_answer_schedule,node_idioms toneAmber
class node_evaluation_session,node_evaluation_engine,node_evaluation_worker toneMint
class node_pinyin_parse,node_pinyin_phonetics,node_shuangpin,node_zhuyin toneRose
class node_career_records,node_browser_storage,node_player toneIndigo
```

## Components

### Game experience

- [App shell](https://github.com/eniline/handle/blob/main/src/App.vue): `src/App.vue`
- [Play screen](https://github.com/eniline/handle/blob/main/src/components/Play.vue): `src/components/Play.vue`
- [Career dashboard](https://github.com/eniline/handle/blob/main/src/components/Dashboard.vue): `src/components/Dashboard.vue`
- [Sharing UI](https://github.com/eniline/handle/blob/main/src/components/CustomShare.vue): `src/components/CustomShare.vue`

### Game runtime

- [Game state](https://github.com/eniline/handle/blob/main/src/state.ts): `src/state.ts`
- [Game rules](https://github.com/eniline/handle/blob/main/src/logic/check.ts): `src/logic/check.ts`
- [Random answers](https://github.com/eniline/handle/blob/main/src/logic/random.ts): `src/logic/random.ts`
- [Daily answers](https://github.com/eniline/handle/blob/main/src/answers/list.ts): `src/answers/list.ts`
- [Idiom data](https://github.com/eniline/handle/blob/main/src/data/idioms.ts): `src/data/idioms.ts`

### Guess evaluation

- [Evaluation session](https://github.com/eniline/handle/blob/main/src/eval/worker.ts): `src/eval/worker.ts`
- [Evaluation engine](https://github.com/eniline/handle/blob/main/src/eval/index.ts): `src/eval/index.ts`
- [Worker factory](https://github.com/eniline/handle/blob/main/src/eval/worker-factory.ts): `src/eval/worker-factory.ts`

### Language tools

- [Pinyin parsing](https://github.com/eniline/handle/blob/main/packages/tools/src/pinyin/parse.ts): `packages/tools/src/pinyin/parse.ts`
- [Pinyin phonetics](https://github.com/eniline/handle/blob/main/packages/tools/src/pinyin/phonetic.ts): `packages/tools/src/pinyin/phonetic.ts`
- [Shuangpin conversion](https://github.com/eniline/handle/blob/main/packages/tools/src/shuangpin/covert.ts): `packages/tools/src/shuangpin/covert.ts`
- [Zhuyin conversion](https://github.com/eniline/handle/blob/main/packages/tools/src/zhuyin/convert.ts): `packages/tools/src/zhuyin/convert.ts`

### Data and records

- [Career records](https://github.com/eniline/handle/blob/main/src/logic/career.ts): `src/logic/career.ts`
- [Browser storage](https://github.com/eniline/handle/blob/main/src/storage.ts): `src/storage.ts`

### Other components

- **Player**

## Connections

- Player → App shell: opens (evidence: `README.md`)
- App shell → Play screen: renders (evidence: `src/App.vue`)
- Play screen → Game state: uses (evidence: `src/components/Play.vue`)
- Play screen → Browser storage: uses (evidence: `src/components/Play.vue`)
- Play screen → Game rules: uses (evidence: `src/components/Play.vue`)
- Game state → Daily answers: gets daily answer (evidence: `src/state.ts`)
- Game state → Random answers: gets random answer (evidence: `src/state.ts`)
- Game state → Browser storage: reads and writes (evidence: `src/state.ts`)
- Game state → Worker factory: creates worker (evidence: `src/state.ts`)
- Worker factory → Evaluation session: runs
- Evaluation session → Evaluation engine: calls (evidence: `src/eval/worker.ts`)
- Evaluation engine → Idiom data: gets pinyin (evidence: `src/eval/index.ts`)
- Career dashboard → Career records: summarizes (evidence: `src/components/Dashboard.vue`)
- Career dashboard → Game state: reads (evidence: `src/components/Dashboard.vue`)
- Career dashboard → Browser storage: reads (evidence: `src/components/Dashboard.vue`)
- Pinyin phonetics → Pinyin parsing: uses (evidence: `packages/tools/src/pinyin/phonetic.ts`)
- Shuangpin conversion → Pinyin parsing: uses (evidence: `packages/tools/src/shuangpin/covert.ts`)
- Zhuyin conversion → Pinyin parsing: uses (evidence: `packages/tools/src/zhuyin/convert.ts`)
- Play screen → Pinyin parsing: uses input tools (evidence: `src/components/Play.vue`)
- Sharing UI → Game state: shares game
