# beatitkevin-ckf/wwise-rtpc-switch-editer architecture

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

- Interactive diagram: https://gitdiagram.com/beatitkevin-ckf/wwise-rtpc-switch-editer
- Repository: https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer

## Overview

This is a browser-local Wwise RTPC-to-Switch mapping editor. Its main workflow loads one WWU file, discovers editable contexts, supports boundary and mapping edits with validation, then previews XML changes and exports a new file; CSV import/export is an auxiliary workflow. The graph follows documented product behavior and shown App imports/calls. Most domain and infrastructure source was not excerpted, so links to those stages rely on README statements rather than inferred implementation calls.

Main entry points: [`src/pages/App.tsx`](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/pages/App.tsx) (Editor App), [`src/services/domain/services/buildExportPreview.ts`](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/buildExportPreview.ts) (Export Preview), [`src/services/infrastructure/parsing/parseWwuDocument.ts`](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/infrastructure/parsing/parseWwuDocument.ts) (WWU Parser), [`src/services/domain/models/TMappedRtpcContext.ts`](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/models/TMappedRtpcContext.ts) (Mapped Context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application UI"]
  node_app["Editor App<br/>[App.tsx]"]
  node_context_ui["Context Selector"]
  node_mapping_ui["Mapping Table<br/>[MappingTable.tsx]"]
  node_issue_ui["Issue Panel<br/>[IssuePanel.tsx]"]
end

subgraph group_wwu["WWU Processing"]
  node_wwu_file["WWU File"]
  node_parser["WWU Parser"]
  node_xml_writer["WWU XML Writer"]
end

subgraph group_mapping["Mapping Domain"]
  node_context_model["Mapped Context"]
  node_row_model["Mapping Rows<br/>[TMappingRow.ts]"]
  node_boundary_edit["Boundary Editing"]
  node_row_mutations["Row Operations"]
  node_batch_add["Batch Add"]
  node_redistribute["Point Redistribution"]
  node_validation["Context Validation"]
end

subgraph group_export["Preview and CSV"]
  node_export_gate["Export Gate<br/>[buildExportGate.ts]"]
  node_export_preview["Export Preview"]
  node_preview_ui["Diff Preview"]
  node_xml_diff["XML Diff"]
  node_csv_workflow["CSV Workflow"]
  node_csv_adapter["CSV Mapping Adapter<br/>[csvMappingTable.ts]"]
end

subgraph group_localization["Localization"]
  node_locale["Locale Selection<br/>[localeSelection.ts]"]
  node_translator["Translation<br/>[format.ts]"]
  node_resources["Locale Resources<br/>[resources.ts]"]
end

node_user(("User"))

node_user -->|"edits in"| node_app
node_app -->|"parses file"| node_parser
node_parser -->|"discovers contexts"| node_context_model
node_user -->|"selects"| node_wwu_file
node_wwu_file -->|"reads locally"| node_app
node_app -->|"renders"| node_context_ui
node_app -->|"renders"| node_issue_ui
node_app -->|"applies boundary"| node_boundary_edit
node_app -->|"redistributes points"| node_redistribute
node_app -->|"checks export"| node_export_gate
node_app -.->|"edits rows"| node_row_mutations
node_app -.->|"adds points"| node_batch_add
node_context_model -.->|"contains mapping"| node_row_model
node_app -.->|"validates edits"| node_validation
node_export_gate -->|"permits preview"| node_export_preview
node_app -->|"builds preview"| node_export_preview
node_app -->|"builds edited XML"| node_xml_writer
node_export_preview -->|"shows changes"| node_preview_ui
node_preview_ui -->|"builds diff"| node_xml_diff
node_app -->|"imports or exports CSV"| node_csv_workflow
node_csv_workflow -.->|"uses CSV protocol"| node_csv_adapter
node_app -->|"selects locale"| node_locale
node_app -->|"formats messages"| node_translator
node_translator -->|"reads strings"| node_resources

click node_app "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/pages/App.tsx"
click node_context_ui "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/components/RtpcContextList.tsx"
click node_mapping_ui "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/components/MappingTable.tsx"
click node_issue_ui "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/components/IssuePanel.tsx"
click node_parser "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/infrastructure/parsing/parseWwuDocument.ts"
click node_context_model "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/models/TMappedRtpcContext.ts"
click node_row_model "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/models/TMappingRow.ts"
click node_boundary_edit "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/editRtpcBoundary.ts"
click node_row_mutations "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/mappingRowMutations.ts"
click node_batch_add "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/batchAddMappingPoints.ts"
click node_redistribute "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/redistributeMappingPoints.ts"
click node_validation "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/validateMappedRtpcContext.ts"
click node_export_gate "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/buildExportGate.ts"
click node_export_preview "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/buildExportPreview.ts"
click node_preview_ui "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/components/ExportPreviewModal.tsx"
click node_xml_diff "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/buildXmlFileDiff.ts"
click node_xml_writer "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/infrastructure/writing/buildEditedWwuXml.ts"
click node_csv_workflow "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/application/csvMappingTableWorkflow.ts"
click node_csv_adapter "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/infrastructure/csv/csvMappingTable.ts"
click node_locale "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/i18n/localeSelection.ts"
click node_translator "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/i18n/format.ts"
click node_resources "https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/i18n/resources.ts"

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_app,node_context_ui,node_mapping_ui,node_issue_ui,node_user toneBlue
class node_wwu_file,node_parser,node_xml_writer toneAmber
class node_context_model,node_row_model,node_boundary_edit,node_row_mutations,node_batch_add,node_redistribute,node_validation toneMint
class node_export_gate,node_export_preview,node_preview_ui,node_xml_diff,node_csv_workflow,node_csv_adapter toneRose
class node_locale,node_translator,node_resources toneIndigo
```

## Components

### Application UI

- [Editor App](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/pages/App.tsx): `src/pages/App.tsx`
- [Context Selector](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/components/RtpcContextList.tsx): `src/components/RtpcContextList.tsx`
- [Mapping Table](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/components/MappingTable.tsx): `src/components/MappingTable.tsx`
- [Issue Panel](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/components/IssuePanel.tsx): `src/components/IssuePanel.tsx`

### WWU Processing

- **WWU File**
- [WWU Parser](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/infrastructure/parsing/parseWwuDocument.ts): `src/services/infrastructure/parsing/parseWwuDocument.ts`
- [WWU XML Writer](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/infrastructure/writing/buildEditedWwuXml.ts): `src/services/infrastructure/writing/buildEditedWwuXml.ts`

### Mapping Domain

- [Mapped Context](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/models/TMappedRtpcContext.ts): `src/services/domain/models/TMappedRtpcContext.ts`
- [Mapping Rows](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/models/TMappingRow.ts): `src/services/domain/models/TMappingRow.ts`
- [Boundary Editing](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/editRtpcBoundary.ts): `src/services/domain/services/editRtpcBoundary.ts`
- [Row Operations](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/mappingRowMutations.ts): `src/services/domain/services/mappingRowMutations.ts`
- [Batch Add](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/batchAddMappingPoints.ts): `src/services/domain/services/batchAddMappingPoints.ts`
- [Point Redistribution](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/redistributeMappingPoints.ts): `src/services/domain/services/redistributeMappingPoints.ts`
- [Context Validation](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/validateMappedRtpcContext.ts): `src/services/domain/services/validateMappedRtpcContext.ts`

### Preview and CSV

- [Export Gate](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/buildExportGate.ts): `src/services/domain/services/buildExportGate.ts`
- [Export Preview](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/buildExportPreview.ts): `src/services/domain/services/buildExportPreview.ts`
- [Diff Preview](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/components/ExportPreviewModal.tsx): `src/components/ExportPreviewModal.tsx`
- [XML Diff](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/domain/services/buildXmlFileDiff.ts): `src/services/domain/services/buildXmlFileDiff.ts`
- [CSV Workflow](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/application/csvMappingTableWorkflow.ts): `src/services/application/csvMappingTableWorkflow.ts`
- [CSV Mapping Adapter](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/services/infrastructure/csv/csvMappingTable.ts): `src/services/infrastructure/csv/csvMappingTable.ts`

### Localization

- [Locale Selection](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/i18n/localeSelection.ts): `src/i18n/localeSelection.ts`
- [Translation](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/i18n/format.ts): `src/i18n/format.ts`
- [Locale Resources](https://github.com/beatitkevin-ckf/wwise-rtpc-switch-editer/blob/main/src/i18n/resources.ts): `src/i18n/resources.ts`

### Other components

- **User**

## Connections

- User → Editor App: edits in (evidence: `README.md`)
- Editor App → WWU Parser: parses file (evidence: `src/pages/App.tsx`)
- WWU Parser → Mapped Context: discovers contexts (evidence: `README.md`)
- User → WWU File: selects (evidence: `README.md`)
- WWU File → Editor App: reads locally (evidence: `README.md`)
- Editor App → Context Selector: renders (evidence: `src/pages/App.tsx`)
- Editor App → Issue Panel: renders (evidence: `src/pages/App.tsx`)
- Editor App → Boundary Editing: applies boundary (evidence: `src/pages/App.tsx`)
- Editor App → Point Redistribution: redistributes points (evidence: `src/pages/App.tsx`)
- Editor App → Export Gate: checks export (evidence: `src/pages/App.tsx`)
- Editor App → Row Operations: edits rows
- Editor App → Batch Add: adds points
- Mapped Context → Mapping Rows: contains mapping
- Editor App → Context Validation: validates edits
- Export Gate → Export Preview: permits preview (evidence: `README.md`)
- Editor App → Export Preview: builds preview (evidence: `README.md`)
- Editor App → WWU XML Writer: builds edited XML (evidence: `README.md`)
- Export Preview → Diff Preview: shows changes (evidence: `README.md`)
- Diff Preview → XML Diff: builds diff (evidence: `src/components/ExportPreviewModal.tsx`)
- Editor App → CSV Workflow: imports or exports CSV (evidence: `README.md`)
- CSV Workflow → CSV Mapping Adapter: uses CSV protocol
- Editor App → Locale Selection: selects locale (evidence: `src/pages/App.tsx`)
- Editor App → Translation: formats messages (evidence: `src/pages/App.tsx`)
- Translation → Locale Resources: reads strings (evidence: `src/i18n/format.ts`)
