# hezhixin15/dlss5-swapper-chinese architecture

> Architecture diagram of the GitHub repository hezhixin15/dlss5-swapper-chinese, 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/hezhixin15/dlss5-swapper-chinese
- Repository: https://github.com/hezhixin15/dlss5-swapper-chinese

## Overview

DLSS 5 Swapper is an Electron desktop app for finding games and installing or managing DLSS 5 rendering components; this edition adds Chinese localization, a tutorial, update checks, and cache cleaning. The main workflow is game discovery → scan and route selection → install with tracked backups, or restore originals. The graph includes documented community and in-game overlay capabilities. Some wiring is based on the app’s documented responsibilities because the supplied source excerpts are partial.

Main entry points: [`main.js`](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/main.js) (App and IPC), [`src/renderer/renderer.js`](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/renderer/renderer.js) (Main interface), [`src/core/backend-manager.js`](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/core/backend-manager.js) (Backend manager), [`src/core/apply.js`](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/core/apply.js) (Install and restore)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_main["App and IPC<br/>[main.js]"]
  node_preload["Renderer bridge<br/>[preload.js]"]
  node_renderer["Main interface<br/>[renderer.js]"]
  node_localization["Translations<br/>[feature-i18n.js]"]
  node_tutorial["Tutorial<br/>[tutorial.js]"]
end

subgraph group_games["Game discovery"]
  node_library["Game library<br/>[library.js]"]
  node_scan["Game scanner<br/>[scan.js]"]
  node_compatibility["Compatibility checks<br/>[compatibility.js]"]
  node_routes["Install route policy<br/>[install-routes.js]"]
end

subgraph group_install["Install and restore"]
  node_backend["Backend manager<br/>[backend-manager.js]"]
  node_apply["Install and restore<br/>[apply.js]"]
  node_journal["File journal<br/>[file-journal.js]"]
  node_optiscaler["OptiScaler route<br/>[optiscaler.js]"]
end

subgraph group_overlay["In-game overlay"]
  node_overlayui["Overlay interface<br/>[overlay-surface.js]"]
  node_overlaybridge["Overlay bridge<br/>[overlay-bridge.js]"]
  node_overlaynative["Native game overlay<br/>[overlay.cpp]"]
end

subgraph group_community["Community features"]
  node_communityui["Community interface<br/>[community.js]"]
  node_communityclient["Community client"]
end

node_user(("Player"))
node_gamefiles[("Game files")]
node_communityservice["Community service"]

node_user -->|"uses"| node_renderer
node_renderer -->|"requests actions"| node_preload
node_preload -->|"invokes IPC"| node_main
node_main -->|"finds games"| node_library
node_library -->|"reads launcher data"| node_gamefiles
node_main -->|"scans games"| node_scan
node_scan -->|"inspects files"| node_gamefiles
node_main -->|"checks compatibility"| node_compatibility
node_main -->|"chooses route"| node_routes
node_main -->|"installs or restores"| node_backend
node_backend -->|"applies swap"| node_apply
node_backend -->|"installs route"| node_optiscaler
node_apply -->|"tracks file changes"| node_journal
node_apply -->|"writes game files"| node_gamefiles
node_journal -->|"backs up and restores"| node_gamefiles
node_renderer -->|"loads strings"| node_localization
node_renderer -->|"opens tutorial"| node_tutorial
node_renderer -->|"configures overlay"| node_overlayui
node_overlayui -->|"sends preferences"| node_overlaybridge
node_overlaybridge -->|"exchanges commands"| node_overlaynative
node_overlaynative -->|"runs in game"| node_gamefiles
node_renderer -->|"opens community"| node_communityui
node_communityui -->|"requests community data"| node_preload
node_main -->|"handles community requests"| node_communityclient
node_communityclient -.->|"requests data"| node_communityservice
node_main -->|"cleans cache"| node_gamefiles

