# dcnick3/shin architecture

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

- Interactive diagram: https://gitdiagram.com/dcnick3/shin
- Repository: https://github.com/dcnick3/shin

## Overview

Shin is an unofficial visual-novel engine reimplementation. Its main workflow is launching the app, locating game assets, loading ADV content, updating the script, and rendering the resulting scene with audio and video support. The repository also provides shin-core format/VM functionality and the sdu extraction CLI. Several connections below are documented capabilities rather than inspected call sites; those are marked dashed with no evidence path.

Main entry points: [`shin/src/adv/mod.rs`](https://github.com/dcnick3/shin/blob/master/shin/src/adv/mod.rs) (ADV script), [`shin/src/app.rs`](https://github.com/dcnick3/shin/blob/master/shin/src/app.rs) (App lifecycle), [`shin/src/layer`](https://github.com/dcnick3/shin/tree/master/shin/src/layer) (Scene layers), [`shin/src/asset/system/server`](https://github.com/dcnick3/shin/tree/master/shin/src/asset/system/server) (Asset server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_entry["Engine entry<br/>[main.rs]"]
  node_window["Window host<br/>[lib.rs]"]
  node_app["App lifecycle<br/>[app.rs]"]
  node_adv["ADV script<br/>[mod.rs]"]
  node_layers["Scene layers"]
end

subgraph group_content["Content and formats"]
  node_assetserver["Asset server"]
  node_assetloaders["Asset loaders"]
  node_coreformats["Game formats"]
  node_vm["Script VM"]
  node_layout["Text layout"]
end

subgraph group_media["Rendering and media"]
  node_renderer["Renderer<br/>[lib.rs]"]
  node_audio["Audio playback<br/>[manager.rs]"]
  node_video["Video playback<br/>[video_player.rs]"]
end

subgraph group_tooling["Data tools"]
  node_sdu["Extraction CLI<br/>[main.rs]"]
  node_sduformats["Format commands"]
end

node_player(("Player"))
node_gamefiles["Game files"]

node_player -->|"launches"| node_entry
node_entry -->|"starts window"| node_window
node_window -->|"hosts app"| node_app
node_app -->|"creates"| node_assetserver
node_gamefiles -->|"provides assets"| node_assetserver
node_assetserver -.->|"loads content"| node_assetloaders
node_app -->|"loads and updates"| node_adv
node_adv -.->|"executes script"| node_vm
node_adv -.->|"updates scene"| node_layers
node_assetloaders -.->|"decodes formats"| node_coreformats
node_layers -.->|"draws scene"| node_renderer
node_adv -.->|"presents text"| node_layout
node_adv -.->|"plays audio"| node_audio
node_layers -.->|"shows movies"| node_video
node_player -->|"runs extraction"| node_sdu
node_sdu -->|"dispatches commands"| node_sduformats
node_sduformats -->|"extracts data"| node_coreformats

click node_entry "https://github.com/dcnick3/shin/blob/master/shin/src/main.rs"
click node_window "https://github.com/dcnick3/shin/blob/master/shin-window/src/lib.rs"
click node_app "https://github.com/dcnick3/shin/blob/master/shin/src/app.rs"
click node_adv "https://github.com/dcnick3/shin/blob/master/shin/src/adv/mod.rs"
click node_layers "https://github.com/dcnick3/shin/tree/master/shin/src/layer"
click node_assetserver "https://github.com/dcnick3/shin/tree/master/shin/src/asset/system/server"
click node_assetloaders "https://github.com/dcnick3/shin/tree/master/shin/src/asset"
click node_coreformats "https://github.com/dcnick3/shin/tree/master/shin-core/src/format"
click node_vm "https://github.com/dcnick3/shin/tree/master/shin-core/src/vm"
click node_layout "https://github.com/dcnick3/shin/tree/master/shin-core/src/layout"
click node_renderer "https://github.com/dcnick3/shin/blob/master/shin-render/src/lib.rs"
click node_audio "https://github.com/dcnick3/shin/blob/master/shin-audio/src/manager.rs"
click node_video "https://github.com/dcnick3/shin/blob/master/shin-video/src/video_player.rs"
click node_sdu "https://github.com/dcnick3/shin/blob/master/sdu/src/main.rs"
click node_sduformats "https://github.com/dcnick3/shin/tree/master/sdu/src"

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_entry,node_window,node_app,node_adv,node_layers toneBlue
class node_assetserver,node_assetloaders,node_coreformats,node_vm,node_layout toneAmber
class node_renderer,node_audio,node_video toneMint
class node_sdu,node_sduformats toneRose
class node_player,node_gamefiles toneIndigo
```

## Components

### Game runtime

- [Engine entry](https://github.com/dcnick3/shin/blob/master/shin/src/main.rs): `shin/src/main.rs`
- [Window host](https://github.com/dcnick3/shin/blob/master/shin-window/src/lib.rs): `shin-window/src/lib.rs`
- [App lifecycle](https://github.com/dcnick3/shin/blob/master/shin/src/app.rs): `shin/src/app.rs`
- [ADV script](https://github.com/dcnick3/shin/blob/master/shin/src/adv/mod.rs): `shin/src/adv/mod.rs`
- [Scene layers](https://github.com/dcnick3/shin/tree/master/shin/src/layer): `shin/src/layer`

### Content and formats

- [Asset server](https://github.com/dcnick3/shin/tree/master/shin/src/asset/system/server): `shin/src/asset/system/server`
- [Asset loaders](https://github.com/dcnick3/shin/tree/master/shin/src/asset): `shin/src/asset`
- [Game formats](https://github.com/dcnick3/shin/tree/master/shin-core/src/format): `shin-core/src/format`
- [Script VM](https://github.com/dcnick3/shin/tree/master/shin-core/src/vm): `shin-core/src/vm`
- [Text layout](https://github.com/dcnick3/shin/tree/master/shin-core/src/layout): `shin-core/src/layout`

### Rendering and media

- [Renderer](https://github.com/dcnick3/shin/blob/master/shin-render/src/lib.rs): `shin-render/src/lib.rs`
- [Audio playback](https://github.com/dcnick3/shin/blob/master/shin-audio/src/manager.rs): `shin-audio/src/manager.rs`
- [Video playback](https://github.com/dcnick3/shin/blob/master/shin-video/src/video_player.rs): `shin-video/src/video_player.rs`

### Data tools

- [Extraction CLI](https://github.com/dcnick3/shin/blob/master/sdu/src/main.rs): `sdu/src/main.rs`
- [Format commands](https://github.com/dcnick3/shin/tree/master/sdu/src): `sdu/src`

### Other components

- **Player**
- **Game files**

## Connections

- Player → Engine entry: launches
- Engine entry → Window host: starts window (evidence: `shin/src/main.rs`)
- Window host → App lifecycle: hosts app
- App lifecycle → Asset server: creates (evidence: `shin/src/app.rs`)
- Game files → Asset server: provides assets
- Asset server → Asset loaders: loads content
- App lifecycle → ADV script: loads and updates (evidence: `shin/src/app.rs`)
- ADV script → Script VM: executes script
- ADV script → Scene layers: updates scene
- Asset loaders → Game formats: decodes formats
- Scene layers → Renderer: draws scene
- ADV script → Text layout: presents text
- ADV script → Audio playback: plays audio
- Scene layers → Video playback: shows movies
- Player → Extraction CLI: runs extraction
- Extraction CLI → Format commands: dispatches commands (evidence: `sdu/src/main.rs`)
- Format commands → Game formats: extracts data
