# heygenstein/3dprinterinventory architecture

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

- Interactive diagram: https://gitdiagram.com/heygenstein/3dprinterinventory
- Repository: https://github.com/heygenstein/3dprinterinventory

## Overview

Print Inventory is a Windows desktop app for tracking filament, physical spools, 3D models, printers, and print attempts. Users manage inventory and models, record print jobs, and review remaining stock, costs, and print statistics in the main window. The central business stages are spool balance and archive rules, print-job recording, and dashboard aggregation, backed by SQLite. The README documents the broader UI capabilities; source-index references support the sampled component relationships, but unsampled implementation details are not inferred.

Main entry points: [`PrintInventory/Data/AppDbContext.cs`](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/AppDbContext.cs) (EF Core context), [`PrintInventory/Services/PrintJobService.cs`](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Services/PrintJobService.cs) (Print-job rules), [`PrintInventory/Forms/MainForm.cs`](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Forms/MainForm.cs) (Main window), [`PrintInventory/Forms/ManagePanel.cs`](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Forms/ManagePanel.cs) (Management drawer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Application startup"]
  node_program["App startup<br/>[Program.cs]"]
end

subgraph group_ui["Desktop interface"]
  node_main["Main window<br/>[MainForm.cs]"]
  node_manage["Management drawer<br/>[ManagePanel.cs]"]
  node_spooldetail["Spool detail"]
  node_jobform["Print editor"]
  node_modelform["Model editor<br/>[ModelEditForm.cs]"]
end

subgraph group_business["Inventory and print services"]
  node_image["Image storage"]
  node_spoolservice["Spool rules<br/>[SpoolService.cs]"]
  node_jobservice["Print-job rules<br/>[PrintJobService.cs]"]
  node_dashboard["Dashboard metrics"]
end

subgraph group_data["Domain and persistence"]
  node_context["EF Core context<br/>[AppDbContext.cs]"]
  node_sqlite[("SQLite database")]
  node_spool["Spools<br/>[Spool.cs]"]
  node_filament["Filament types<br/>[Filament.cs]"]
  node_job["Print attempts<br/>[PrintJob.cs]"]
  node_model["Print models<br/>[PrintModel.cs]"]
  node_printer["Printers<br/>[Printer.cs]"]
  node_paths["App data paths<br/>[AppPaths.cs]"]
end

node_user(("User"))

node_user -->|"starts"| node_program
node_program -->|"migrates database"| node_context
node_program -->|"opens"| node_main
node_context -->|"configures file path"| node_paths
node_context -->|"uses"| node_sqlite
node_main -->|"requests metrics"| node_dashboard
node_main -->|"uses"| node_jobservice
node_main -->|"opens drawer"| node_manage
node_main -->|"opens details"| node_spooldetail
node_manage -->|"uses"| node_spoolservice
node_manage -->|"uses"| node_jobservice
node_manage -->|"opens editor"| node_modelform
node_manage -->|"manages"| node_filament
node_spooldetail -->|"adjusts stock"| node_spoolservice
node_spooldetail -->|"uses"| node_jobservice
node_jobform -->|"records job"| node_jobservice
node_modelform -->|"stores preview"| node_image
node_image -->|"uses app paths"| node_paths
node_spoolservice -->|"reads and updates"| node_context
node_jobservice -->|"uses stock rules"| node_spoolservice
node_jobservice -->|"reads and saves"| node_context
node_dashboard -->|"uses stock rules"| node_spoolservice
node_dashboard -->|"queries data"| node_context
node_context -->|"maps"| node_spool
node_context -->|"maps"| node_filament
node_context -->|"maps"| node_job
node_context -->|"maps"| node_model
node_context -->|"maps"| node_printer

click node_program "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Program.cs"
click node_main "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Forms/MainForm.cs"
click node_manage "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Forms/ManagePanel.cs"
click node_spooldetail "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Forms/SpoolDetailPanel.cs"
click node_jobform "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Forms/PrintJobEditForm.cs"
click node_modelform "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Forms/ModelEditForm.cs"
click node_image "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Services/ImageStorageService.cs"
click node_spoolservice "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Services/SpoolService.cs"
click node_jobservice "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Services/PrintJobService.cs"
click node_dashboard "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Services/DashboardService.cs"
click node_context "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/AppDbContext.cs"
click node_spool "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/Spool.cs"
click node_filament "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/Filament.cs"
click node_job "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/PrintJob.cs"
click node_model "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/PrintModel.cs"
click node_printer "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/Printer.cs"
click node_paths "https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/AppPaths.cs"

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_program,node_user toneBlue
class node_main,node_manage,node_spooldetail,node_jobform,node_modelform toneAmber
class node_image,node_spoolservice,node_jobservice,node_dashboard toneMint
class node_context,node_sqlite,node_spool,node_filament,node_job,node_model,node_printer,node_paths toneRose
```

## Components

### Application startup

- [App startup](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Program.cs): `PrintInventory/Program.cs`

### Desktop interface

- [Main window](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Forms/MainForm.cs): `PrintInventory/Forms/MainForm.cs`
- [Management drawer](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Forms/ManagePanel.cs): `PrintInventory/Forms/ManagePanel.cs`
- [Spool detail](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Forms/SpoolDetailPanel.cs): `PrintInventory/Forms/SpoolDetailPanel.cs`
- [Print editor](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Forms/PrintJobEditForm.cs): `PrintInventory/Forms/PrintJobEditForm.cs`
- [Model editor](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Forms/ModelEditForm.cs): `PrintInventory/Forms/ModelEditForm.cs`

### Inventory and print services

- [Image storage](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Services/ImageStorageService.cs): `PrintInventory/Services/ImageStorageService.cs`
- [Spool rules](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Services/SpoolService.cs): `PrintInventory/Services/SpoolService.cs`
- [Print-job rules](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Services/PrintJobService.cs): `PrintInventory/Services/PrintJobService.cs`
- [Dashboard metrics](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Services/DashboardService.cs): `PrintInventory/Services/DashboardService.cs`

### Domain and persistence

- [EF Core context](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/AppDbContext.cs): `PrintInventory/Data/AppDbContext.cs`
- **SQLite database**
- [Spools](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/Spool.cs): `PrintInventory/Data/Spool.cs`
- [Filament types](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/Filament.cs): `PrintInventory/Data/Filament.cs`
- [Print attempts](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/PrintJob.cs): `PrintInventory/Data/PrintJob.cs`
- [Print models](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/PrintModel.cs): `PrintInventory/Data/PrintModel.cs`
- [Printers](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/Printer.cs): `PrintInventory/Data/Printer.cs`
- [App data paths](https://github.com/heygenstein/3dprinterinventory/blob/main/PrintInventory/Data/AppPaths.cs): `PrintInventory/Data/AppPaths.cs`

### Other components

- **User**

## Connections

- User → App startup: starts (evidence: `README.md`)
- App startup → EF Core context: migrates database (evidence: `PrintInventory/Program.cs`)
- App startup → Main window: opens (evidence: `PrintInventory/Program.cs`)
- EF Core context → App data paths: configures file path (evidence: `PrintInventory/Data/AppDbContext.cs`)
- EF Core context → SQLite database: uses (evidence: `PrintInventory/Data/AppDbContext.cs`)
- Main window → Dashboard metrics: requests metrics (evidence: `PrintInventory/Forms/MainForm.cs`)
- Main window → Print-job rules: uses (evidence: `PrintInventory/Forms/MainForm.cs`)
- Main window → Management drawer: opens drawer (evidence: `PrintInventory/Forms/MainForm.cs`)
- Main window → Spool detail: opens details (evidence: `PrintInventory/Forms/MainForm.cs`)
- Management drawer → Spool rules: uses (evidence: `PrintInventory/Forms/ManagePanel.cs`)
- Management drawer → Print-job rules: uses (evidence: `PrintInventory/Forms/ManagePanel.cs`)
- Management drawer → Model editor: opens editor (evidence: `PrintInventory/Forms/ManagePanel.cs`)
- Management drawer → Filament types: manages (evidence: `PrintInventory/Forms/ManagePanel.cs`)
- Spool detail → Spool rules: adjusts stock (evidence: `PrintInventory/Forms/SpoolDetailPanel.cs`)
- Spool detail → Print-job rules: uses (evidence: `PrintInventory/Forms/SpoolDetailPanel.cs`)
- Print editor → Print-job rules: records job (evidence: `PrintInventory/Forms/PrintJobEditForm.cs`)
- Model editor → Image storage: stores preview (evidence: `PrintInventory/Forms/ModelEditForm.cs`)
- Image storage → App data paths: uses app paths (evidence: `PrintInventory/Services/ImageStorageService.cs`)
- Spool rules → EF Core context: reads and updates (evidence: `PrintInventory/Services/SpoolService.cs`)
- Print-job rules → Spool rules: uses stock rules (evidence: `PrintInventory/Services/PrintJobService.cs`)
- Print-job rules → EF Core context: reads and saves (evidence: `PrintInventory/Services/PrintJobService.cs`)
- Dashboard metrics → Spool rules: uses stock rules (evidence: `PrintInventory/Services/DashboardService.cs`)
- Dashboard metrics → EF Core context: queries data (evidence: `PrintInventory/Services/DashboardService.cs`)
- EF Core context → Spools: maps (evidence: `PrintInventory/Data/AppDbContext.cs`)
- EF Core context → Filament types: maps (evidence: `PrintInventory/Data/AppDbContext.cs`)
- EF Core context → Print attempts: maps (evidence: `PrintInventory/Data/AppDbContext.cs`)
- EF Core context → Print models: maps (evidence: `PrintInventory/Data/AppDbContext.cs`)
- EF Core context → Printers: maps (evidence: `PrintInventory/Data/AppDbContext.cs`)
