# dinatih/room-3d architecture

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

- Interactive diagram: https://gitdiagram.com/dinatih/room-3d
- Repository: https://github.com/dinatih/room-3d

## Overview

room-3d is a React Three Fiber application for interactively visualizing an apartment in 3D. Its main workflow is to enter the rendered room, inspect and arrange furniture and other objects, and use camera and scene controls to explore configurations; the inventory provides a related way to browse belongings. The graph also preserves documented building, lighting, minimap, and character/animation capabilities, plus the sampled autonomous-agent subsystem. Edges use README statements or source-index references; unsampled feature wiring is not asserted.

Main entry points: [`src/features/scene/Studio.tsx`](https://github.com/dinatih/room-3d/blob/master/src/features/scene/Studio.tsx) (3D studio), [`src/features/scene/ai/useAgentController.ts`](https://github.com/dinatih/room-3d/blob/master/src/features/scene/ai/useAgentController.ts) (Agent controller), [`src/features/scene/CameraController.tsx`](https://github.com/dinatih/room-3d/blob/master/src/features/scene/CameraController.tsx) (Camera controller), [`src/features/scene/ai/duoSessionManager.ts`](https://github.com/dinatih/room-3d/blob/master/src/features/scene/ai/duoSessionManager.ts) (Duo sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["3D experience"]
  node_entry["Application entry<br/>[main.tsx]"]
  node_studio["3D studio<br/>[Studio.tsx]"]
end

subgraph group_room["Apartment scene"]
  node_scene["Room composition<br/>[Building.tsx]"]
  node_placements["Furniture placement<br/>[Placements.tsx]"]
  node_itemmodels["Furniture models"]
  node_floorplan["Floor plan<br/>[FloorPlan.tsx]"]
  node_lighting["Lighting<br/>[SunLight.tsx]"]
end

subgraph group_interaction["Camera and controls"]
  node_camera["Camera controller"]
  node_camstate["Camera state<br/>[cameraState.ts]"]
  node_scenecontrols["Scene state<br/>[useSceneStore.ts]"]
  node_minimap["Minimap<br/>[Minimap.tsx]"]
end

subgraph group_characters["Characters and agents"]
  node_agentcontroller["Agent controller"]
  node_smartobjects["Smart objects"]
  node_occupancy["Slot occupancy"]
  node_duosessions["Duo sessions"]
  node_navigation["Navigation graph<br/>[navigationGraph.ts]"]
  node_animations["Animation resolution"]
  node_animationdata["Animation registry"]
  node_duoanimations["Duo animations<br/>[duoAnimations.ts]"]
end

subgraph group_inventory["Inventory"]
  node_inventory["Inventory browser<br/>[Inventory.tsx]"]
  node_inventorydata["Inventory data<br/>[inventoryData.ts]"]
  node_preview["Item preview"]
end

node_user(("Room planner"))

node_user -->|"opens app"| node_entry
node_entry -->|"mounts"| node_studio
node_studio -->|"renders room"| node_scene
node_studio -->|"shows placements"| node_placements
node_placements -->|"places models"| node_itemmodels
node_studio -->|"shows plan"| node_floorplan
node_studio -->|"shows lighting"| node_lighting
node_studio -->|"enables navigation"| node_camera
node_camera -->|"reads state"| node_scenecontrols
node_camera -->|"updates camera"| node_camstate
node_camera -->|"shares position"| node_minimap
node_studio -->|"offers inventory"| node_inventory
node_inventory -->|"browses items"| node_inventorydata
node_inventory -->|"previews items"| node_preview
node_agentcontroller -->|"resolves clips"| node_animations
node_agentcontroller -->|"uses affordances"| node_smartobjects
node_agentcontroller -->|"claims slots"| node_occupancy
node_agentcontroller -->|"coordinates duos"| node_duosessions
node_agentcontroller -->|"uses paths"| node_navigation
node_animations -->|"resolves definitions"| node_animationdata
node_animations -->|"resolves duo clips"| node_duoanimations
node_duosessions -->|"checks reservations"| node_occupancy
node_duosessions -->|"looks up objects"| node_smartobjects

click node_entry "https://github.com/dinatih/room-3d/blob/master/src/main.tsx"
click node_studio "https://github.com/dinatih/room-3d/blob/master/src/features/scene/Studio.tsx"
click node_scene "https://github.com/dinatih/room-3d/blob/master/src/features/scene/Building.tsx"
click node_placements "https://github.com/dinatih/room-3d/blob/master/src/features/scene/Placements.tsx"
click node_itemmodels "https://github.com/dinatih/room-3d/tree/master/src/features/scene/items"
click node_floorplan "https://github.com/dinatih/room-3d/blob/master/src/features/scene/FloorPlan.tsx"
click node_lighting "https://github.com/dinatih/room-3d/blob/master/src/features/scene/SunLight.tsx"
click node_camera "https://github.com/dinatih/room-3d/blob/master/src/features/scene/CameraController.tsx"
click node_camstate "https://github.com/dinatih/room-3d/blob/master/src/features/scene/cameraState.ts"
click node_scenecontrols "https://github.com/dinatih/room-3d/blob/master/src/features/scene/store/useSceneStore.ts"
click node_minimap "https://github.com/dinatih/room-3d/blob/master/src/features/scene/Minimap.tsx"
click node_inventory "https://github.com/dinatih/room-3d/blob/master/src/features/inventory/Inventory.tsx"
click node_inventorydata "https://github.com/dinatih/room-3d/blob/master/src/features/inventory/inventoryData.ts"
click node_preview "https://github.com/dinatih/room-3d/blob/master/src/features/inventory/InventoryPreview.tsx"
click node_agentcontroller "https://github.com/dinatih/room-3d/blob/master/src/features/scene/ai/useAgentController.ts"
click node_smartobjects "https://github.com/dinatih/room-3d/blob/master/src/features/scene/ai/smartObjectRegistry.ts"
click node_occupancy "https://github.com/dinatih/room-3d/blob/master/src/features/scene/ai/occupancyManager.ts"
click node_duosessions "https://github.com/dinatih/room-3d/blob/master/src/features/scene/ai/duoSessionManager.ts"
click node_navigation "https://github.com/dinatih/room-3d/blob/master/src/features/scene/ai/navigationGraph.ts"
click node_animations "https://github.com/dinatih/room-3d/blob/master/src/features/scene/animations/animationResolver.ts"
click node_animationdata "https://github.com/dinatih/room-3d/blob/master/src/features/scene/animations/animationRegistry.ts"
click node_duoanimations "https://github.com/dinatih/room-3d/blob/master/src/features/scene/animations/duoAnimations.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_entry,node_studio toneBlue
class node_scene,node_placements,node_itemmodels,node_floorplan,node_lighting toneAmber
class node_camera,node_camstate,node_scenecontrols,node_minimap toneMint
class node_agentcontroller,node_smartobjects,node_occupancy,node_duosessions,node_navigation,node_animations,node_animationdata,node_duoanimations toneRose
class node_inventory,node_inventorydata,node_preview,node_user toneIndigo
```

## Components

### 3D experience

- [Application entry](https://github.com/dinatih/room-3d/blob/master/src/main.tsx): `src/main.tsx`
- [3D studio](https://github.com/dinatih/room-3d/blob/master/src/features/scene/Studio.tsx): `src/features/scene/Studio.tsx`

### Apartment scene

- [Room composition](https://github.com/dinatih/room-3d/blob/master/src/features/scene/Building.tsx): `src/features/scene/Building.tsx`
- [Furniture placement](https://github.com/dinatih/room-3d/blob/master/src/features/scene/Placements.tsx): `src/features/scene/Placements.tsx`
- [Furniture models](https://github.com/dinatih/room-3d/tree/master/src/features/scene/items): `src/features/scene/items`
- [Floor plan](https://github.com/dinatih/room-3d/blob/master/src/features/scene/FloorPlan.tsx): `src/features/scene/FloorPlan.tsx`
- [Lighting](https://github.com/dinatih/room-3d/blob/master/src/features/scene/SunLight.tsx): `src/features/scene/SunLight.tsx`

### Camera and controls

- [Camera controller](https://github.com/dinatih/room-3d/blob/master/src/features/scene/CameraController.tsx): `src/features/scene/CameraController.tsx`
- [Camera state](https://github.com/dinatih/room-3d/blob/master/src/features/scene/cameraState.ts): `src/features/scene/cameraState.ts`
- [Scene state](https://github.com/dinatih/room-3d/blob/master/src/features/scene/store/useSceneStore.ts): `src/features/scene/store/useSceneStore.ts`
- [Minimap](https://github.com/dinatih/room-3d/blob/master/src/features/scene/Minimap.tsx): `src/features/scene/Minimap.tsx`

### Characters and agents

- [Agent controller](https://github.com/dinatih/room-3d/blob/master/src/features/scene/ai/useAgentController.ts): `src/features/scene/ai/useAgentController.ts`
- [Smart objects](https://github.com/dinatih/room-3d/blob/master/src/features/scene/ai/smartObjectRegistry.ts): `src/features/scene/ai/smartObjectRegistry.ts`
- [Slot occupancy](https://github.com/dinatih/room-3d/blob/master/src/features/scene/ai/occupancyManager.ts): `src/features/scene/ai/occupancyManager.ts`
- [Duo sessions](https://github.com/dinatih/room-3d/blob/master/src/features/scene/ai/duoSessionManager.ts): `src/features/scene/ai/duoSessionManager.ts`
- [Navigation graph](https://github.com/dinatih/room-3d/blob/master/src/features/scene/ai/navigationGraph.ts): `src/features/scene/ai/navigationGraph.ts`
- [Animation resolution](https://github.com/dinatih/room-3d/blob/master/src/features/scene/animations/animationResolver.ts): `src/features/scene/animations/animationResolver.ts`
- [Animation registry](https://github.com/dinatih/room-3d/blob/master/src/features/scene/animations/animationRegistry.ts): `src/features/scene/animations/animationRegistry.ts`
- [Duo animations](https://github.com/dinatih/room-3d/blob/master/src/features/scene/animations/duoAnimations.ts): `src/features/scene/animations/duoAnimations.ts`

### Inventory

- [Inventory browser](https://github.com/dinatih/room-3d/blob/master/src/features/inventory/Inventory.tsx): `src/features/inventory/Inventory.tsx`
- [Inventory data](https://github.com/dinatih/room-3d/blob/master/src/features/inventory/inventoryData.ts): `src/features/inventory/inventoryData.ts`
- [Item preview](https://github.com/dinatih/room-3d/blob/master/src/features/inventory/InventoryPreview.tsx): `src/features/inventory/InventoryPreview.tsx`

### Other components

- **Room planner**

## Connections

- Room planner → Application entry: opens app
- Application entry → 3D studio: mounts
- 3D studio → Room composition: renders room
- 3D studio → Furniture placement: shows placements
- Furniture placement → Furniture models: places models
- 3D studio → Floor plan: shows plan
- 3D studio → Lighting: shows lighting
- 3D studio → Camera controller: enables navigation
- Camera controller → Scene state: reads state (evidence: `src/features/scene/CameraController.tsx`)
- Camera controller → Camera state: updates camera (evidence: `src/features/scene/CameraController.tsx`)
- Camera controller → Minimap: shares position
- 3D studio → Inventory browser: offers inventory
- Inventory browser → Inventory data: browses items
- Inventory browser → Item preview: previews items
- Agent controller → Animation resolution: resolves clips (evidence: `src/features/scene/ai/useAgentController.ts`)
- Agent controller → Smart objects: uses affordances (evidence: `src/features/scene/ai/useAgentController.ts`)
- Agent controller → Slot occupancy: claims slots (evidence: `src/features/scene/ai/useAgentController.ts`)
- Agent controller → Duo sessions: coordinates duos (evidence: `src/features/scene/ai/useAgentController.ts`)
- Agent controller → Navigation graph: uses paths (evidence: `src/features/scene/ai/useAgentController.ts`)
- Animation resolution → Animation registry: resolves definitions (evidence: `src/features/scene/animations/animationResolver.ts`)
- Animation resolution → Duo animations: resolves duo clips (evidence: `src/features/scene/animations/animationResolver.ts`)
- Duo sessions → Slot occupancy: checks reservations (evidence: `src/features/scene/ai/duoSessionManager.ts`)
- Duo sessions → Smart objects: looks up objects (evidence: `src/features/scene/ai/duoSessionManager.ts`)
