# theatre-js/theatre architecture

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

- Interactive diagram: https://gitdiagram.com/theatre-js/theatre
- Repository: https://github.com/theatre-js/theatre

## Overview

Theatre.js is a web motion-design library: developers define animations programmatically, then can use the visual Studio to inspect and edit projects; animated values can drive 3D, HTML/SVG, and other JavaScript state. The graph separates core animation, Studio editing, and the React Three Fiber integration. The README documents product capabilities, while source evidence for internal links is limited to the sampled excerpts and SOURCE INDEX references; unsampled subsystems are represented without speculative call chains.

Main entry points: [`packages/studio/src/Studio.ts`](https://github.com/theatre-js/theatre/blob/main/packages/studio/src/Studio.ts) (Studio Runtime), [`packages/studio/src/UI/UI.ts`](https://github.com/theatre-js/theatre/blob/main/packages/studio/src/UI/UI.ts) (Editor UI), [`packages/r3f/src/extension/components/ProxyManager.tsx`](https://github.com/theatre-js/theatre/blob/main/packages/r3f/src/extension/components/ProxyManager.tsx) (Proxy Manager), [`packages/core/src/index.ts`](https://github.com/theatre-js/theatre/blob/main/packages/core/src/index.ts) (Core API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Animation Core"]
  node_core_api["Core API<br/>[index.ts]"]
  node_projects["Projects and Sheets<br/>[TheatreProject.ts]"]
  node_objects["Sheet Objects"]
  node_sequences["Sequences<br/>[TheatreSequence.ts]"]
  node_default_playback["Default Playback"]
  node_audio_playback["Audio Playback"]
end

subgraph group_studio["Visual Studio"]
  node_studio["Studio Runtime<br/>[Studio.ts]"]
  node_theatre_studio["Studio Integration<br/>[TheatreStudio.ts]"]
  node_panes["Pane Manager<br/>[PaneManager.ts]"]
  node_studio_ui["Editor UI<br/>[UI.ts]"]
  node_outline["Project Outline<br/>[OutlinePanel.tsx]"]
  node_detail["Property Editor<br/>[DetailPanel.tsx]"]
  node_timeline["Timeline Editor<br/>[DopeSheet.tsx]"]
  node_studio_store["Studio State<br/>[StudioStore.ts]"]
end

subgraph group_r3f["3D Integration"]
  node_r3f_store["3D Extension Store<br/>[store.ts]"]
  node_proxy_manager["Proxy Manager<br/>[ProxyManager.tsx]"]
  node_editable_proxy["Editable Objects<br/>[EditableProxy.tsx]"]
  node_selection["Selection Hook<br/>[useSelected.tsx]"]
  node_edit_helpers["Editor Helpers<br/>[editorStuff.ts]"]
  node_extension_store["Extension State"]
end

subgraph group_sync["Persistence and Sync"]
  node_studio_storage[("Browser Storage<br/>[IDBStorage.ts]")]
  node_sync_links["Sync Links<br/>[AppLink.ts]"]
end

node_developer(("Developer"))
node_developer_output["Web Experience"]

node_developer -->|"defines animation"| node_core_api
node_core_api -->|"creates projects"| node_projects
node_projects -->|"organizes objects"| node_objects
node_projects -->|"exposes sequences"| node_sequences
node_sequences -->|"plays by default"| node_default_playback
node_sequences -->|"supports audio playback"| node_audio_playback
node_developer -->|"edits visually"| node_studio
node_studio -->|"integrates core"| node_core_api
node_studio -->|"initializes integration"| node_theatre_studio
node_studio -->|"manages panes"| node_panes
node_studio -->|"uses state"| node_studio_store
node_studio -->|"uses browser storage"| node_studio_storage
node_studio -->|"sets up sync"| node_sync_links
node_studio -.->|"mounts editor UI"| node_studio_ui
node_studio_ui -.->|"presents outline"| node_outline
node_studio_ui -.->|"presents properties"| node_detail
node_studio_ui -.->|"presents timeline"| node_timeline
node_developer -->|"uses 3D integration"| node_r3f_store
node_r3f_store -->|"manages proxies"| node_proxy_manager
node_proxy_manager -->|"renders proxies"| node_editable_proxy
node_proxy_manager -->|"gets editor object"| node_edit_helpers
node_proxy_manager -->|"reads extension state"| node_extension_store
node_editable_proxy -->|"uses selection"| node_selection
node_core_api -->|"drives animation"| node_developer_output

click node_core_api "https://github.com/theatre-js/theatre/blob/main/packages/core/src/index.ts"
click node_projects "https://github.com/theatre-js/theatre/blob/main/packages/core/src/projects/TheatreProject.ts"
click node_objects "https://github.com/theatre-js/theatre/blob/main/packages/core/src/sheetObjects/TheatreSheetObject.ts"
click node_sequences "https://github.com/theatre-js/theatre/blob/main/packages/core/src/sequences/TheatreSequence.ts"
click node_default_playback "https://github.com/theatre-js/theatre/blob/main/packages/core/src/sequences/playbackControllers/DefaultPlaybackController.ts"
click node_audio_playback "https://github.com/theatre-js/theatre/blob/main/packages/core/src/sequences/playbackControllers/AudioPlaybackController.ts"
click node_studio "https://github.com/theatre-js/theatre/blob/main/packages/studio/src/Studio.ts"
click node_theatre_studio "https://github.com/theatre-js/theatre/blob/main/packages/studio/src/TheatreStudio.ts"
click node_panes "https://github.com/theatre-js/theatre/blob/main/packages/studio/src/PaneManager.ts"
click node_studio_ui "https://github.com/theatre-js/theatre/blob/main/packages/studio/src/UI/UI.ts"
click node_outline "https://github.com/theatre-js/theatre/blob/main/packages/studio/src/panels/OutlinePanel/OutlinePanel.tsx"
click node_detail "https://github.com/theatre-js/theatre/blob/main/packages/studio/src/panels/DetailPanel/DetailPanel.tsx"
click node_timeline "https://github.com/theatre-js/theatre/blob/main/packages/studio/src/panels/SequenceEditorPanel/DopeSheet/DopeSheet.tsx"
click node_studio_store "https://github.com/theatre-js/theatre/blob/main/packages/studio/src/StudioStore/StudioStore.ts"
click node_studio_storage "https://github.com/theatre-js/theatre/blob/main/packages/studio/src/IDBStorage.ts"
click node_sync_links "https://github.com/theatre-js/theatre/blob/main/packages/studio/src/SyncStore/AppLink.ts"
click node_r3f_store "https://github.com/theatre-js/theatre/blob/main/packages/r3f/src/main/store.ts"
click node_proxy_manager "https://github.com/theatre-js/theatre/blob/main/packages/r3f/src/extension/components/ProxyManager.tsx"
click node_editable_proxy "https://github.com/theatre-js/theatre/blob/main/packages/r3f/src/extension/components/EditableProxy.tsx"
click node_selection "https://github.com/theatre-js/theatre/blob/main/packages/r3f/src/extension/components/useSelected.tsx"
click node_edit_helpers "https://github.com/theatre-js/theatre/blob/main/packages/r3f/src/extension/editorStuff.ts"
click node_extension_store "https://github.com/theatre-js/theatre/blob/main/packages/r3f/src/extension/useExtensionStore.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_core_api,node_projects,node_objects,node_sequences,node_default_playback,node_audio_playback toneBlue
class node_studio,node_theatre_studio,node_panes,node_studio_ui,node_outline,node_detail,node_timeline,node_studio_store toneAmber
class node_r3f_store,node_proxy_manager,node_editable_proxy,node_selection,node_edit_helpers,node_extension_store toneMint
class node_studio_storage,node_sync_links toneRose
class node_developer,node_developer_output toneIndigo
```

## Components

### Animation Core

- [Core API](https://github.com/theatre-js/theatre/blob/main/packages/core/src/index.ts): `packages/core/src/index.ts`
- [Projects and Sheets](https://github.com/theatre-js/theatre/blob/main/packages/core/src/projects/TheatreProject.ts): `packages/core/src/projects/TheatreProject.ts`
- [Sheet Objects](https://github.com/theatre-js/theatre/blob/main/packages/core/src/sheetObjects/TheatreSheetObject.ts): `packages/core/src/sheetObjects/TheatreSheetObject.ts`
- [Sequences](https://github.com/theatre-js/theatre/blob/main/packages/core/src/sequences/TheatreSequence.ts): `packages/core/src/sequences/TheatreSequence.ts`
- [Default Playback](https://github.com/theatre-js/theatre/blob/main/packages/core/src/sequences/playbackControllers/DefaultPlaybackController.ts): `packages/core/src/sequences/playbackControllers/DefaultPlaybackController.ts`
- [Audio Playback](https://github.com/theatre-js/theatre/blob/main/packages/core/src/sequences/playbackControllers/AudioPlaybackController.ts): `packages/core/src/sequences/playbackControllers/AudioPlaybackController.ts`

### Visual Studio

- [Studio Runtime](https://github.com/theatre-js/theatre/blob/main/packages/studio/src/Studio.ts): `packages/studio/src/Studio.ts`
- [Studio Integration](https://github.com/theatre-js/theatre/blob/main/packages/studio/src/TheatreStudio.ts): `packages/studio/src/TheatreStudio.ts`
- [Pane Manager](https://github.com/theatre-js/theatre/blob/main/packages/studio/src/PaneManager.ts): `packages/studio/src/PaneManager.ts`
- [Editor UI](https://github.com/theatre-js/theatre/blob/main/packages/studio/src/UI/UI.ts): `packages/studio/src/UI/UI.ts`
- [Project Outline](https://github.com/theatre-js/theatre/blob/main/packages/studio/src/panels/OutlinePanel/OutlinePanel.tsx): `packages/studio/src/panels/OutlinePanel/OutlinePanel.tsx`
- [Property Editor](https://github.com/theatre-js/theatre/blob/main/packages/studio/src/panels/DetailPanel/DetailPanel.tsx): `packages/studio/src/panels/DetailPanel/DetailPanel.tsx`
- [Timeline Editor](https://github.com/theatre-js/theatre/blob/main/packages/studio/src/panels/SequenceEditorPanel/DopeSheet/DopeSheet.tsx): `packages/studio/src/panels/SequenceEditorPanel/DopeSheet/DopeSheet.tsx`
- [Studio State](https://github.com/theatre-js/theatre/blob/main/packages/studio/src/StudioStore/StudioStore.ts): `packages/studio/src/StudioStore/StudioStore.ts`

### 3D Integration

- [3D Extension Store](https://github.com/theatre-js/theatre/blob/main/packages/r3f/src/main/store.ts): `packages/r3f/src/main/store.ts`
- [Proxy Manager](https://github.com/theatre-js/theatre/blob/main/packages/r3f/src/extension/components/ProxyManager.tsx): `packages/r3f/src/extension/components/ProxyManager.tsx`
- [Editable Objects](https://github.com/theatre-js/theatre/blob/main/packages/r3f/src/extension/components/EditableProxy.tsx): `packages/r3f/src/extension/components/EditableProxy.tsx`
- [Selection Hook](https://github.com/theatre-js/theatre/blob/main/packages/r3f/src/extension/components/useSelected.tsx): `packages/r3f/src/extension/components/useSelected.tsx`
- [Editor Helpers](https://github.com/theatre-js/theatre/blob/main/packages/r3f/src/extension/editorStuff.ts): `packages/r3f/src/extension/editorStuff.ts`
- [Extension State](https://github.com/theatre-js/theatre/blob/main/packages/r3f/src/extension/useExtensionStore.ts): `packages/r3f/src/extension/useExtensionStore.ts`

### Persistence and Sync

- [Browser Storage](https://github.com/theatre-js/theatre/blob/main/packages/studio/src/IDBStorage.ts): `packages/studio/src/IDBStorage.ts`
- [Sync Links](https://github.com/theatre-js/theatre/blob/main/packages/studio/src/SyncStore/AppLink.ts): `packages/studio/src/SyncStore/AppLink.ts`

### Other components

- **Developer**
- **Web Experience**

## Connections

- Developer → Core API: defines animation (evidence: `README.md`)
- Core API → Projects and Sheets: creates projects
- Projects and Sheets → Sheet Objects: organizes objects
- Projects and Sheets → Sequences: exposes sequences
- Sequences → Default Playback: plays by default (evidence: `packages/core/src/sequences/playbackControllers/DefaultPlaybackController.ts`)
- Sequences → Audio Playback: supports audio playback (evidence: `packages/core/src/sequences/playbackControllers/AudioPlaybackController.ts`)
- Developer → Studio Runtime: edits visually (evidence: `README.md`)
- Studio Runtime → Core API: integrates core (evidence: `packages/studio/src/Studio.ts`)
- Studio Runtime → Studio Integration: initializes integration (evidence: `packages/studio/src/Studio.ts`)
- Studio Runtime → Pane Manager: manages panes (evidence: `packages/studio/src/Studio.ts`)
- Studio Runtime → Studio State: uses state (evidence: `packages/studio/src/Studio.ts`)
- Studio Runtime → Browser Storage: uses browser storage (evidence: `packages/studio/src/Studio.ts`)
- Studio Runtime → Sync Links: sets up sync (evidence: `packages/studio/src/Studio.ts`)
- Studio Runtime → Editor UI: mounts editor UI
- Editor UI → Project Outline: presents outline
- Editor UI → Property Editor: presents properties
- Editor UI → Timeline Editor: presents timeline
- Developer → 3D Extension Store: uses 3D integration (evidence: `README.md`)
- 3D Extension Store → Proxy Manager: manages proxies (evidence: `packages/r3f/src/extension/components/ProxyManager.tsx`)
- Proxy Manager → Editable Objects: renders proxies (evidence: `packages/r3f/src/extension/components/ProxyManager.tsx`)
- Proxy Manager → Editor Helpers: gets editor object (evidence: `packages/r3f/src/extension/components/ProxyManager.tsx`)
- Proxy Manager → Extension State: reads extension state (evidence: `packages/r3f/src/extension/components/ProxyManager.tsx`)
- Editable Objects → Selection Hook: uses selection (evidence: `packages/r3f/src/extension/components/EditableProxy.tsx`)
- Core API → Web Experience: drives animation (evidence: `README.md`)