click node_main "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/main.js"
click node_preload "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/preload.js"
click node_renderer "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/renderer/renderer.js"
click node_localization "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/shared/feature-i18n.js"
click node_tutorial "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/renderer/tutorial.js"
click node_library "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/library.js"
click node_scan "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/core/scan.js"
click node_compatibility "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/core/compatibility.js"
click node_routes "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/shared/install-routes.js"
click node_backend "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/core/backend-manager.js"
click node_apply "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/core/apply.js"
click node_journal "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/core/file-journal.js"
click node_optiscaler "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/core/optiscaler.js"
click node_overlayui "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/renderer/overlay-surface.js"
click node_overlaybridge "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/overlay-bridge.js"
click node_overlaynative "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/overlay/overlay.cpp"
click node_communityui "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/renderer/community.js"
click node_communityclient "https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/community-client.js"

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_main,node_preload,node_renderer,node_localization,node_tutorial toneBlue
class node_library,node_scan,node_compatibility,node_routes,node_gamefiles toneAmber
class node_backend,node_apply,node_journal,node_optiscaler toneMint
class node_overlayui,node_overlaybridge,node_overlaynative toneRose
class node_communityui,node_communityclient,node_user,node_communityservice toneIndigo
```

## Components

### Desktop app

- [App and IPC](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/main.js): `main.js`
- [Renderer bridge](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/preload.js): `preload.js`
- [Main interface](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/renderer/renderer.js): `src/renderer/renderer.js`
- [Translations](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/shared/feature-i18n.js): `src/shared/feature-i18n.js`
- [Tutorial](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/renderer/tutorial.js): `src/renderer/tutorial.js`

### Game discovery

- [Game library](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/library.js): `src/library.js`
- [Game scanner](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/core/scan.js): `src/core/scan.js`
- [Compatibility checks](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/core/compatibility.js): `src/core/compatibility.js`
- [Install route policy](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/shared/install-routes.js): `src/shared/install-routes.js`

### Install and restore

- [Backend manager](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/core/backend-manager.js): `src/core/backend-manager.js`
- [Install and restore](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/core/apply.js): `src/core/apply.js`
- [File journal](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/core/file-journal.js): `src/core/file-journal.js`
- [OptiScaler route](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/core/optiscaler.js): `src/core/optiscaler.js`

### In-game overlay

- [Overlay interface](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/renderer/overlay-surface.js): `src/renderer/overlay-surface.js`
- [Overlay bridge](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/overlay-bridge.js): `src/overlay-bridge.js`
- [Native game overlay](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/overlay/overlay.cpp): `overlay/overlay.cpp`

### Community features

- [Community interface](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/renderer/community.js): `src/renderer/community.js`
- [Community client](https://github.com/hezhixin15/dlss5-swapper-chinese/blob/main/src/community-client.js): `src/community-client.js`

### Other components

- **Player**
- **Game files**
- **Community service**

## Connections

- Player → Main interface: uses
- Main interface → Renderer bridge: requests actions
- Renderer bridge → App and IPC: invokes IPC
- App and IPC → Game library: finds games
- Game library → Game files: reads launcher data
- App and IPC → Game scanner: scans games
- Game scanner → Game files: inspects files
- App and IPC → Compatibility checks: checks compatibility
- App and IPC → Install route policy: chooses route
- App and IPC → Backend manager: installs or restores
- Backend manager → Install and restore: applies swap
- Backend manager → OptiScaler route: installs route
- Install and restore → File journal: tracks file changes
- Install and restore → Game files: writes game files
- File journal → Game files: backs up and restores
- Main interface → Translations: loads strings
- Main interface → Tutorial: opens tutorial
- Main interface → Overlay interface: configures overlay
- Overlay interface → Overlay bridge: sends preferences
- Overlay bridge → Native game overlay: exchanges commands
- Native game overlay → Game files: runs in game
- Main interface → Community interface: opens community
- Community interface → Renderer bridge: requests community data
- App and IPC → Community client: handles community requests
- Community client → Community service: requests data
- App and IPC → Game files: cleans cache
