# gityuanbao/liuxiaoyan-action architecture

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

- Interactive diagram: https://gitdiagram.com/gityuanbao/liuxiaoyan-action
- Repository: https://github.com/gityuanbao/liuxiaoyan-action

## Overview

《刘晓艳行动》 is a vocabulary-learning game: players choose a wordbook and study plan, answer questions through lessons and challenges, review missed words, and build progression. The Godot bridge session coordinates learning, custom books, progression, and recruitment; the web entry adapts that runtime to browser storage. The README also documents expeditions, operator recruitment, Toy leaderboard sync, and save/export capabilities. The tree includes a substantial legacy typing-duel client/server alongside the main game; excerpts show some imports and calls, but not all runtime wiring, so uncertain links are omitted.

Main entry points: [`godot/bridge/session.mjs`](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/session.mjs) (Game session), [`godot/legacy/packages/client/src/academy/VocabularyBattle.tsx`](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/academy/VocabularyBattle.tsx) (Vocabulary battle), [`godot/legacy/packages/client/src/App.tsx`](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/App.tsx) (Game screens), [`web/entry.mjs`](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/web/entry.mjs) (Web entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Learning game"]
  node_gameui["Game screens<br/>[App.tsx]"]
  node_vocab["Vocabulary battle"]
  node_icon["Game iconography<br/>[Icon.tsx]"]
end

subgraph group_bridge["Game runtime"]
  node_runtime["Game session<br/>[session.mjs]"]
  node_books[("Wordbooks<br/>[wordbooks.mjs]")]
  node_custom["Custom wordbooks<br/>[custom-book.mjs]"]
  node_importer["Wordbook import"]
  node_study["Study engine<br/>[study.mjs]"]
  node_questions["Question generation"]
  node_missions["Study missions<br/>[study-mission.mjs]"]
  node_progress["Progression rewards<br/>[progression.mjs]"]
  node_recruit["Operator recruitment<br/>[recruitment.mjs]"]
  node_leaderboard["Toy leaderboard"]
end

subgraph group_web["Browser adapter"]
  node_webentry["Web entry<br/>[entry.mjs]"]
  node_browserstorage[("Browser save store<br/>[storage.mjs]")]
end

subgraph group_legacy["Legacy typing duel"]
  node_practice["Practice engine<br/>[engine.ts]"]
  node_clientstore[("Client state<br/>[store.ts]")]
  node_wsclient["Multiplayer client<br/>[useWebSocket.ts]"]
  node_duelserver["Duel server<br/>[index.ts]"]
  node_gameroom["Match rooms<br/>[game-room.ts]"]
  node_sharedtypes["Shared duel rules<br/>[index.ts]"]
  node_audio["Sound effects<br/>[audio.ts]"]
end

node_player(("Player"))

node_player -->|"uses"| node_gameui
node_gameui -->|"opens lesson"| node_vocab
node_gameui -.->|"renders"| node_icon
node_vocab -->|"records learning"| node_study
node_vocab -.->|"requests questions"| node_questions
node_runtime -->|"loads books"| node_books
node_runtime -->|"loads custom book"| node_custom
node_runtime -->|"coordinates study"| node_study
node_runtime -->|"handles missions"| node_missions
node_runtime -->|"claims rewards"| node_progress
node_runtime -->|"handles recruitment"| node_recruit
node_custom -->|"imports lists"| node_importer
node_webentry -->|"starts session"| node_runtime
node_webentry -->|"configures saves"| node_browserstorage
node_player -->|"opens game"| node_webentry
node_practice -->|"updates state"| node_clientstore
node_wsclient -->|"updates state"| node_clientstore
node_duelserver -->|"routes matches"| node_gameroom
node_vocab -->|"plays effects"| node_audio
node_practice -->|"plays effects"| node_audio

click node_gameui "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/App.tsx"
click node_vocab "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/academy/VocabularyBattle.tsx"
click node_icon "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/academy/Icon.tsx"
click node_runtime "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/session.mjs"
click node_books "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/wordbooks.mjs"
click node_custom "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/custom-book.mjs"
click node_importer "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/wordbook-import.mjs"
click node_study "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/study.mjs"
click node_questions "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/choice-questions.mjs"
click node_missions "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/study-mission.mjs"
click node_progress "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/progression.mjs"
click node_recruit "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/recruitment.mjs"
click node_leaderboard "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/toy-leaderboard.mjs"
click node_webentry "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/web/entry.mjs"
click node_browserstorage "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/web/storage.mjs"
click node_practice "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/practice/engine.ts"
click node_clientstore "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/store.ts"
click node_wsclient "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/hooks/useWebSocket.ts"
click node_duelserver "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/server/src/index.ts"
click node_gameroom "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/server/src/game-room.ts"
click node_sharedtypes "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/shared/src/index.ts"
click node_audio "https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/audio.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_gameui,node_vocab,node_icon toneBlue
class node_runtime,node_books,node_custom,node_importer,node_study,node_questions,node_missions,node_progress,node_recruit,node_leaderboard toneAmber
class node_webentry,node_browserstorage toneMint
class node_practice,node_clientstore,node_wsclient,node_duelserver,node_gameroom,node_sharedtypes,node_audio toneRose
class node_player toneIndigo
```

## Components

### Learning game

- [Game screens](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/App.tsx): `godot/legacy/packages/client/src/App.tsx`
- [Vocabulary battle](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/academy/VocabularyBattle.tsx): `godot/legacy/packages/client/src/academy/VocabularyBattle.tsx`
- [Game iconography](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/academy/Icon.tsx): `godot/legacy/packages/client/src/academy/Icon.tsx`

### Game runtime

- [Game session](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/session.mjs): `godot/bridge/session.mjs`
- [Wordbooks](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/wordbooks.mjs): `godot/bridge/wordbooks.mjs`
- [Custom wordbooks](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/custom-book.mjs): `godot/bridge/custom-book.mjs`
- [Wordbook import](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/wordbook-import.mjs): `godot/bridge/wordbook-import.mjs`
- [Study engine](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/study.mjs): `godot/bridge/study.mjs`
- [Question generation](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/choice-questions.mjs): `godot/bridge/choice-questions.mjs`
- [Study missions](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/study-mission.mjs): `godot/bridge/study-mission.mjs`
- [Progression rewards](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/progression.mjs): `godot/bridge/progression.mjs`
- [Operator recruitment](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/recruitment.mjs): `godot/bridge/recruitment.mjs`
- [Toy leaderboard](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/bridge/toy-leaderboard.mjs): `godot/bridge/toy-leaderboard.mjs`

### Browser adapter

- [Web entry](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/web/entry.mjs): `web/entry.mjs`
- [Browser save store](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/web/storage.mjs): `web/storage.mjs`

### Legacy typing duel

- [Practice engine](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/practice/engine.ts): `godot/legacy/packages/client/src/practice/engine.ts`
- [Client state](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/store.ts): `godot/legacy/packages/client/src/store.ts`
- [Multiplayer client](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/hooks/useWebSocket.ts): `godot/legacy/packages/client/src/hooks/useWebSocket.ts`
- [Duel server](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/server/src/index.ts): `godot/legacy/packages/server/src/index.ts`
- [Match rooms](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/server/src/game-room.ts): `godot/legacy/packages/server/src/game-room.ts`
- [Shared duel rules](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/shared/src/index.ts): `godot/legacy/packages/shared/src/index.ts`
- [Sound effects](https://github.com/gityuanbao/liuxiaoyan-action/blob/main/godot/legacy/packages/client/src/audio.ts): `godot/legacy/packages/client/src/audio.ts`

### Other components

- **Player**

## Connections

- Player → Game screens: uses (evidence: `godot/legacy/packages/client/src/App.tsx`)
- Game screens → Vocabulary battle: opens lesson (evidence: `godot/legacy/packages/client/src/App.tsx`)
- Game screens → Game iconography: renders
- Vocabulary battle → Study engine: records learning (evidence: `godot/legacy/packages/client/src/academy/VocabularyBattle.tsx`)
- Vocabulary battle → Question generation: requests questions
- Game session → Wordbooks: loads books (evidence: `godot/bridge/session.mjs`)
- Game session → Custom wordbooks: loads custom book (evidence: `godot/bridge/session.mjs`)
- Game session → Study engine: coordinates study (evidence: `godot/bridge/session.mjs`)
- Game session → Study missions: handles missions (evidence: `godot/bridge/session.mjs`)
- Game session → Progression rewards: claims rewards (evidence: `godot/bridge/session.mjs`)
- Game session → Operator recruitment: handles recruitment (evidence: `godot/bridge/session.mjs`)
- Custom wordbooks → Wordbook import: imports lists (evidence: `godot/bridge/custom-book.mjs`)
- Web entry → Game session: starts session (evidence: `web/entry.mjs`)
- Web entry → Browser save store: configures saves (evidence: `web/entry.mjs`)
- Player → Web entry: opens game (evidence: `web/entry.mjs`)
- Practice engine → Client state: updates state (evidence: `godot/legacy/packages/client/src/practice/engine.ts`)
- Multiplayer client → Client state: updates state (evidence: `godot/legacy/packages/client/src/hooks/useWebSocket.ts`)
- Duel server → Match rooms: routes matches (evidence: `godot/legacy/packages/server/src/index.ts`)
- Vocabulary battle → Sound effects: plays effects (evidence: `godot/legacy/packages/client/src/academy/VocabularyBattle.tsx`)
- Practice engine → Sound effects: plays effects (evidence: `godot/legacy/packages/client/src/practice/engine.ts`)
