# hannahlowery/3d-llm-asset-library architecture

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

- Interactive diagram: https://gitdiagram.com/hannahlowery/3d-llm-asset-library
- Repository: https://github.com/hannahlowery/3d-llm-asset-library

## Overview

This is a desktop 3D closet and outfit editor: users browse and manage a model catalog, select clothing by text or sketch, inspect it in a live viewport, and export or send the outfit to Blender. The Qt app coordinates the UI and local FastAPI service; the backend manages catalog data and the AI selection flow. Rendering, export, and Blender transfer are distinct product branches. Connections use README statements and the provided source index; unsampled implementation details are not inferred.

Main entry points: [`AssetLibrary/Backend_py/LLM_py/agent.py`](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/LLM_py/agent.py) (Closet agent), [`QT/src/AssetStore.cpp`](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/QT/src/AssetStore.cpp) (Closet manager), [`AssetLibrary/Backend_py/main.py`](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/main.py) (FastAPI routes), [`QT/src/BackendClient.cpp`](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/QT/src/BackendClient.cpp) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop app"]
  node_qt_app["Qt app<br/>[main.cpp]"]
  node_asset_store["Closet manager<br/>[AssetStore.cpp]"]
  node_backend_client["HTTP client<br/>[BackendClient.cpp]"]
end

subgraph group_backend["Backend and catalog"]
  node_api["FastAPI routes<br/>[main.py]"]
  node_db_access["Catalog queries<br/>[database.py]"]
  node_postgres[("PostgreSQL")]
  node_api_key["Key encryption<br/>[API_Encyption.py]"]
end

subgraph group_agent["AI selection"]
  node_agent["Closet agent<br/>[agent.py]"]
  node_guardrails["Request guardrails<br/>[guardrails.py]"]
  node_sketch["Sketch analysis<br/>[sketch.py]"]
  node_schemas["Agent schemas<br/>[schemas.py]"]
end

subgraph group_render["Viewport and export"]
  node_viewport["3D viewport<br/>[ViewportItem.cpp]"]
  node_renderer["OpenGL renderer<br/>[Model.cpp]"]
  node_camera["Camera controls<br/>[Camera.cpp]"]
  node_exporter["Model exporter<br/>[ModelExporter.cpp]"]
end

subgraph group_blender["Blender integration"]
  node_blender_link["Blender link<br/>[BlenderLink.cpp]"]
  node_plugin["Blender add-on<br/>[__init__.py]"]
  node_plugin_client["Plugin downloader<br/>[client.py]"]
  node_plugin_importer["Blender importer<br/>[importer.py]"]
end

node_user(("User"))
node_openrouter{{"OpenRouter LLM"}}

node_user -->|"uses"| node_qt_app
node_qt_app -->|"starts backend"| node_backend_client
node_asset_store -->|"requests catalog"| node_backend_client
node_backend_client -->|"HTTP requests"| node_api
node_api -->|"routes catalog calls"| node_db_access
node_db_access -->|"reads and writes"| node_postgres
node_api -->|"dispatches commands"| node_agent
node_api -->|"describes strokes"| node_sketch
node_agent -->|"builds catalog"| node_db_access
node_agent -->|"checks requests"| node_guardrails
node_agent -->|"validates decisions"| node_schemas
node_agent -->|"loads key"| node_api_key
node_agent -->|"sends prompt"| node_openrouter
node_backend_client -.->|"returns selections"| node_asset_store
node_asset_store -->|"updates outfit"| node_viewport
node_viewport -->|"renders scene"| node_renderer
node_viewport -->|"controls view"| node_camera
node_asset_store -->|"exports outfit"| node_exporter
node_asset_store -->|"sends outfit"| node_blender_link
node_blender_link -->|"connects add-on"| node_plugin
node_plugin -->|"downloads files"| node_plugin_client
node_plugin -->|"imports models"| node_plugin_importer
node_plugin_client -->|"fetches model files"| node_api

