# punypeony/sanvi_sample architecture

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

- Interactive diagram: https://gitdiagram.com/punypeony/sanvi_sample
- Repository: https://github.com/punypeony/sanvi_sample

## Overview

This is an interactive headphone product showcase: visitors explore a 3D model, inspect and tour its components, choose a colorway, and try synthesized audio and noise-cancellation demos. The graph separates the page shell, 3D inspection, and audio experience, with implementation data and preparation as an internal layer. Edges follow visible imports and calls; some 3D internals are supported only by the source index, so unsampled behavior is not expanded.

Main entry points: [`src/App.jsx`](https://github.com/punypeony/sanvi_sample/blob/main/src/App.jsx) (Showcase shell), [`src/three/ModelInspector.jsx`](https://github.com/punypeony/sanvi_sample/blob/main/src/three/ModelInspector.jsx) (Model inspector), [`src/three/HeadphoneModel.jsx`](https://github.com/punypeony/sanvi_sample/blob/main/src/three/HeadphoneModel.jsx) (Headphone model), [`src/three/colorways.js`](https://github.com/punypeony/sanvi_sample/blob/main/src/three/colorways.js) (Colorway data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_page["Showcase page"]
  node_app["Showcase shell<br/>[App.jsx]"]
  node_picker["Color picker<br/>[ColorPicker.jsx]"]
  node_entry["React entry<br/>[main.jsx]"]
end

subgraph group_inspection["3D inspection"]
  node_inspector["Model inspector<br/>[ModelInspector.jsx]"]
  node_headphones["Headphone model<br/>[HeadphoneModel.jsx]"]
  node_camera["Camera rig<br/>[CameraRig.jsx]"]
  node_studio["Studio scene<br/>[Studio.jsx]"]
  node_overlays["Inspector overlays"]
end

subgraph group_audio["Audio demo"]
  node_controls["Audio controls<br/>[AudioControls.jsx]"]
  node_audiohook["Audio state hook<br/>[useAudioDemo.js]"]
  node_audioengine["Procedural audio engine<br/>[audioEngine.js]"]
  node_rings["Audio visualizer<br/>[AudioRings.jsx]"]
end

subgraph group_modeldata["Model and product data"]
  node_colorways["Colorway data<br/>[colorways.js]"]
  node_parts["Part specifications<br/>[headphoneParts.js]"]
  node_preparation["Model preparation<br/>[prepareModel.js]"]
  node_modelasset["Headphone model asset<br/>[headphones.glb]"]
end

node_visitor(("Visitor"))
node_browserstate[("Browser URL and storage")]

node_visitor -.->|"uses"| node_app
node_entry -->|"renders"| node_app
node_app -->|"renders"| node_inspector
node_app -->|"renders"| node_picker
node_app -->|"renders"| node_controls
node_app -->|"renders"| node_rings
node_app -->|"reads and writes"| node_browserstate
node_picker -->|"reads options"| node_colorways
node_app -->|"reads selection data"| node_colorways
node_inspector -->|"renders"| node_headphones
node_inspector -->|"renders"| node_camera
node_inspector -->|"renders"| node_studio
node_inspector -->|"renders"| node_overlays
node_inspector -->|"reads part data"| node_parts
node_inspector -->|"reads palettes"| node_colorways
node_headphones -->|"uses preparation"| node_preparation
node_preparation -->|"matches mesh names"| node_parts
node_overlays -->|"reads part details"| node_parts
node_controls -->|"uses state and actions"| node_audiohook
node_audiohook -->|"subscribes and dispatches"| node_audioengine
node_rings -->|"reads levels and state"| node_audioengine
node_headphones -.->|"loads asset"| node_modelasset

click node_app "https://github.com/punypeony/sanvi_sample/blob/main/src/App.jsx"
click node_picker "https://github.com/punypeony/sanvi_sample/blob/main/src/components/ColorPicker.jsx"
click node_inspector "https://github.com/punypeony/sanvi_sample/blob/main/src/three/ModelInspector.jsx"
click node_headphones "https://github.com/punypeony/sanvi_sample/blob/main/src/three/HeadphoneModel.jsx"
click node_camera "https://github.com/punypeony/sanvi_sample/blob/main/src/three/CameraRig.jsx"
click node_studio "https://github.com/punypeony/sanvi_sample/blob/main/src/three/Studio.jsx"
click node_overlays "https://github.com/punypeony/sanvi_sample/blob/main/src/three/inspectorOverlays.jsx"
click node_controls "https://github.com/punypeony/sanvi_sample/blob/main/src/components/AudioControls.jsx"
click node_audiohook "https://github.com/punypeony/sanvi_sample/blob/main/src/audio/useAudioDemo.js"
click node_audioengine "https://github.com/punypeony/sanvi_sample/blob/main/src/audio/audioEngine.js"
click node_rings "https://github.com/punypeony/sanvi_sample/blob/main/src/components/AudioRings.jsx"
click node_colorways "https://github.com/punypeony/sanvi_sample/blob/main/src/three/colorways.js"
click node_parts "https://github.com/punypeony/sanvi_sample/blob/main/src/three/headphoneParts.js"
click node_preparation "https://github.com/punypeony/sanvi_sample/blob/main/src/three/prepareModel.js"
click node_modelasset "https://github.com/punypeony/sanvi_sample/blob/main/public/models/headphones.glb"
click node_entry "https://github.com/punypeony/sanvi_sample/blob/main/src/main.jsx"

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_picker,node_entry toneBlue
class node_inspector,node_headphones,node_camera,node_studio,node_overlays,node_browserstate toneAmber
class node_controls,node_audiohook,node_audioengine,node_rings toneMint
class node_colorways,node_parts,node_preparation,node_modelasset toneRose
class node_visitor toneIndigo
```

## Components

### Showcase page

- [Showcase shell](https://github.com/punypeony/sanvi_sample/blob/main/src/App.jsx): `src/App.jsx`
- [Color picker](https://github.com/punypeony/sanvi_sample/blob/main/src/components/ColorPicker.jsx): `src/components/ColorPicker.jsx`
- [React entry](https://github.com/punypeony/sanvi_sample/blob/main/src/main.jsx): `src/main.jsx`

### 3D inspection

- [Model inspector](https://github.com/punypeony/sanvi_sample/blob/main/src/three/ModelInspector.jsx): `src/three/ModelInspector.jsx`
- [Headphone model](https://github.com/punypeony/sanvi_sample/blob/main/src/three/HeadphoneModel.jsx): `src/three/HeadphoneModel.jsx`
- [Camera rig](https://github.com/punypeony/sanvi_sample/blob/main/src/three/CameraRig.jsx): `src/three/CameraRig.jsx`
- [Studio scene](https://github.com/punypeony/sanvi_sample/blob/main/src/three/Studio.jsx): `src/three/Studio.jsx`
- [Inspector overlays](https://github.com/punypeony/sanvi_sample/blob/main/src/three/inspectorOverlays.jsx): `src/three/inspectorOverlays.jsx`

### Audio demo

- [Audio controls](https://github.com/punypeony/sanvi_sample/blob/main/src/components/AudioControls.jsx): `src/components/AudioControls.jsx`
- [Audio state hook](https://github.com/punypeony/sanvi_sample/blob/main/src/audio/useAudioDemo.js): `src/audio/useAudioDemo.js`
- [Procedural audio engine](https://github.com/punypeony/sanvi_sample/blob/main/src/audio/audioEngine.js): `src/audio/audioEngine.js`
- [Audio visualizer](https://github.com/punypeony/sanvi_sample/blob/main/src/components/AudioRings.jsx): `src/components/AudioRings.jsx`

### Model and product data

- [Colorway data](https://github.com/punypeony/sanvi_sample/blob/main/src/three/colorways.js): `src/three/colorways.js`
- [Part specifications](https://github.com/punypeony/sanvi_sample/blob/main/src/three/headphoneParts.js): `src/three/headphoneParts.js`
- [Model preparation](https://github.com/punypeony/sanvi_sample/blob/main/src/three/prepareModel.js): `src/three/prepareModel.js`
- [Headphone model asset](https://github.com/punypeony/sanvi_sample/blob/main/public/models/headphones.glb): `public/models/headphones.glb`

### Other components

- **Visitor**
- **Browser URL and storage**

## Connections

- Visitor → Showcase shell: uses
- React entry → Showcase shell: renders (evidence: `src/main.jsx`)
- Showcase shell → Model inspector: renders (evidence: `src/App.jsx`)
- Showcase shell → Color picker: renders (evidence: `src/App.jsx`)
- Showcase shell → Audio controls: renders (evidence: `src/App.jsx`)
- Showcase shell → Audio visualizer: renders (evidence: `src/App.jsx`)
- Showcase shell → Browser URL and storage: reads and writes (evidence: `src/App.jsx`)
- Color picker → Colorway data: reads options (evidence: `src/components/ColorPicker.jsx`)
- Showcase shell → Colorway data: reads selection data (evidence: `src/App.jsx`)
- Model inspector → Headphone model: renders (evidence: `src/three/ModelInspector.jsx`)
- Model inspector → Camera rig: renders (evidence: `src/three/ModelInspector.jsx`)
- Model inspector → Studio scene: renders (evidence: `src/three/ModelInspector.jsx`)
- Model inspector → Inspector overlays: renders (evidence: `src/three/ModelInspector.jsx`)
- Model inspector → Part specifications: reads part data (evidence: `src/three/ModelInspector.jsx`)
- Model inspector → Colorway data: reads palettes (evidence: `src/three/ModelInspector.jsx`)
- Headphone model → Model preparation: uses preparation (evidence: `src/three/HeadphoneModel.jsx`)
- Model preparation → Part specifications: matches mesh names (evidence: `src/three/prepareModel.js`)
- Inspector overlays → Part specifications: reads part details (evidence: `src/three/inspectorOverlays.jsx`)
- Audio controls → Audio state hook: uses state and actions (evidence: `src/components/AudioControls.jsx`)
- Audio state hook → Procedural audio engine: subscribes and dispatches (evidence: `src/audio/useAudioDemo.js`)
- Audio visualizer → Procedural audio engine: reads levels and state (evidence: `src/components/AudioRings.jsx`)
- Headphone model → Headphone model asset: loads asset
