# xiao-villamor/printstash architecture

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

- Interactive diagram: https://gitdiagram.com/xiao-villamor/printstash
- Repository: https://github.com/xiao-villamor/printstash

## Overview

PrintStash is a self-hosted 3D-printing library and printer-management web app. The main user journey is to upload or capture design files, review pending imports, organize Models, inspect previews, and optionally send a print and retain its result. The map also includes documented search, multipart projects, external library sources, and backup capabilities. Relationships are limited to README-documented workflows and the sampled storage and preview implementation; unsampled subsystems are represented at their exact enclosing directories, without asserting internal call paths.

Main entry points: [`backend/app/modules/media/thumbnail_engine.py`](https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/media/thumbnail_engine.py) (Mesh Preview), [`backend/app/modules/ingestion`](https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/ingestion) (Import and Inbox), [`backend/app/modules/library`](https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/library) (Models and Collections), [`backend/app/api/v1/storage_connections.py`](https://github.com/xiao-villamor/printstash/blob/main/backend/app/api/v1/storage_connections.py) (Storage Connections API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_imports["Import and Sources"]
  node_capture["Browser Capture<br/>[popup.ts]"]
  node_ingestion["Import and Inbox"]
  node_sources["Library Sources"]
end

subgraph group_library["Library and Discovery"]
  node_model["Models and Collections"]
  node_multipart["Multipart Projects"]
  node_search["Search and Views"]
end

subgraph group_media["Preview and Media"]
  node_preview["Mesh Preview"]
  node_stl_reader["STL Reader<br/>[stl_reader.py]"]
  node_mesh_render["Mesh Renderer<br/>[mesh_render.py]"]
end

subgraph group_printing["Printing"]
  node_printing_ops["Printer Fleet"]
end

subgraph group_platform["Storage and Operations"]
  node_external_storage["Remote Storage"]
  node_storage_api["Storage Connections API"]
  node_storage_contract["Storage Backends<br/>[contracts.py]"]
  node_storage_ops["Storage Operations"]
  node_storage_records[("Storage Records<br/>[storage.py]")]
  node_backups["Backups"]
  node_identity["Access and Sharing"]
end

node_user(("User"))

node_user -->|"uploads files"| node_ingestion
node_user -->|"captures models"| node_capture
node_capture -->|"submits captures"| node_ingestion
node_user -->|"connects sources"| node_sources
node_ingestion -->|"imports models"| node_model
node_sources -->|"indexes files"| node_model
node_user -->|"organizes library"| node_model
node_user -->|"groups models"| node_multipart
node_user -->|"searches library"| node_search
node_user -->|"inspects files"| node_preview
node_preview -->|"reads STL"| node_stl_reader
node_preview -->|"renders mesh"| node_mesh_render
node_user -->|"manages prints"| node_printing_ops
node_user -->|"configures storage"| node_external_storage
node_storage_api -->|"reads and writes"| node_storage_records
node_storage_api -->|"resolves providers"| node_external_storage
node_storage_ops -->|"uses backend contract"| node_storage_contract
node_user -->|"protects library"| node_backups
node_user -->|"shares and controls access"| node_identity

click node_capture "https://github.com/xiao-villamor/printstash/blob/main/browser-extension/popup.ts"
click node_ingestion "https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/ingestion"
click node_sources "https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/sources"
click node_model "https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/library"
click node_multipart "https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/library/multipart_models.py"
click node_search "https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/search"
click node_preview "https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/media/thumbnail_engine.py"
click node_stl_reader "https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/media/stl_reader.py"
click node_mesh_render "https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/media/mesh_render.py"
click node_printing_ops "https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/printing"
click node_external_storage "https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/storage/storage_providers.py"
click node_storage_api "https://github.com/xiao-villamor/printstash/blob/main/backend/app/api/v1/storage_connections.py"
click node_storage_contract "https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/storage/storage_backend/contracts.py"
click node_storage_ops "https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/storage/storage_operations.py"
click node_storage_records "https://github.com/xiao-villamor/printstash/blob/main/backend/app/db/models/storage.py"
click node_backups "https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/backups"
click node_identity "https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/identity"

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_capture,node_ingestion,node_sources,node_user toneBlue
class node_model,node_multipart,node_search toneAmber
class node_preview,node_stl_reader,node_mesh_render toneMint
class node_printing_ops toneRose
class node_external_storage,node_storage_api,node_storage_contract,node_storage_ops,node_storage_records,node_backups,node_identity toneIndigo
```

## Components

### Import and Sources

- [Browser Capture](https://github.com/xiao-villamor/printstash/blob/main/browser-extension/popup.ts): `browser-extension/popup.ts`
- [Import and Inbox](https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/ingestion): `backend/app/modules/ingestion`
- [Library Sources](https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/sources): `backend/app/modules/sources`

### Library and Discovery

- [Models and Collections](https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/library): `backend/app/modules/library`
- [Multipart Projects](https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/library/multipart_models.py): `backend/app/modules/library/multipart_models.py`
- [Search and Views](https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/search): `backend/app/modules/search`

### Preview and Media

- [Mesh Preview](https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/media/thumbnail_engine.py): `backend/app/modules/media/thumbnail_engine.py`
- [STL Reader](https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/media/stl_reader.py): `backend/app/modules/media/stl_reader.py`
- [Mesh Renderer](https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/media/mesh_render.py): `backend/app/modules/media/mesh_render.py`

### Printing

- [Printer Fleet](https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/printing): `backend/app/modules/printing`

### Storage and Operations

- [Remote Storage](https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/storage/storage_providers.py): `backend/app/modules/storage/storage_providers.py`
- [Storage Connections API](https://github.com/xiao-villamor/printstash/blob/main/backend/app/api/v1/storage_connections.py): `backend/app/api/v1/storage_connections.py`
- [Storage Backends](https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/storage/storage_backend/contracts.py): `backend/app/modules/storage/storage_backend/contracts.py`
- [Storage Operations](https://github.com/xiao-villamor/printstash/blob/main/backend/app/modules/storage/storage_operations.py): `backend/app/modules/storage/storage_operations.py`
- [Storage Records](https://github.com/xiao-villamor/printstash/blob/main/backend/app/db/models/storage.py): `backend/app/db/models/storage.py`
- [Backups](https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/backups): `backend/app/modules/backups`
- [Access and Sharing](https://github.com/xiao-villamor/printstash/tree/main/backend/app/modules/identity): `backend/app/modules/identity`

### Other components

- **User**

## Connections

- User → Import and Inbox: uploads files
- User → Browser Capture: captures models
- Browser Capture → Import and Inbox: submits captures
- User → Library Sources: connects sources
- Import and Inbox → Models and Collections: imports models
- Library Sources → Models and Collections: indexes files
- User → Models and Collections: organizes library
- User → Multipart Projects: groups models
- User → Search and Views: searches library
- User → Mesh Preview: inspects files
- Mesh Preview → STL Reader: reads STL (evidence: `backend/app/modules/media/thumbnail_engine.py`)
- Mesh Preview → Mesh Renderer: renders mesh (evidence: `backend/app/modules/media/thumbnail_engine.py`)
- User → Printer Fleet: manages prints
- User → Remote Storage: configures storage
- Storage Connections API → Storage Records: reads and writes (evidence: `backend/app/api/v1/storage_connections.py`)
- Storage Connections API → Remote Storage: resolves providers (evidence: `backend/app/api/v1/storage_connections.py`)
- Storage Operations → Storage Backends: uses backend contract (evidence: `backend/app/modules/storage/storage_operations.py`)
- User → Backups: protects library
- User → Access and Sharing: shares and controls access