click node_qt_app "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/QT/main.cpp"
click node_asset_store "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/QT/src/AssetStore.cpp"
click node_backend_client "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/QT/src/BackendClient.cpp"
click node_api "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/main.py"
click node_db_access "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/database.py"
click node_api_key "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/API_Encyption.py"
click node_agent "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/LLM_py/agent.py"
click node_guardrails "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/LLM_py/guardrails.py"
click node_sketch "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/LLM_py/sketch.py"
click node_schemas "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/schemas.py"
click node_viewport "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/QT/src/ViewportItem.cpp"
click node_renderer "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/src/Model.cpp"
click node_camera "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/src/Camera.cpp"
click node_exporter "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/QT/src/ModelExporter.cpp"
click node_blender_link "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/QT/src/BlenderLink.cpp"
click node_plugin "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/blender_plugin/asset_library/__init__.py"
click node_plugin_client "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/blender_plugin/asset_library/client.py"
click node_plugin_importer "https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/blender_plugin/asset_library/importer.py"

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_qt_app,node_asset_store,node_backend_client,node_user toneBlue
class node_api,node_db_access,node_postgres,node_api_key toneAmber
class node_agent,node_guardrails,node_sketch,node_schemas,node_openrouter toneMint
class node_viewport,node_renderer,node_camera,node_exporter toneRose
class node_blender_link,node_plugin,node_plugin_client,node_plugin_importer toneIndigo
```

## Components

### Desktop app

- [Qt app](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/QT/main.cpp): `QT/main.cpp`
- [Closet manager](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/QT/src/AssetStore.cpp): `QT/src/AssetStore.cpp`
- [HTTP client](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/QT/src/BackendClient.cpp): `QT/src/BackendClient.cpp`

### Backend and catalog

- [FastAPI routes](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/main.py): `AssetLibrary/Backend_py/main.py`
- [Catalog queries](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/database.py): `AssetLibrary/Backend_py/database.py`
- **PostgreSQL**
- [Key encryption](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/API_Encyption.py): `AssetLibrary/Backend_py/API_Encyption.py`

### AI selection

- [Closet agent](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/LLM_py/agent.py): `AssetLibrary/Backend_py/LLM_py/agent.py`
- [Request guardrails](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/LLM_py/guardrails.py): `AssetLibrary/Backend_py/LLM_py/guardrails.py`
- [Sketch analysis](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/LLM_py/sketch.py): `AssetLibrary/Backend_py/LLM_py/sketch.py`
- [Agent schemas](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/schemas.py): `AssetLibrary/Backend_py/schemas.py`

### Viewport and export

- [3D viewport](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/QT/src/ViewportItem.cpp): `QT/src/ViewportItem.cpp`
- [OpenGL renderer](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/src/Model.cpp): `AssetLibrary/src/Model.cpp`
- [Camera controls](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/src/Camera.cpp): `AssetLibrary/src/Camera.cpp`
- [Model exporter](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/QT/src/ModelExporter.cpp): `QT/src/ModelExporter.cpp`

### Blender integration

- [Blender link](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/QT/src/BlenderLink.cpp): `QT/src/BlenderLink.cpp`
- [Blender add-on](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/blender_plugin/asset_library/__init__.py): `AssetLibrary/Backend_py/blender_plugin/asset_library/__init__.py`
- [Plugin downloader](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/blender_plugin/asset_library/client.py): `AssetLibrary/Backend_py/blender_plugin/asset_library/client.py`
- [Blender importer](https://github.com/hannahlowery/3d-llm-asset-library/blob/main/AssetLibrary/Backend_py/blender_plugin/asset_library/importer.py): `AssetLibrary/Backend_py/blender_plugin/asset_library/importer.py`

### Other components

- **User**
- **OpenRouter LLM**

## Connections

- User → Qt app: uses (evidence: `README.md`)
- Qt app → HTTP client: starts backend (evidence: `README.md`)
- Closet manager → HTTP client: requests catalog (evidence: `QT/src/AssetStore.cpp`)
- HTTP client → FastAPI routes: HTTP requests (evidence: `README.md`)
- FastAPI routes → Catalog queries: routes catalog calls (evidence: `AssetLibrary/Backend_py/main.py`)
- Catalog queries → PostgreSQL: reads and writes (evidence: `README.md`)
- FastAPI routes → Closet agent: dispatches commands (evidence: `AssetLibrary/Backend_py/main.py`)
- FastAPI routes → Sketch analysis: describes strokes (evidence: `AssetLibrary/Backend_py/main.py`)
- Closet agent → Catalog queries: builds catalog (evidence: `AssetLibrary/Backend_py/LLM_py/agent.py`)
- Closet agent → Request guardrails: checks requests (evidence: `AssetLibrary/Backend_py/LLM_py/agent.py`)
- Closet agent → Agent schemas: validates decisions (evidence: `AssetLibrary/Backend_py/LLM_py/agent.py`)
- Closet agent → Key encryption: loads key (evidence: `AssetLibrary/Backend_py/LLM_py/agent.py`)
- Closet agent → OpenRouter LLM: sends prompt (evidence: `AssetLibrary/Backend_py/LLM_py/agent.py`)
- HTTP client → Closet manager: returns selections
- Closet manager → 3D viewport: updates outfit (evidence: `README.md`)
- 3D viewport → OpenGL renderer: renders scene (evidence: `README.md`)
- 3D viewport → Camera controls: controls view
- Closet manager → Model exporter: exports outfit (evidence: `README.md`)
- Closet manager → Blender link: sends outfit (evidence: `README.md`)
- Blender link → Blender add-on: connects add-on (evidence: `README.md`)
- Blender add-on → Plugin downloader: downloads files (evidence: `AssetLibrary/Backend_py/blender_plugin/asset_library/__init__.py`)
- Blender add-on → Blender importer: imports models (evidence: `AssetLibrary/Backend_py/blender_plugin/asset_library/__init__.py`)
- Plugin downloader → FastAPI routes: fetches model files (evidence: `AssetLibrary/Backend_py/blender_plugin/asset_library/client.py`)
