# qvarcy/printguardian architecture

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

- Interactive diagram: https://gitdiagram.com/qvarcy/printguardian
- Repository: https://github.com/qvarcy/printguardian

## Overview

PrintGuardian is a local-first Windows desktop pre-flight tool for Bambu Studio/OrcaSlicer 3MF projects. Its main workflow opens or drops a project, inspects its archive and settings, surfaces attention points, compares it with a trusted profile, lets the user choose supported changes, then rebuilds and verifies a separate export. The graph also preserves profile/history state and the documented update capability. Relationships are based on excerpts, SOURCE INDEX references, or README statements; unsampled feature implementations are represented only at their documented subsystem level.

Main entry points: [`src/App.tsx`](https://github.com/qvarcy/printguardian/blob/main/src/App.tsx) (Application shell), [`src/lib/safeThreeMfExporter.ts`](https://github.com/qvarcy/printguardian/blob/main/src/lib/safeThreeMfExporter.ts) (Verified exporter), [`src/lib/threeMfInspector.ts`](https://github.com/qvarcy/printguardian/blob/main/src/lib/threeMfInspector.ts) (3MF inspector), [`src/components/GuidedProjectReview.tsx`](https://github.com/qvarcy/printguardian/blob/main/src/components/GuidedProjectReview.tsx) (Guided review)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Project workflow"]
  node_app["Application shell<br/>[App.tsx]"]
  node_drop["Project drop<br/>[DropZone.tsx]"]
  node_inspector["3MF inspector"]
  node_zipread["ZIP reader<br/>[zip.ts]"]
  node_settings["Settings bridge"]
  node_workspace["Project workspace"]
  node_workspaceplan["Workspace plan<br/>[workspacePlan.ts]"]
end

subgraph group_profiles["Profiles and decisions"]
  node_review["Guided review"]
  node_profilepanel["Profile comparison"]
  node_profilespanel["Saved profiles"]
  node_baseline[("Trusted baseline<br/>[baselineProfile.ts]")]
  node_profilelibrary[("Profile library<br/>[printProfiles.ts]")]
  node_diff["Profile diff<br/>[profileDiff.ts]"]
  node_decisions[("Decision plan")]
end

subgraph group_build["Safe export"]
  node_previewpanel["Build preview"]
  node_preview["Safe build preview"]
  node_exporter["Verified exporter"]
  node_zipwriter["ZIP writer<br/>[zipWriter.ts]"]
  node_output["New 3MF copy"]
end

subgraph group_state["Local state"]
  node_history[("Project history<br/>[projectHistory.ts]")]
  node_recent[("Recent project<br/>[recentProject.ts]")]
end

subgraph group_desktop["Desktop services"]
  node_updater["Update centre"]
  node_updatecenter["Update service<br/>[updateCenter.ts]"]
  node_features["Feature discovery"]
  node_runtime["Desktop runtime<br/>[desktopRuntime.ts]"]
end

node_user(("Project user"))

node_user -->|"opens or drops"| node_drop
node_drop -->|"selects project"| node_app
node_app -->|"inspects project"| node_inspector
node_inspector -->|"reads archive"| node_zipread
node_inspector -->|"captures settings"| node_settings
node_app -->|"shows inspection"| node_workspace
node_workspace -->|"persists choices"| node_workspaceplan
node_app -->|"loads history"| node_history
node_app -->|"saves recent project"| node_recent
node_app -->|"adds profile"| node_profilelibrary
node_app -->|"creates baseline"| node_baseline
node_user -->|"compares profiles"| node_profilepanel
node_profilespanel -->|"manages profiles"| node_profilelibrary
node_profilepanel -->|"shows differences"| node_diff
node_diff -->|"uses inspection data"| node_inspector
node_review -->|"saves trusted baseline"| node_baseline
node_review -->|"restores decisions"| node_decisions
node_review -->|"requests verified export"| node_exporter
node_user -->|"reviews changes"| node_previewpanel
node_previewpanel -->|"builds preview"| node_preview
node_previewpanel -->|"requests export"| node_exporter
node_preview -->|"maps setting values"| node_settings
node_exporter -->|"rebuilds archive"| node_zipwriter
node_exporter -->|"checks archives"| node_zipread
node_exporter -->|"reinspects output"| node_inspector
node_exporter -->|"produces new copy"| node_output
node_updater -->|"checks updates"| node_updatecenter
node_app -->|"discovers features"| node_features
node_features -->|"checks feature updates"| node_updatecenter
node_updater -->|"reads runtime info"| node_runtime

click node_app "https://github.com/qvarcy/printguardian/blob/main/src/App.tsx"
click node_drop "https://github.com/qvarcy/printguardian/blob/main/src/components/DropZone.tsx"
click node_inspector "https://github.com/qvarcy/printguardian/blob/main/src/lib/threeMfInspector.ts"
click node_zipread "https://github.com/qvarcy/printguardian/blob/main/src/lib/zip.ts"
click node_settings "https://github.com/qvarcy/printguardian/blob/main/src/lib/projectSettingsBridge.ts"
click node_workspace "https://github.com/qvarcy/printguardian/blob/main/src/components/ProjectWorkspace.tsx"
click node_workspaceplan "https://github.com/qvarcy/printguardian/blob/main/src/lib/workspacePlan.ts"
click node_review "https://github.com/qvarcy/printguardian/blob/main/src/components/GuidedProjectReview.tsx"
click node_profilepanel "https://github.com/qvarcy/printguardian/blob/main/src/components/ProfileDiffPanel.tsx"
click node_profilespanel "https://github.com/qvarcy/printguardian/blob/main/src/components/PrintProfilesPanel.tsx"
click node_baseline "https://github.com/qvarcy/printguardian/blob/main/src/lib/baselineProfile.ts"
click node_profilelibrary "https://github.com/qvarcy/printguardian/blob/main/src/lib/printProfiles.ts"
click node_diff "https://github.com/qvarcy/printguardian/blob/main/src/lib/profileDiff.ts"
click node_decisions "https://github.com/qvarcy/printguardian/blob/main/src/lib/profileDecisionPlan.ts"
click node_previewpanel "https://github.com/qvarcy/printguardian/blob/main/src/components/SafeBuildPreviewPanel.tsx"
click node_preview "https://github.com/qvarcy/printguardian/blob/main/src/lib/safeThreeMfBuildPreview.ts"
click node_exporter "https://github.com/qvarcy/printguardian/blob/main/src/lib/safeThreeMfExporter.ts"
click node_zipwriter "https://github.com/qvarcy/printguardian/blob/main/src/lib/zipWriter.ts"
click node_history "https://github.com/qvarcy/printguardian/blob/main/src/lib/projectHistory.ts"
click node_recent "https://github.com/qvarcy/printguardian/blob/main/src/lib/recentProject.ts"
click node_updater "https://github.com/qvarcy/printguardian/blob/main/src/components/UpdateCentreButton.tsx"
click node_updatecenter "https://github.com/qvarcy/printguardian/blob/main/src/lib/updateCenter.ts"
click node_features "https://github.com/qvarcy/printguardian/blob/main/src/lib/featureDiscovery.ts"
click node_runtime "https://github.com/qvarcy/printguardian/blob/main/src/lib/desktopRuntime.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_app,node_drop,node_inspector,node_zipread,node_settings,node_workspace,node_workspaceplan,node_user toneBlue
class node_review,node_profilepanel,node_profilespanel,node_baseline,node_profilelibrary,node_diff,node_decisions toneAmber
class node_previewpanel,node_preview,node_exporter,node_zipwriter,node_output toneMint
class node_history,node_recent toneRose
class node_updater,node_updatecenter,node_features,node_runtime toneIndigo
```

## Components

### Project workflow

- [Application shell](https://github.com/qvarcy/printguardian/blob/main/src/App.tsx): `src/App.tsx`
- [Project drop](https://github.com/qvarcy/printguardian/blob/main/src/components/DropZone.tsx): `src/components/DropZone.tsx`
- [3MF inspector](https://github.com/qvarcy/printguardian/blob/main/src/lib/threeMfInspector.ts): `src/lib/threeMfInspector.ts`
- [ZIP reader](https://github.com/qvarcy/printguardian/blob/main/src/lib/zip.ts): `src/lib/zip.ts`
- [Settings bridge](https://github.com/qvarcy/printguardian/blob/main/src/lib/projectSettingsBridge.ts): `src/lib/projectSettingsBridge.ts`
- [Project workspace](https://github.com/qvarcy/printguardian/blob/main/src/components/ProjectWorkspace.tsx): `src/components/ProjectWorkspace.tsx`
- [Workspace plan](https://github.com/qvarcy/printguardian/blob/main/src/lib/workspacePlan.ts): `src/lib/workspacePlan.ts`

### Profiles and decisions

- [Guided review](https://github.com/qvarcy/printguardian/blob/main/src/components/GuidedProjectReview.tsx): `src/components/GuidedProjectReview.tsx`
- [Profile comparison](https://github.com/qvarcy/printguardian/blob/main/src/components/ProfileDiffPanel.tsx): `src/components/ProfileDiffPanel.tsx`
- [Saved profiles](https://github.com/qvarcy/printguardian/blob/main/src/components/PrintProfilesPanel.tsx): `src/components/PrintProfilesPanel.tsx`
- [Trusted baseline](https://github.com/qvarcy/printguardian/blob/main/src/lib/baselineProfile.ts): `src/lib/baselineProfile.ts`
- [Profile library](https://github.com/qvarcy/printguardian/blob/main/src/lib/printProfiles.ts): `src/lib/printProfiles.ts`
- [Profile diff](https://github.com/qvarcy/printguardian/blob/main/src/lib/profileDiff.ts): `src/lib/profileDiff.ts`
- [Decision plan](https://github.com/qvarcy/printguardian/blob/main/src/lib/profileDecisionPlan.ts): `src/lib/profileDecisionPlan.ts`

### Safe export

- [Build preview](https://github.com/qvarcy/printguardian/blob/main/src/components/SafeBuildPreviewPanel.tsx): `src/components/SafeBuildPreviewPanel.tsx`
- [Safe build preview](https://github.com/qvarcy/printguardian/blob/main/src/lib/safeThreeMfBuildPreview.ts): `src/lib/safeThreeMfBuildPreview.ts`
- [Verified exporter](https://github.com/qvarcy/printguardian/blob/main/src/lib/safeThreeMfExporter.ts): `src/lib/safeThreeMfExporter.ts`
- [ZIP writer](https://github.com/qvarcy/printguardian/blob/main/src/lib/zipWriter.ts): `src/lib/zipWriter.ts`
- **New 3MF copy**

### Local state

- [Project history](https://github.com/qvarcy/printguardian/blob/main/src/lib/projectHistory.ts): `src/lib/projectHistory.ts`
- [Recent project](https://github.com/qvarcy/printguardian/blob/main/src/lib/recentProject.ts): `src/lib/recentProject.ts`

### Desktop services

- [Update centre](https://github.com/qvarcy/printguardian/blob/main/src/components/UpdateCentreButton.tsx): `src/components/UpdateCentreButton.tsx`
- [Update service](https://github.com/qvarcy/printguardian/blob/main/src/lib/updateCenter.ts): `src/lib/updateCenter.ts`
- [Feature discovery](https://github.com/qvarcy/printguardian/blob/main/src/lib/featureDiscovery.ts): `src/lib/featureDiscovery.ts`
- [Desktop runtime](https://github.com/qvarcy/printguardian/blob/main/src/lib/desktopRuntime.ts): `src/lib/desktopRuntime.ts`

### Other components

- **Project user**

## Connections

- Project user → Project drop: opens or drops
- Project drop → Application shell: selects project (evidence: `src/App.tsx`)
- Application shell → 3MF inspector: inspects project (evidence: `src/App.tsx`)
- 3MF inspector → ZIP reader: reads archive (evidence: `src/lib/threeMfInspector.ts`)
- 3MF inspector → Settings bridge: captures settings (evidence: `src/lib/threeMfInspector.ts`)
- Application shell → Project workspace: shows inspection (evidence: `src/App.tsx`)
- Project workspace → Workspace plan: persists choices (evidence: `src/components/ProjectWorkspace.tsx`)
- Application shell → Project history: loads history (evidence: `src/App.tsx`)
- Application shell → Recent project: saves recent project (evidence: `src/App.tsx`)
- Application shell → Profile library: adds profile (evidence: `src/App.tsx`)
- Application shell → Trusted baseline: creates baseline (evidence: `src/App.tsx`)
- Project user → Profile comparison: compares profiles
- Saved profiles → Profile library: manages profiles (evidence: `src/components/PrintProfilesPanel.tsx`)
- Profile comparison → Profile diff: shows differences (evidence: `src/components/ProfileDiffPanel.tsx`)
- Profile diff → 3MF inspector: uses inspection data (evidence: `src/lib/profileDiff.ts`)
- Guided review → Trusted baseline: saves trusted baseline (evidence: `src/components/GuidedProjectReview.tsx`)
- Guided review → Decision plan: restores decisions (evidence: `src/components/GuidedProjectReview.tsx`)
- Guided review → Verified exporter: requests verified export (evidence: `src/components/GuidedProjectReview.tsx`)
- Project user → Build preview: reviews changes
- Build preview → Safe build preview: builds preview (evidence: `src/components/SafeBuildPreviewPanel.tsx`)
- Build preview → Verified exporter: requests export (evidence: `src/components/SafeBuildPreviewPanel.tsx`)
- Safe build preview → Settings bridge: maps setting values (evidence: `src/lib/safeThreeMfBuildPreview.ts`)
- Verified exporter → ZIP writer: rebuilds archive (evidence: `src/lib/safeThreeMfExporter.ts`)
- Verified exporter → ZIP reader: checks archives (evidence: `src/lib/safeThreeMfExporter.ts`)
- Verified exporter → 3MF inspector: reinspects output (evidence: `src/lib/safeThreeMfExporter.ts`)
- Verified exporter → New 3MF copy: produces new copy
- Update centre → Update service: checks updates (evidence: `src/components/UpdateCentreButton.tsx`)
- Application shell → Feature discovery: discovers features (evidence: `src/App.tsx`)
- Feature discovery → Update service: checks feature updates (evidence: `src/lib/featureDiscovery.ts`)
- Update centre → Desktop runtime: reads runtime info (evidence: `src/components/UpdateCentreButton.tsx`)
