# hareeshbhumireddi/snapsplode architecture

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

- Interactive diagram: https://gitdiagram.com/hareeshbhumireddi/snapsplode
- Repository: https://github.com/hareeshbhumireddi/snapsplode

## Overview

SnapSplode is a local-browser hand-controlled 3D particle experience. The main workflow captures webcam and microphone input, tracks gestures and snaps, then uses those controls to summon, explode, inspect, and navigate procedural models rendered as GPU particles. The graph preserves the model categories and the vision, gesture, snap, particle, and overlay layers. Some connections are documented in the README rather than shown in sampled implementation excerpts; those are cited there.

Main entry points: [`src/main.js`](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/main.js) (Experience Controller), [`src/catalog/index.js`](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/catalog/index.js) (Model Catalog), [`src/geometry.js`](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/geometry.js) (Shape Sampling), [`src/snap.js`](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/snap.js) (Snap Detection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Input &amp; Interaction"]
  node_worker["Vision Worker<br/>[hand-worker.js]"]
  node_tracker["Hand Tracker<br/>[tracker.js]"]
  node_handprocessing["Hand &amp; Gesture Processing<br/>[hands.js]"]
  node_gestures["Gesture Analysis<br/>[gestures.js]"]
  node_snap["Snap Detection<br/>[snap.js]"]
  node_main["Experience Controller<br/>[main.js]"]
end

subgraph group_models["Procedural Models"]
  node_catalogindex["Model Catalog<br/>[index.js]"]
  node_wonders["World Wonders<br/>[wonders.js]"]
  node_anatomy["Anatomy &amp; Biology<br/>[anatomy.js]"]
  node_engines["Engines<br/>[engines.js]"]
  node_vehicles["Vehicles<br/>[vehicles.js]"]
  node_machines["Machines<br/>[machines.js]"]
  node_geometry["Shape Sampling<br/>[geometry.js]"]
end

subgraph group_visualization["Particle Visualization"]
  node_overlay["Screen Overlay<br/>[overlay.js]"]
  node_compiler["Particle Compiler<br/>[compile.js]"]
  node_particlefield["GPU Particle Field<br/>[particles.js]"]
end

node_user(("User"))
node_camera(("Webcam"))
node_microphone(("Microphone"))

node_user -->|"provides video"| node_camera
node_user -->|"provides audio"| node_microphone
node_camera -->|"sends frames"| node_worker
node_worker -->|"reports landmarks"| node_tracker
node_microphone -->|"supplies audio"| node_snap
node_tracker -->|"delivers tracking"| node_main
node_main -->|"processes hands"| node_handprocessing
node_handprocessing -->|"analyzes gestures"| node_gestures
node_main -->|"uses detection"| node_snap
node_snap -->|"signals snap"| node_main
node_user -->|"controls experience"| node_main
node_main -->|"draws interface"| node_overlay
node_main -->|"selects models"| node_catalogindex
node_catalogindex -->|"exports models"| node_wonders
node_catalogindex -->|"exports models"| node_anatomy
node_catalogindex -->|"exports models"| node_engines
node_catalogindex -->|"exports models"| node_vehicles
node_catalogindex -->|"exports models"| node_machines
node_wonders -->|"builds from shapes"| node_geometry
node_anatomy -->|"builds from shapes"| node_geometry
node_engines -->|"builds from shapes"| node_geometry
node_vehicles -->|"builds from shapes"| node_geometry
node_machines -->|"builds from shapes"| node_geometry
node_main -->|"compiles selected model"| node_compiler
node_main -->|"updates rendering"| node_particlefield
node_compiler -->|"provides particle data"| node_particlefield

click node_worker "https://github.com/hareeshbhumireddi/snapsplode/blob/main/public/hand-worker.js"
click node_tracker "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/tracker.js"
click node_handprocessing "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/hands.js"
click node_gestures "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/gestures.js"
click node_snap "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/snap.js"
click node_main "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/main.js"
click node_overlay "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/overlay.js"
click node_catalogindex "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/catalog/index.js"
click node_wonders "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/catalog/wonders.js"
click node_anatomy "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/catalog/anatomy.js"
click node_engines "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/catalog/engines.js"
click node_vehicles "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/catalog/vehicles.js"
click node_machines "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/catalog/machines.js"
click node_geometry "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/geometry.js"
click node_compiler "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/compile.js"
click node_particlefield "https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/particles.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_worker,node_tracker,node_handprocessing,node_gestures,node_snap,node_main,node_user toneBlue
class node_catalogindex,node_wonders,node_anatomy,node_engines,node_vehicles,node_machines,node_geometry toneAmber
class node_overlay,node_compiler,node_particlefield toneMint
class node_camera,node_microphone toneIndigo
```

## Components

### Input & Interaction

- [Vision Worker](https://github.com/hareeshbhumireddi/snapsplode/blob/main/public/hand-worker.js): `public/hand-worker.js`
- [Hand Tracker](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/tracker.js): `src/tracker.js`
- [Hand & Gesture Processing](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/hands.js): `src/hands.js`
- [Gesture Analysis](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/gestures.js): `src/gestures.js`
- [Snap Detection](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/snap.js): `src/snap.js`
- [Experience Controller](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/main.js): `src/main.js`

### Procedural Models

- [Model Catalog](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/catalog/index.js): `src/catalog/index.js`
- [World Wonders](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/catalog/wonders.js): `src/catalog/wonders.js`
- [Anatomy & Biology](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/catalog/anatomy.js): `src/catalog/anatomy.js`
- [Engines](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/catalog/engines.js): `src/catalog/engines.js`
- [Vehicles](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/catalog/vehicles.js): `src/catalog/vehicles.js`
- [Machines](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/catalog/machines.js): `src/catalog/machines.js`
- [Shape Sampling](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/geometry.js): `src/geometry.js`

### Particle Visualization

- [Screen Overlay](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/overlay.js): `src/overlay.js`
- [Particle Compiler](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/compile.js): `src/compile.js`
- [GPU Particle Field](https://github.com/hareeshbhumireddi/snapsplode/blob/main/src/particles.js): `src/particles.js`

### Other components

- **User**
- **Webcam**
- **Microphone**

## Connections

- User → Webcam: provides video (evidence: `README.md`)
- User → Microphone: provides audio (evidence: `README.md`)
- Webcam → Vision Worker: sends frames (evidence: `README.md`)
- Vision Worker → Hand Tracker: reports landmarks (evidence: `README.md`)
- Microphone → Snap Detection: supplies audio (evidence: `README.md`)
- Hand Tracker → Experience Controller: delivers tracking (evidence: `README.md`)
- Experience Controller → Hand & Gesture Processing: processes hands (evidence: `src/main.js`)
- Hand & Gesture Processing → Gesture Analysis: analyzes gestures (evidence: `src/hands.js`)
- Experience Controller → Snap Detection: uses detection (evidence: `src/main.js`)
- Snap Detection → Experience Controller: signals snap (evidence: `README.md`)
- User → Experience Controller: controls experience (evidence: `README.md`)
- Experience Controller → Screen Overlay: draws interface (evidence: `src/main.js`)
- Experience Controller → Model Catalog: selects models (evidence: `src/main.js`)
- Model Catalog → World Wonders: exports models (evidence: `src/catalog/index.js`)
- Model Catalog → Anatomy & Biology: exports models (evidence: `src/catalog/index.js`)
- Model Catalog → Engines: exports models (evidence: `src/catalog/index.js`)
- Model Catalog → Vehicles: exports models (evidence: `src/catalog/index.js`)
- Model Catalog → Machines: exports models (evidence: `src/catalog/index.js`)
- World Wonders → Shape Sampling: builds from shapes (evidence: `src/catalog/wonders.js`)
- Anatomy & Biology → Shape Sampling: builds from shapes (evidence: `src/catalog/anatomy.js`)
- Engines → Shape Sampling: builds from shapes (evidence: `src/catalog/engines.js`)
- Vehicles → Shape Sampling: builds from shapes (evidence: `src/catalog/vehicles.js`)
- Machines → Shape Sampling: builds from shapes (evidence: `src/catalog/machines.js`)
- Experience Controller → Particle Compiler: compiles selected model (evidence: `src/main.js`)
- Experience Controller → GPU Particle Field: updates rendering (evidence: `README.md`)
- Particle Compiler → GPU Particle Field: provides particle data (evidence: `README.md`)
