# trankite/snap.voracity architecture

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

- Interactive diagram: https://gitdiagram.com/trankite/snap.voracity
- Repository: https://github.com/trankite/snap.voracity

## Overview

Snap.Voracity is a console command application for E-Hentai/ExHentai gallery downloads and Hoyolab account, game, and community tasks. Its main workflow reads command-line or interactive input, parses it into commands, and dispatches through the terminal manager; domain commands then handle the requested operation. The tree and README establish additional capabilities, but excerpts do not show every command’s internal calls, so those links are kept conservative. The sampled gallery parser explicitly requests and deserializes gallery pages into image-URL tickets.

Main entry points: [`Common/Source/Web/HttpContext.cs`](https://github.com/trankite/snap.voracity/blob/master/Common/Source/Web/HttpContext.cs) (HTTP context), [`Common/Source/Service/Terminal/Hoyolab`](https://github.com/trankite/snap.voracity/tree/master/Common/Source/Service/Terminal/Hoyolab) (Hoyolab commands), [`Common/Source/Service/Terminal/TerminalManage.cs`](https://github.com/trankite/snap.voracity/blob/master/Common/Source/Service/Terminal/TerminalManage.cs) (Command manager), [`Terminal/Program.cs`](https://github.com/trankite/snap.voracity/blob/master/Terminal/Program.cs) (Program entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_terminal["Terminal runtime"]
  node_program["Program entry<br/>[Program.cs]"]
  node_parser["Command parser<br/>[CommandParser.cs]"]
  node_manager["Command manager<br/>[TerminalManage.cs]"]
  node_invoke["Terminal invocation<br/>[TerminalInvoke.cs]"]
  node_terminalcmd["Support commands"]
end

subgraph group_ehentai["Gallery downloads"]
  node_ehcommands["E-Hentai commands"]
  node_ehdown["Gallery downloader"]
  node_slideparser["Gallery page parser"]
  node_galleryapi["Gallery request and decoding"]
end

subgraph group_hoyolab["Hoyolab services"]
  node_hoyocommands["Hoyolab commands"]
  node_passport["Login and QR auth"]
  node_forum["Forum operations"]
  node_missionsign["Mission and check-in"]
  node_gameinfo["Game account data"]
end

subgraph group_shared["Shared services"]
  node_http["HTTP context<br/>[HttpContext.cs]"]
  node_tokens["Token persistence<br/>[TokenManager.cs]"]
  node_qr["QR generation<br/>[QRCode.cs]"]
  node_formula["Formula parsing"]
  node_files["File operations"]
end

node_user(("Console user"))
node_ehsite{{"E-Hentai service"}}
node_hoyosite{{"Hoyolab service"}}

node_user -->|"enters commands"| node_program
node_program -->|"parses input"| node_parser
node_program -->|"invokes"| node_invoke
node_invoke -->|"consumes commands"| node_parser
node_parser -->|"looks up commands"| node_manager
node_manager -->|"dispatches"| node_ehcommands
node_manager -->|"dispatches"| node_hoyocommands
node_manager -->|"dispatches"| node_terminalcmd
node_ehcommands -.->|"requests downloads"| node_ehdown
node_ehdown -.->|"parses gallery pages"| node_slideparser
node_slideparser -->|"builds requests"| node_galleryapi
node_slideparser -->|"sends requests"| node_http
node_http -->|"requests pages"| node_ehsite
node_hoyocommands -.->|"authenticates"| node_passport
node_hoyocommands -.->|"runs forum tasks"| node_forum
node_hoyocommands -.->|"runs tasks"| node_missionsign
node_hoyocommands -.->|"queries game data"| node_gameinfo
node_passport -.->|"uses HTTP context"| node_http
node_forum -.->|"uses HTTP context"| node_http
node_missionsign -.->|"uses HTTP context"| node_http
node_gameinfo -.->|"uses HTTP context"| node_http
node_http -.->|"requests API"| node_hoyosite
node_tokens -->|"reads and writes"| node_files
node_ehcommands -.->|"may persist credentials"| node_tokens
node_hoyocommands -.->|"may persist credentials"| node_tokens
node_terminalcmd -.->|"supports QR output"| node_qr
node_terminalcmd -.->|"supports formula task"| node_formula

click node_program "https://github.com/trankite/snap.voracity/blob/master/Terminal/Program.cs"
click node_parser "https://github.com/trankite/snap.voracity/blob/master/Common/Source/Service/Terminal/CommandParser.cs"
click node_manager "https://github.com/trankite/snap.voracity/blob/master/Common/Source/Service/Terminal/TerminalManage.cs"
click node_invoke "https://github.com/trankite/snap.voracity/blob/master/Common/Source/Service/Terminal/Support/TerminalInvoke.cs"
click node_terminalcmd "https://github.com/trankite/snap.voracity/tree/master/Common/Source/Service/Terminal/Support"
click node_ehcommands "https://github.com/trankite/snap.voracity/tree/master/Common/Source/Service/Terminal/EHentai"
click node_ehdown "https://github.com/trankite/snap.voracity/blob/master/Common/Source/Web/EHentai/Download/EHentaiDownloader.cs"
click node_slideparser "https://github.com/trankite/snap.voracity/blob/master/Common/Source/Web/EHentai/Download/EHentaiSlideParser.cs"
click node_galleryapi "https://github.com/trankite/snap.voracity/tree/master/Common/Source/Web/EHentai/Gallery"
click node_hoyocommands "https://github.com/trankite/snap.voracity/tree/master/Common/Source/Service/Terminal/Hoyolab"
click node_passport "https://github.com/trankite/snap.voracity/tree/master/Common/Source/Web/Hoyolab/Passport"
click node_forum "https://github.com/trankite/snap.voracity/tree/master/Common/Source/Web/Hoyolab/Bbs/Forum"
click node_missionsign "https://github.com/trankite/snap.voracity/tree/master/Common/Source/Web/Hoyolab/Bbs"
click node_gameinfo "https://github.com/trankite/snap.voracity/tree/master/Common/Source/Web/Hoyolab/Takumi"
click node_http "https://github.com/trankite/snap.voracity/blob/master/Common/Source/Web/HttpContext.cs"
click node_tokens "https://github.com/trankite/snap.voracity/blob/master/Common/Source/Model/Collection/Token/TokenManager.cs"
click node_qr "https://github.com/trankite/snap.voracity/blob/master/Common/Source/Service/Encode/QRCode/QRCode.cs"
click node_formula "https://github.com/trankite/snap.voracity/tree/master/Common/Source/Factory/Formula"
click node_files "https://github.com/trankite/snap.voracity/tree/master/Common/Source/Factory/Streams/FileOpen"

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_program,node_parser,node_manager,node_invoke,node_terminalcmd,node_user toneBlue
class node_ehcommands,node_ehdown,node_slideparser,node_galleryapi toneAmber
class node_hoyocommands,node_passport,node_forum,node_missionsign,node_gameinfo toneMint
class node_http,node_tokens,node_qr,node_formula,node_files toneRose
class node_ehsite,node_hoyosite toneIndigo
```

## Components

### Terminal runtime

- [Program entry](https://github.com/trankite/snap.voracity/blob/master/Terminal/Program.cs): `Terminal/Program.cs`
- [Command parser](https://github.com/trankite/snap.voracity/blob/master/Common/Source/Service/Terminal/CommandParser.cs): `Common/Source/Service/Terminal/CommandParser.cs`
- [Command manager](https://github.com/trankite/snap.voracity/blob/master/Common/Source/Service/Terminal/TerminalManage.cs): `Common/Source/Service/Terminal/TerminalManage.cs`
- [Terminal invocation](https://github.com/trankite/snap.voracity/blob/master/Common/Source/Service/Terminal/Support/TerminalInvoke.cs): `Common/Source/Service/Terminal/Support/TerminalInvoke.cs`
- [Support commands](https://github.com/trankite/snap.voracity/tree/master/Common/Source/Service/Terminal/Support): `Common/Source/Service/Terminal/Support`

### Gallery downloads

- [E-Hentai commands](https://github.com/trankite/snap.voracity/tree/master/Common/Source/Service/Terminal/EHentai): `Common/Source/Service/Terminal/EHentai`
- [Gallery downloader](https://github.com/trankite/snap.voracity/blob/master/Common/Source/Web/EHentai/Download/EHentaiDownloader.cs): `Common/Source/Web/EHentai/Download/EHentaiDownloader.cs`
- [Gallery page parser](https://github.com/trankite/snap.voracity/blob/master/Common/Source/Web/EHentai/Download/EHentaiSlideParser.cs): `Common/Source/Web/EHentai/Download/EHentaiSlideParser.cs`
- [Gallery request and decoding](https://github.com/trankite/snap.voracity/tree/master/Common/Source/Web/EHentai/Gallery): `Common/Source/Web/EHentai/Gallery`

### Hoyolab services

- [Hoyolab commands](https://github.com/trankite/snap.voracity/tree/master/Common/Source/Service/Terminal/Hoyolab): `Common/Source/Service/Terminal/Hoyolab`
- [Login and QR auth](https://github.com/trankite/snap.voracity/tree/master/Common/Source/Web/Hoyolab/Passport): `Common/Source/Web/Hoyolab/Passport`
- [Forum operations](https://github.com/trankite/snap.voracity/tree/master/Common/Source/Web/Hoyolab/Bbs/Forum): `Common/Source/Web/Hoyolab/Bbs/Forum`
- [Mission and check-in](https://github.com/trankite/snap.voracity/tree/master/Common/Source/Web/Hoyolab/Bbs): `Common/Source/Web/Hoyolab/Bbs`
- [Game account data](https://github.com/trankite/snap.voracity/tree/master/Common/Source/Web/Hoyolab/Takumi): `Common/Source/Web/Hoyolab/Takumi`

### Shared services

- [HTTP context](https://github.com/trankite/snap.voracity/blob/master/Common/Source/Web/HttpContext.cs): `Common/Source/Web/HttpContext.cs`
- [Token persistence](https://github.com/trankite/snap.voracity/blob/master/Common/Source/Model/Collection/Token/TokenManager.cs): `Common/Source/Model/Collection/Token/TokenManager.cs`
- [QR generation](https://github.com/trankite/snap.voracity/blob/master/Common/Source/Service/Encode/QRCode/QRCode.cs): `Common/Source/Service/Encode/QRCode/QRCode.cs`
- [Formula parsing](https://github.com/trankite/snap.voracity/tree/master/Common/Source/Factory/Formula): `Common/Source/Factory/Formula`
- [File operations](https://github.com/trankite/snap.voracity/tree/master/Common/Source/Factory/Streams/FileOpen): `Common/Source/Factory/Streams/FileOpen`

### Other components

- **Console user**
- **E-Hentai service**
- **Hoyolab service**

## Connections

- Console user → Program entry: enters commands
- Program entry → Command parser: parses input
- Program entry → Terminal invocation: invokes
- Terminal invocation → Command parser: consumes commands
- Command parser → Command manager: looks up commands
- Command manager → E-Hentai commands: dispatches
- Command manager → Hoyolab commands: dispatches
- Command manager → Support commands: dispatches
- E-Hentai commands → Gallery downloader: requests downloads
- Gallery downloader → Gallery page parser: parses gallery pages
- Gallery page parser → Gallery request and decoding: builds requests
- Gallery page parser → HTTP context: sends requests
- HTTP context → E-Hentai service: requests pages
- Hoyolab commands → Login and QR auth: authenticates
- Hoyolab commands → Forum operations: runs forum tasks
- Hoyolab commands → Mission and check-in: runs tasks
- Hoyolab commands → Game account data: queries game data
- Login and QR auth → HTTP context: uses HTTP context
- Forum operations → HTTP context: uses HTTP context
- Mission and check-in → HTTP context: uses HTTP context
- Game account data → HTTP context: uses HTTP context
- HTTP context → Hoyolab service: requests API
- Token persistence → File operations: reads and writes
- E-Hentai commands → Token persistence: may persist credentials
- Hoyolab commands → Token persistence: may persist credentials
- Support commands → QR generation: supports QR output
- Support commands → Formula parsing: supports formula task
