# phuongviencac/nomime architecture

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

- Interactive diagram: https://gitdiagram.com/phuongviencac/nomime
- Repository: https://github.com/phuongviencac/nomime

## Overview

NomIME is a Windows Hán-Nôm input method based on Rime. Its principal workflow receives keystrokes through the TSF text service, sends commands over IPC to the server, runs Rime sessions, then returns composition and candidate data for text insertion and panel rendering. The repository also includes installation, user settings, dictionary management, and service/tray operation. Arrows are limited to relationships visible in excerpts or explicitly described in the README; unsampled subsystems are retained where their capabilities are documented or clear from the tree.

Main entry points: [`RimeWithNomIME/RimeWithNomIME.cpp`](https://github.com/phuongviencac/nomime/blob/main/RimeWithNomIME/RimeWithNomIME.cpp) (Rime handler), [`NomIMETSF/Composition.cpp`](https://github.com/phuongviencac/nomime/blob/main/NomIMETSF/Composition.cpp) (TSF text service), [`NomIMEIPC/NomIMEClientImpl.cpp`](https://github.com/phuongviencac/nomime/blob/main/NomIMEIPC/NomIMEClientImpl.cpp) (IPC client), [`NomIMEDeployer/SettingsDialog.cpp`](https://github.com/phuongviencac/nomime/blob/main/NomIMEDeployer/SettingsDialog.cpp) (Settings and dictionaries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Text input"]
  node_tsf["TSF text service<br/>[Composition.cpp]"]
  node_edit["Text edit sessions<br/>[EditSession.cpp]"]
end

subgraph group_engine["Rime and IPC"]
  node_ipcclient["IPC client"]
  node_pipe["Named-pipe channel<br/>[PipeChannel.cpp]"]
  node_ipcserver["IPC server"]
  node_rime["Rime handler<br/>[RimeWithNomIME.cpp]"]
  node_deserialize["Response deserializer<br/>[Deserializer.h]"]
  node_parser["Response parser<br/>[ResponseParser.cpp]"]
  node_rimeengine["Rime engine"]
end

subgraph group_presentation["Composition UI"]
  node_ui["Candidate panel<br/>[NomIMEPanel.cpp]"]
  node_layout["Panel layouts"]
  node_style["Display styling"]
end

subgraph group_operations["User operations"]
  node_server["Server application"]
  node_service["Windows service<br/>[NomIMEService.cpp]"]
  node_tray["Tray controls<br/>[NomIMETrayIcon.cpp]"]
  node_deployer["Settings and dictionaries<br/>[SettingsDialog.cpp]"]
  node_dictdialog["Dictionary management"]
  node_setup["Installer options"]
  node_setupflow["Install and registration<br/>[imesetup.cpp]"]
  node_userfiles["User configuration"]
end

node_user(("Input user"))

node_user -.->|"types into"| node_tsf
node_tsf -.->|"sends key events"| node_ipcclient
node_ipcclient -->|"transacts commands"| node_pipe
node_ipcserver -.->|"serves commands"| node_pipe
node_ipcserver -.->|"dispatches requests"| node_rime
node_rime -->|"runs sessions"| node_rimeengine
node_rime -->|"uses configuration"| node_userfiles
node_rime -.->|"responds to clients"| node_ipcserver
node_ipcclient -.->|"parses response"| node_parser
node_parser -->|"delegates decoding"| node_deserialize
node_edit -->|"requests response data"| node_ipcclient
node_edit -.->|"applies text edits"| node_tsf
node_rime -.->|"updates composition"| node_ui
node_ui -->|"uses layout"| node_layout
node_tsf -.->|"provides display attributes"| node_style
node_service -->|"runs application"| node_server
node_server -.->|"exposes tray controls"| node_tray
node_user -.->|"configures input"| node_deployer
node_deployer -->|"manages dictionaries"| node_dictdialog
node_deployer -.->|"updates settings"| node_userfiles
node_user -->|"chooses install options"| node_setup
node_setup -->|"configures installation"| node_setupflow
node_setupflow -->|"registers text service"| node_tsf

click node_tsf "https://github.com/phuongviencac/nomime/blob/main/NomIMETSF/Composition.cpp"
click node_edit "https://github.com/phuongviencac/nomime/blob/main/NomIMETSF/EditSession.cpp"
click node_ipcclient "https://github.com/phuongviencac/nomime/blob/main/NomIMEIPC/NomIMEClientImpl.cpp"
click node_pipe "https://github.com/phuongviencac/nomime/blob/main/NomIMEIPC/PipeChannel.cpp"
click node_ipcserver "https://github.com/phuongviencac/nomime/blob/main/NomIMEIPCServer/NomIMEServerImpl.cpp"
click node_rime "https://github.com/phuongviencac/nomime/blob/main/RimeWithNomIME/RimeWithNomIME.cpp"
click node_deserialize "https://github.com/phuongviencac/nomime/blob/main/NomIMEIPC/Deserializer.h"
click node_parser "https://github.com/phuongviencac/nomime/blob/main/NomIMEIPC/ResponseParser.cpp"
click node_ui "https://github.com/phuongviencac/nomime/blob/main/NomIMEUI/NomIMEPanel.cpp"
click node_layout "https://github.com/phuongviencac/nomime/blob/main/NomIMEUI/VHorizontalLayout.cpp"
click node_style "https://github.com/phuongviencac/nomime/blob/main/NomIMETSF/DisplayAttribute.cpp"
click node_server "https://github.com/phuongviencac/nomime/blob/main/NomIMEServer/NomIMEServerApp.cpp"
click node_service "https://github.com/phuongviencac/nomime/blob/main/NomIMEServer/NomIMEService.cpp"
click node_tray "https://github.com/phuongviencac/nomime/blob/main/NomIMEServer/NomIMETrayIcon.cpp"
click node_deployer "https://github.com/phuongviencac/nomime/blob/main/NomIMEDeployer/SettingsDialog.cpp"
click node_dictdialog "https://github.com/phuongviencac/nomime/blob/main/NomIMEDeployer/DictManagementDialog.cpp"
click node_setup "https://github.com/phuongviencac/nomime/blob/main/NomIMESetup/InstallOptionsDlg.cpp"
click node_setupflow "https://github.com/phuongviencac/nomime/blob/main/NomIMESetup/imesetup.cpp"

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_tsf,node_edit,node_user toneBlue
class node_ipcclient,node_pipe,node_ipcserver,node_rime,node_deserialize,node_parser,node_rimeengine toneAmber
class node_ui,node_layout,node_style toneMint
class node_server,node_service,node_tray,node_deployer,node_dictdialog,node_setup,node_setupflow,node_userfiles toneRose
```

## Components

### Text input

- [TSF text service](https://github.com/phuongviencac/nomime/blob/main/NomIMETSF/Composition.cpp): `NomIMETSF/Composition.cpp`
- [Text edit sessions](https://github.com/phuongviencac/nomime/blob/main/NomIMETSF/EditSession.cpp): `NomIMETSF/EditSession.cpp`

### Rime and IPC

- [IPC client](https://github.com/phuongviencac/nomime/blob/main/NomIMEIPC/NomIMEClientImpl.cpp): `NomIMEIPC/NomIMEClientImpl.cpp`
- [Named-pipe channel](https://github.com/phuongviencac/nomime/blob/main/NomIMEIPC/PipeChannel.cpp): `NomIMEIPC/PipeChannel.cpp`
- [IPC server](https://github.com/phuongviencac/nomime/blob/main/NomIMEIPCServer/NomIMEServerImpl.cpp): `NomIMEIPCServer/NomIMEServerImpl.cpp`
- [Rime handler](https://github.com/phuongviencac/nomime/blob/main/RimeWithNomIME/RimeWithNomIME.cpp): `RimeWithNomIME/RimeWithNomIME.cpp`
- [Response deserializer](https://github.com/phuongviencac/nomime/blob/main/NomIMEIPC/Deserializer.h): `NomIMEIPC/Deserializer.h`
- [Response parser](https://github.com/phuongviencac/nomime/blob/main/NomIMEIPC/ResponseParser.cpp): `NomIMEIPC/ResponseParser.cpp`
- **Rime engine**

### Composition UI

- [Candidate panel](https://github.com/phuongviencac/nomime/blob/main/NomIMEUI/NomIMEPanel.cpp): `NomIMEUI/NomIMEPanel.cpp`
- [Panel layouts](https://github.com/phuongviencac/nomime/blob/main/NomIMEUI/VHorizontalLayout.cpp): `NomIMEUI/VHorizontalLayout.cpp`
- [Display styling](https://github.com/phuongviencac/nomime/blob/main/NomIMETSF/DisplayAttribute.cpp): `NomIMETSF/DisplayAttribute.cpp`

### User operations

- [Server application](https://github.com/phuongviencac/nomime/blob/main/NomIMEServer/NomIMEServerApp.cpp): `NomIMEServer/NomIMEServerApp.cpp`
- [Windows service](https://github.com/phuongviencac/nomime/blob/main/NomIMEServer/NomIMEService.cpp): `NomIMEServer/NomIMEService.cpp`
- [Tray controls](https://github.com/phuongviencac/nomime/blob/main/NomIMEServer/NomIMETrayIcon.cpp): `NomIMEServer/NomIMETrayIcon.cpp`
- [Settings and dictionaries](https://github.com/phuongviencac/nomime/blob/main/NomIMEDeployer/SettingsDialog.cpp): `NomIMEDeployer/SettingsDialog.cpp`
- [Dictionary management](https://github.com/phuongviencac/nomime/blob/main/NomIMEDeployer/DictManagementDialog.cpp): `NomIMEDeployer/DictManagementDialog.cpp`
- [Installer options](https://github.com/phuongviencac/nomime/blob/main/NomIMESetup/InstallOptionsDlg.cpp): `NomIMESetup/InstallOptionsDlg.cpp`
- [Install and registration](https://github.com/phuongviencac/nomime/blob/main/NomIMESetup/imesetup.cpp): `NomIMESetup/imesetup.cpp`
- **User configuration**

### Other components

- **Input user**

## Connections

- Input user → TSF text service: types into
- TSF text service → IPC client: sends key events
- IPC client → Named-pipe channel: transacts commands (evidence: `NomIMEIPC/NomIMEClientImpl.cpp`)
- IPC server → Named-pipe channel: serves commands
- IPC server → Rime handler: dispatches requests
- Rime handler → Rime engine: runs sessions (evidence: `RimeWithNomIME/RimeWithNomIME.cpp`)
- Rime handler → User configuration: uses configuration (evidence: `RimeWithNomIME/RimeWithNomIME.cpp`)
- Rime handler → IPC server: responds to clients
- IPC client → Response parser: parses response
- Response parser → Response deserializer: delegates decoding
- Text edit sessions → IPC client: requests response data (evidence: `NomIMETSF/EditSession.cpp`)
- Text edit sessions → TSF text service: applies text edits
- Rime handler → Candidate panel: updates composition
- Candidate panel → Panel layouts: uses layout (evidence: `NomIMEUI/NomIMEPanel.cpp`)
- TSF text service → Display styling: provides display attributes
- Windows service → Server application: runs application (evidence: `NomIMEServer/NomIMEService.cpp`)
- Server application → Tray controls: exposes tray controls
- Input user → Settings and dictionaries: configures input
- Settings and dictionaries → Dictionary management: manages dictionaries (evidence: `NomIMEDeployer/DictManagementDialog.cpp`)
- Settings and dictionaries → User configuration: updates settings
- Input user → Installer options: chooses install options
- Installer options → Install and registration: configures installation (evidence: `NomIMESetup/imesetup.cpp`)
- Install and registration → TSF text service: registers text service (evidence: `NomIMESetup/imesetup.cpp`)
