# tanviet12/sano-sach-noi architecture

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

- Interactive diagram: https://gitdiagram.com/tanviet12/sano-sach-noi
- Repository: https://github.com/tanviet12/sano-sach-noi

## Overview

Sano is a desktop app for turning local Word, EPUB, and text-based PDF documents into Vietnamese AI audiobooks. The main workflow is to import and inspect a document, choose reading style and voice, preview or edit speech, render a book, then listen in the library or export it for a phone. Other documented capabilities include library organization, listening statistics, pronunciation dictionaries, sharing, video creation, and MCP integration. The frontend bridge and several Go subsystems are only partly sampled; dashed links mark relationships not directly verified in excerpts.

Main entry points: [`desktop/frontend/src/App.vue`](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/App.vue) (App interface), [`desktop/frontend/src/lib/backend.ts`](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/lib/backend.ts) (Wails bridge), [`desktop/frontend/src/lib/store.ts`](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/lib/store.ts) (Create workflow), [`desktop/frontend/src/views/create/StepPreview.vue`](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/views/create/StepPreview.vue) (Speech preview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_frontend["App interface<br/>[App.vue]"]
  node_bridge["Wails bridge<br/>[backend.ts]"]
  node_appgo["Desktop services<br/>[app.go]"]
end

subgraph group_creation["Book creation"]
  node_createflow["Create workflow<br/>[store.ts]"]
  node_inspect["Document inspection<br/>[inspect.go]"]
  node_bookmaker["Book processing<br/>[pipeline.go]"]
  node_tts["Speech synthesis"]
  node_preview["Speech preview<br/>[StepPreview.vue]"]
  node_dict["Pronunciation dictionary<br/>[dict.go]"]
end

subgraph group_library["Library and listening"]
  node_libraryui["Book library<br/>[LibraryView.vue]"]
  node_librarydata[("Library management<br/>[library.go]")]
  node_edit["Book editing<br/>[edit.ts]"]
  node_player["Audiobook player<br/>[player.ts]"]
  node_stats[("Listening history<br/>[listening.go]")]
end

subgraph group_exports["Sharing and exports"]
  node_share["Book sharing<br/>[share.go]"]
  node_m4b["M4B export<br/>[m4b.go]"]
  node_video["Book video<br/>[bookvideo.go]"]
end

subgraph group_integrations["Setup and integrations"]
  node_setup["Reader setup<br/>[steps.go]"]
  node_mcp["MCP integration<br/>[mcp.go]"]
  node_skill["Authoring skill<br/>[main.go]"]
end

node_user(("Reader"))

node_user -->|"uses"| node_frontend
node_frontend -->|"starts"| node_createflow
node_createflow -->|"requests operations"| node_bridge
node_bridge -.->|"calls desktop API"| node_appgo
node_createflow -.->|"inspects document"| node_inspect
node_inspect -.->|"prepares content"| node_bookmaker
node_bookmaker -.->|"generates speech"| node_tts
node_createflow -->|"opens preview"| node_preview
node_preview -->|"requests sample speech"| node_bridge
node_preview -.->|"teaches pronunciation"| node_dict
node_frontend -->|"routes to library"| node_libraryui
node_libraryui -.->|"loads books"| node_librarydata
node_frontend -->|"opens player"| node_player
node_player -->|"loads book audio"| node_bridge
node_player -.->|"records listening"| node_stats
node_frontend -->|"opens editor"| node_edit
node_edit -->|"requests rereads"| node_bridge
node_user -->|"shares book"| node_share
node_user -->|"exports for phone"| node_m4b
node_user -.->|"creates book video"| node_video
node_user -.->|"sets up reader"| node_setup
node_user -.->|"connects AI tools"| node_mcp
node_user -->|"uses authoring skill"| node_skill

click node_frontend "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/App.vue"
click node_bridge "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/lib/backend.ts"
click node_appgo "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/app.go"
click node_createflow "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/lib/store.ts"
click node_inspect "https://github.com/tanviet12/sano-sach-noi/blob/main/internal/bookmaker/inspect.go"
click node_bookmaker "https://github.com/tanviet12/sano-sach-noi/blob/main/internal/bookmaker/pipeline.go"
click node_tts "https://github.com/tanviet12/sano-sach-noi/tree/main/desktop/internal/tts"
click node_preview "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/views/create/StepPreview.vue"
click node_dict "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/internal/library/dict.go"
click node_libraryui "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/views/LibraryView.vue"
click node_librarydata "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/internal/library/library.go"
click node_edit "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/lib/edit.ts"
click node_player "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/lib/player.ts"
click node_stats "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/internal/library/listening.go"
click node_share "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/share.go"
click node_m4b "https://github.com/tanviet12/sano-sach-noi/blob/main/internal/m4b/m4b.go"
click node_video "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/bookvideo.go"
click node_setup "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/internal/setup/steps.go"
click node_mcp "https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/mcp.go"
click node_skill "https://github.com/tanviet12/sano-sach-noi/blob/main/cmd/sano-skill/main.go"

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_frontend,node_bridge,node_appgo toneBlue
class node_createflow,node_inspect,node_bookmaker,node_tts,node_preview,node_dict toneAmber
class node_libraryui,node_librarydata,node_edit,node_player,node_stats toneMint
class node_share,node_m4b,node_video toneRose
class node_setup,node_mcp,node_skill,node_user toneIndigo
```

## Components

### Desktop app

- [App interface](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/App.vue): `desktop/frontend/src/App.vue`
- [Wails bridge](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/lib/backend.ts): `desktop/frontend/src/lib/backend.ts`
- [Desktop services](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/app.go): `desktop/app.go`

### Book creation

- [Create workflow](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/lib/store.ts): `desktop/frontend/src/lib/store.ts`
- [Document inspection](https://github.com/tanviet12/sano-sach-noi/blob/main/internal/bookmaker/inspect.go): `internal/bookmaker/inspect.go`
- [Book processing](https://github.com/tanviet12/sano-sach-noi/blob/main/internal/bookmaker/pipeline.go): `internal/bookmaker/pipeline.go`
- [Speech synthesis](https://github.com/tanviet12/sano-sach-noi/tree/main/desktop/internal/tts): `desktop/internal/tts`
- [Speech preview](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/views/create/StepPreview.vue): `desktop/frontend/src/views/create/StepPreview.vue`
- [Pronunciation dictionary](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/internal/library/dict.go): `desktop/internal/library/dict.go`

### Library and listening

- [Book library](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/views/LibraryView.vue): `desktop/frontend/src/views/LibraryView.vue`
- [Library management](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/internal/library/library.go): `desktop/internal/library/library.go`
- [Book editing](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/lib/edit.ts): `desktop/frontend/src/lib/edit.ts`
- [Audiobook player](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/frontend/src/lib/player.ts): `desktop/frontend/src/lib/player.ts`
- [Listening history](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/internal/library/listening.go): `desktop/internal/library/listening.go`

### Sharing and exports

- [Book sharing](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/share.go): `desktop/share.go`
- [M4B export](https://github.com/tanviet12/sano-sach-noi/blob/main/internal/m4b/m4b.go): `internal/m4b/m4b.go`
- [Book video](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/bookvideo.go): `desktop/bookvideo.go`

### Setup and integrations

- [Reader setup](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/internal/setup/steps.go): `desktop/internal/setup/steps.go`
- [MCP integration](https://github.com/tanviet12/sano-sach-noi/blob/main/desktop/mcp.go): `desktop/mcp.go`
- [Authoring skill](https://github.com/tanviet12/sano-sach-noi/blob/main/cmd/sano-skill/main.go): `cmd/sano-skill/main.go`

### Other components

- **Reader**

## Connections

- Reader → App interface: uses
- App interface → Create workflow: starts (evidence: `desktop/frontend/src/App.vue`)
- Create workflow → Wails bridge: requests operations (evidence: `desktop/frontend/src/lib/store.ts`)
- Wails bridge → Desktop services: calls desktop API
- Create workflow → Document inspection: inspects document
- Document inspection → Book processing: prepares content
- Book processing → Speech synthesis: generates speech
- Create workflow → Speech preview: opens preview (evidence: `desktop/frontend/src/views/create/StepPreview.vue`)
- Speech preview → Wails bridge: requests sample speech (evidence: `desktop/frontend/src/views/create/StepPreview.vue`)
- Speech preview → Pronunciation dictionary: teaches pronunciation
- App interface → Book library: routes to library (evidence: `desktop/frontend/src/App.vue`)
- Book library → Library management: loads books
- App interface → Audiobook player: opens player (evidence: `desktop/frontend/src/App.vue`)
- Audiobook player → Wails bridge: loads book audio (evidence: `desktop/frontend/src/lib/player.ts`)
- Audiobook player → Listening history: records listening
- App interface → Book editing: opens editor (evidence: `desktop/frontend/src/App.vue`)
- Book editing → Wails bridge: requests rereads (evidence: `desktop/frontend/src/lib/edit.ts`)
- Reader → Book sharing: shares book
- Reader → M4B export: exports for phone
- Reader → Book video: creates book video
- Reader → Reader setup: sets up reader
- Reader → MCP integration: connects AI tools
- Reader → Authoring skill: uses authoring skill
