# obsidian-ig/project-dna architecture

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

- Interactive diagram: https://gitdiagram.com/obsidian-ig/project-dna
- Repository: https://github.com/obsidian-ig/project-dna

## Overview

DNA Animator is a desktop rig-authoring and preview tool for Helix-style microcontroller characters. The main workflow is to create or load a rig, edit its hierarchy and properties, and inspect its rendered appearance; the playground route coordinates those editors and shared state. The README also describes direct JSON editing, animation design, and live hardware preview, but the sampled implementation does not establish how those capabilities are wired. The device-preview link is therefore documented but not source-verified.

Main entry points: [`dna-animator/src/routes/rig-tester/+page.svelte`](https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/routes/rig-tester/%2Bpage.svelte) (Rig playground), [`dna-animator/src/AppState.svelte.ts`](https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/AppState.svelte.ts) (App state), [`dna-animator/src/DNARig.ts`](https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/DNARig.ts) (Rig schema), [`dna-animator/src/routes/header.svelte`](https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/routes/header.svelte) (Workspace header)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Animator workspace"]
  node_playground["Rig playground<br/>[+page.svelte]"]
  node_header["Workspace header<br/>[header.svelte]"]
  node_header_actions["Header actions"]
  node_app_state["App state<br/>[AppState.svelte.ts]"]
end

subgraph group_rig["Rig editing"]
  node_rig_model["Rig schema<br/>[DNARig.ts]"]
  node_tree["Rig hierarchy<br/>[RigTree.svelte]"]
  node_properties["Property explorer"]
  node_property_controls["Property controls"]
end

subgraph group_render["Preview and persistence"]
  node_display["Rig renderer<br/>[RigDisplay.svelte]"]
  node_browser_store[("Local browser storage")]
end

subgraph group_desktop["Desktop integration"]
  node_electron_bridge["Electron bridge<br/>[preload.ts]"]
end

node_artist(("Rig author"))
node_device["Helix device"]

node_artist -->|"edits rigs"| node_playground
node_playground -->|"renders"| node_tree
node_playground -->|"renders"| node_properties
node_playground -.->|"renders"| node_display
node_playground -->|"creates rigs"| node_rig_model
node_playground -->|"updates state"| node_app_state
node_tree -->|"reads and edits"| node_rig_model
node_tree -->|"updates selection"| node_app_state
node_properties -->|"renders controls"| node_property_controls
node_properties -->|"edits properties"| node_rig_model
node_display -->|"renders rig"| node_rig_model
node_display -->|"reads settings"| node_app_state
node_playground -->|"reads and saves files"| node_electron_bridge
node_artist -->|"uses menus"| node_header
node_header -->|"runs actions"| node_header_actions
node_header -->|"reads configuration"| node_app_state
node_app_state -->|"persists state"| node_browser_store
node_device -.->|"live preview"| node_playground

click node_playground "https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/routes/rig-tester/%2Bpage.svelte"
click node_header "https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/routes/header.svelte"
click node_header_actions "https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/routes/header-actions.svelte.ts"
click node_app_state "https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/AppState.svelte.ts"
click node_rig_model "https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/DNARig.ts"
click node_tree "https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/components/RigTree.svelte"
click node_properties "https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/components/RigPropsExplorer.svelte"
click node_property_controls "https://github.com/obsidian-ig/project-dna/tree/main/dna-animator/src/components/PropertiesExplorerComponents"
click node_display "https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/components/RigDisplay.svelte"
click node_electron_bridge "https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/main/preload.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_playground,node_header,node_header_actions,node_app_state toneBlue
class node_rig_model,node_tree,node_properties,node_property_controls toneAmber
class node_display,node_browser_store toneMint
class node_electron_bridge toneRose
class node_artist,node_device toneIndigo
```

## Components

### Animator workspace

- [Rig playground](https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/routes/rig-tester/%2Bpage.svelte): `dna-animator/src/routes/rig-tester/+page.svelte`
- [Workspace header](https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/routes/header.svelte): `dna-animator/src/routes/header.svelte`
- [Header actions](https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/routes/header-actions.svelte.ts): `dna-animator/src/routes/header-actions.svelte.ts`
- [App state](https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/AppState.svelte.ts): `dna-animator/src/AppState.svelte.ts`

### Rig editing

- [Rig schema](https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/DNARig.ts): `dna-animator/src/DNARig.ts`
- [Rig hierarchy](https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/components/RigTree.svelte): `dna-animator/src/components/RigTree.svelte`
- [Property explorer](https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/components/RigPropsExplorer.svelte): `dna-animator/src/components/RigPropsExplorer.svelte`
- [Property controls](https://github.com/obsidian-ig/project-dna/tree/main/dna-animator/src/components/PropertiesExplorerComponents): `dna-animator/src/components/PropertiesExplorerComponents`

### Preview and persistence

- [Rig renderer](https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/components/RigDisplay.svelte): `dna-animator/src/components/RigDisplay.svelte`
- **Local browser storage**

### Desktop integration

- [Electron bridge](https://github.com/obsidian-ig/project-dna/blob/main/dna-animator/src/main/preload.ts): `dna-animator/src/main/preload.ts`

### Other components

- **Rig author**
- **Helix device**

## Connections

- Rig author → Rig playground: edits rigs (evidence: `README.md`)
- Rig playground → Rig hierarchy: renders (evidence: `dna-animator/src/routes/rig-tester/+page.svelte`)
- Rig playground → Property explorer: renders (evidence: `dna-animator/src/routes/rig-tester/+page.svelte`)
- Rig playground → Rig renderer: renders (evidence: `dna-animator/src/routes/rig-tester/+page.svelte`)
- Rig playground → Rig schema: creates rigs (evidence: `dna-animator/src/routes/rig-tester/+page.svelte`)
- Rig playground → App state: updates state (evidence: `dna-animator/src/routes/rig-tester/+page.svelte`)
- Rig hierarchy → Rig schema: reads and edits (evidence: `dna-animator/src/components/RigTree.svelte`)
- Rig hierarchy → App state: updates selection (evidence: `dna-animator/src/components/RigTree.svelte`)
- Property explorer → Property controls: renders controls (evidence: `dna-animator/src/components/RigPropsExplorer.svelte`)
- Property explorer → Rig schema: edits properties (evidence: `dna-animator/src/components/RigPropsExplorer.svelte`)
- Rig renderer → Rig schema: renders rig (evidence: `dna-animator/src/components/RigDisplay.svelte`)
- Rig renderer → App state: reads settings (evidence: `dna-animator/src/components/RigDisplay.svelte`)
- Rig playground → Electron bridge: reads and saves files (evidence: `dna-animator/src/routes/rig-tester/+page.svelte`)
- Rig author → Workspace header: uses menus (evidence: `dna-animator/src/routes/header.svelte`)
- Workspace header → Header actions: runs actions (evidence: `dna-animator/src/routes/header.svelte`)
- Workspace header → App state: reads configuration (evidence: `dna-animator/src/routes/header.svelte`)
- App state → Local browser storage: persists state
- Helix device → Rig playground: live preview (evidence: `README.md`)
