# mourtisma/electron-audio-tagger architecture

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

- Interactive diagram: https://gitdiagram.com/mourtisma/electron-audio-tagger
- Repository: https://github.com/mourtisma/electron-audio-tagger

## Overview

Electron Audio Tagger is a desktop app for browsing a chosen directory of audio files and editing their tags. The workflow runs from the directory picker through the file grid and edit dialog to tag persistence, with the updated file reflected in the grid. The graph also includes the app renderer, controller, repository, and adapter layers. Paths and edges are grounded in the README and source index; the Electron entry and some runtime wiring were not sampled, so their connections are omitted.

Main entry points: [`src/view/main-container.tsx`](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/view/main-container.tsx) (Directory and edit flow), [`src/model/adapters/node-id3-adapter.ts`](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/model/adapters/node-id3-adapter.ts) (NodeID3 file adapter), [`src/controller/audio-file-controller.ts`](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/controller/audio-file-controller.ts) (Audio file controller), [`src/view/edit-dialog.tsx`](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/view/edit-dialog.tsx) (Edit dialog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_renderer["Renderer bootstrap<br/>[renderer.ts]"]
  node_app["React app mount<br/>[app.tsx]"]
  node_main["Directory and edit flow<br/>[main-container.tsx]"]
  node_grid["Audio file grid"]
  node_dialog["Edit dialog<br/>[edit-dialog.tsx]"]
  node_form["Tag edit form"]
  node_context["Edit context<br/>[context.ts]"]
  node_electron["Electron dialog helper<br/>[electron.ts]"]
end

subgraph group_domain["Tag editing"]
  node_controller["Audio file controller"]
  node_model["Audio file model<br/>[audio-file.ts]"]
  node_trackhelper["Track number helpers<br/>[node-id3.ts]"]
end

subgraph group_data["File access"]
  node_repository["Audio file repository"]
  node_adapter["Adapter contract<br/>[generic-adapter.ts]"]
  node_id3["NodeID3 file adapter"]
end

node_user(("Desktop user"))
node_filesystem[("Audio files")]
node_nodeid3["node-id3 library"]

node_renderer -->|"loads"| node_app
node_app -->|"renders"| node_main
node_user -->|"chooses directory"| node_main
node_main -->|"opens picker"| node_electron
node_main -->|"loads directory"| node_controller
node_main -->|"reads selected file"| node_controller
node_main -->|"saves edited tags"| node_controller
node_main -->|"renders files"| node_grid
node_grid -->|"selects file"| node_main
node_main -->|"renders editor"| node_dialog
node_main -->|"provides edit state"| node_context
node_dialog -->|"renders form"| node_form
node_dialog -->|"reads edit state"| node_context
node_form -->|"reads edit action"| node_context
node_form -->|"validates tracks"| node_trackhelper
node_controller -.->|"delegates file operations"| node_repository
node_repository -->|"uses adapter contract"| node_adapter
node_id3 -->|"implements contract"| node_adapter
node_id3 -->|"maps tag values"| node_model
node_id3 -->|"converts track numbers"| node_trackhelper
node_id3 -->|"reads and updates"| node_filesystem
node_id3 -->|"reads and writes tags"| node_nodeid3
node_repository -->|"returns audio files"| node_model

click node_renderer "https://github.com/mourtisma/electron-audio-tagger/blob/main/src/renderer.ts"
click node_app "https://github.com/mourtisma/electron-audio-tagger/blob/main/src/app.tsx"
click node_main "https://github.com/mourtisma/electron-audio-tagger/blob/main/src/view/main-container.tsx"
click node_grid "https://github.com/mourtisma/electron-audio-tagger/blob/main/src/view/audio-files-grid.tsx"
click node_dialog "https://github.com/mourtisma/electron-audio-tagger/blob/main/src/view/edit-dialog.tsx"
click node_form "https://github.com/mourtisma/electron-audio-tagger/blob/main/src/view/edit-audio-file-form.tsx"
click node_context "https://github.com/mourtisma/electron-audio-tagger/blob/main/src/view/context.ts"
click node_electron "https://github.com/mourtisma/electron-audio-tagger/blob/main/src/helpers/electron.ts"
click node_controller "https://github.com/mourtisma/electron-audio-tagger/blob/main/src/controller/audio-file-controller.ts"
click node_model "https://github.com/mourtisma/electron-audio-tagger/blob/main/src/model/audio-file.ts"
click node_trackhelper "https://github.com/mourtisma/electron-audio-tagger/blob/main/src/helpers/node-id3.ts"
click node_repository "https://github.com/mourtisma/electron-audio-tagger/blob/main/src/model/audio-file-repository.ts"
click node_adapter "https://github.com/mourtisma/electron-audio-tagger/blob/main/src/model/adapters/generic-adapter.ts"
click node_id3 "https://github.com/mourtisma/electron-audio-tagger/blob/main/src/model/adapters/node-id3-adapter.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_renderer,node_app,node_main,node_grid,node_dialog,node_form,node_context,node_electron,node_user toneBlue
class node_controller,node_model,node_trackhelper,node_filesystem toneAmber
class node_repository,node_adapter,node_id3 toneMint
class node_nodeid3 toneIndigo
```

## Components

### User interface

- [Renderer bootstrap](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/renderer.ts): `src/renderer.ts`
- [React app mount](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/app.tsx): `src/app.tsx`
- [Directory and edit flow](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/view/main-container.tsx): `src/view/main-container.tsx`
- [Audio file grid](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/view/audio-files-grid.tsx): `src/view/audio-files-grid.tsx`
- [Edit dialog](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/view/edit-dialog.tsx): `src/view/edit-dialog.tsx`
- [Tag edit form](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/view/edit-audio-file-form.tsx): `src/view/edit-audio-file-form.tsx`
- [Edit context](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/view/context.ts): `src/view/context.ts`
- [Electron dialog helper](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/helpers/electron.ts): `src/helpers/electron.ts`

### Tag editing

- [Audio file controller](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/controller/audio-file-controller.ts): `src/controller/audio-file-controller.ts`
- [Audio file model](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/model/audio-file.ts): `src/model/audio-file.ts`
- [Track number helpers](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/helpers/node-id3.ts): `src/helpers/node-id3.ts`

### File access

- [Audio file repository](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/model/audio-file-repository.ts): `src/model/audio-file-repository.ts`
- [Adapter contract](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/model/adapters/generic-adapter.ts): `src/model/adapters/generic-adapter.ts`
- [NodeID3 file adapter](https://github.com/mourtisma/electron-audio-tagger/blob/main/src/model/adapters/node-id3-adapter.ts): `src/model/adapters/node-id3-adapter.ts`

### Other components

- **Desktop user**
- **Audio files**
- **node-id3 library**

## Connections

- Renderer bootstrap → React app mount: loads (evidence: `src/renderer.ts`)
- React app mount → Directory and edit flow: renders (evidence: `src/app.tsx`)
- Desktop user → Directory and edit flow: chooses directory (evidence: `README.md`)
- Directory and edit flow → Electron dialog helper: opens picker (evidence: `src/view/main-container.tsx`)
- Directory and edit flow → Audio file controller: loads directory (evidence: `src/view/main-container.tsx`)
- Directory and edit flow → Audio file controller: reads selected file (evidence: `src/view/main-container.tsx`)
- Directory and edit flow → Audio file controller: saves edited tags (evidence: `src/view/main-container.tsx`)
- Directory and edit flow → Audio file grid: renders files (evidence: `src/view/main-container.tsx`)
- Audio file grid → Directory and edit flow: selects file (evidence: `src/view/audio-files-grid.tsx`)
- Directory and edit flow → Edit dialog: renders editor (evidence: `src/view/main-container.tsx`)
- Directory and edit flow → Edit context: provides edit state (evidence: `src/view/main-container.tsx`)
- Edit dialog → Tag edit form: renders form (evidence: `src/view/edit-dialog.tsx`)
- Edit dialog → Edit context: reads edit state (evidence: `src/view/edit-dialog.tsx`)
- Tag edit form → Edit context: reads edit action (evidence: `src/view/edit-audio-file-form.tsx`)
- Tag edit form → Track number helpers: validates tracks (evidence: `src/view/edit-audio-file-form.tsx`)
- Audio file controller → Audio file repository: delegates file operations
- Audio file repository → Adapter contract: uses adapter contract (evidence: `src/model/audio-file-repository.ts`)
- NodeID3 file adapter → Adapter contract: implements contract (evidence: `src/model/adapters/node-id3-adapter.ts`)
- NodeID3 file adapter → Audio file model: maps tag values (evidence: `src/model/adapters/node-id3-adapter.ts`)
- NodeID3 file adapter → Track number helpers: converts track numbers (evidence: `src/model/adapters/node-id3-adapter.ts`)
- NodeID3 file adapter → Audio files: reads and updates (evidence: `src/model/adapters/node-id3-adapter.ts`)
- NodeID3 file adapter → node-id3 library: reads and writes tags (evidence: `src/model/adapters/node-id3-adapter.ts`)
- Audio file repository → Audio file model: returns audio files (evidence: `src/model/audio-file-repository.ts`)
