Skip to content

strongbinarycoder/printqueue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PrintQueue

A native SwiftUI dashboard for the Prusa Core One L (and other PrusaLink / Prusa Connect printers). Track a print queue, manage filament inventory, monitor live print status, and see real per-print cost and profit.

Runs on iPhone, iPad, and Mac (Mac Catalyst) from one codebase. Data syncs across your own devices via iCloud (CloudKit). There is no server - the app talks directly to your printer on your local network and to Prusa Connect's cloud API using credentials you enter on-device.

Kanban print queue Filament inventory Profit analytics from sales

Print queue, filament inventory, and profit analytics from real sales

Features

  • Kanban board - Queued / Printing / Done / Failed, with drag-and-drop and a slicer-settings summary per project.
  • Import from printer - lists the sliced files on your printer (via PrusaLink), parses name / material / layer / time from each filename, and creates project cards. Filament weight and the real filament (vendor, type, colour, cost) are read from the bgcode metadata and matched to an inventory spool (or a new one is created).
  • Auto-track active prints (optional, on by default) - when the printer starts a job that isn't on the board, it's added/promoted to Printing automatically. Filament weight backfills from the bgcode once the print finishes (the printer locks file downloads while printing).
  • Filament inventory - spool tracking with remaining weight, low-stock alerts, ~20 brand/material default profiles, OpenPrintTag NFC import, and Prusament QR import.
  • Swatch card generator - printable 40x30 mm filament labels (PDF/PNG) with a pq://spool/<id> QR that deep-links back into the app.
  • Live printer dashboard (PrusaLink) - progress, temperatures, pause / resume / stop, storage, and camera snapshots. Live RTSP stream opens in an external player (VLC); see the camera note below.
  • Prusa Connect - remote gcode upload from anywhere.
  • Cost & analytics - per-print cost from filament + electricity + labor + depreciation + failure markup, with charts.
  • Real profit from sales - import an order CSV exported from Etsy, Shopify, or Amazon. Sales match to projects by SKU (or item name), and profit is computed from actual net revenue (gross + shipping - platform fees) minus print cost per unit sold. Falls back to a manual sale price when you haven't imported sales.

Privacy & secrets (read this)

PrintQueue has no backend and stores no secrets in this repository.

  • Your PrusaLink API key, Prusa Connect API key, printer IP, RTSP camera credentials, and electricity rate are entered in the app's Settings screen at runtime.
  • They are persisted only in the app's local store (SwiftData) on your device and, if you enable iCloud, in your own private CloudKit database. They are never transmitted to any third party by this app and never committed to git.
  • The git history contains no keys, IPs, or personal data. If you fork this, keep it that way: never hardcode a key or paste one into source, an Info.plist, or a commit.

Requirements

  • Xcode 16+. iCloud sync requires the paid Apple Developer Program ($99/year) - CloudKit is not available to free accounts. To build with a free Apple ID, disable iCloud first (see step 2); note that free-account device installs also expire after 7 days and must be re-run from Xcode.
  • iOS 17+ / iPadOS 17+ / macOS 14+ (Mac Catalyst).
  • XcodeGen (brew install xcodegen) - the .xcodeproj is generated from project.yml and is intentionally gitignored.

Setup

  1. Generate the Xcode project

    xcodegen generate
    open PrintQueue.xcodeproj
  2. Set your own bundle ID and iCloud container. The repo ships with the neutral placeholder com.example.PrintQueue. You must change it to something unique tied to your Apple Developer team, in three places:

    • project.yml - options.bundleIdPrefix and PRODUCT_BUNDLE_IDENTIFIER
    • PrintQueue/PrintQueue.entitlements - the two iCloud.<...> container identifiers
    • PrintQueue/PrintQueueApp.swift - the cloudKitDatabase: .private("iCloud.<...>") argument

    Then re-run xcodegen generate. In Xcode, select your team under Signing & Capabilities.

    Free Apple ID (no paid program)? CloudKit won't sign, so you must disable iCloud: delete the com.apple.developer.icloud-* keys from PrintQueue.entitlements and remove the cloudKitDatabase: argument in PrintQueueApp.swift. The app then runs fully on a local-only store (no cross-device sync). This is also the simplest way to try it without paying.

  3. Build and run on a simulator, your device, or "My Mac (Mac Catalyst)".

  4. Connect your printer. In Settings:

    • PrusaLink (local): enter your printer's IP and the PrusaLink API key (printer LCD: Settings -> Network -> PrusaLink), then Test PrusaLink. The first connection triggers an iOS local-network permission prompt.
    • Prusa Connect (cloud, optional): enter the API key from connect.prusa3d.com for remote uploads.
    • Electricity rate: enter your own $/kWh from your utility bill, and your printer's average wattage (a Core One L is roughly 120-200 W while printing). This drives the cost and profit numbers.

Tracking real profit from sales

In Analytics → Import Sales, choose an order CSV exported from your seller dashboard (Etsy: Shop Manager → Settings → Download Data → Order Items; Shopify/Amazon export similarly). Each row matches to a project by SKU (set it in the project's edit sheet) or by item name, with a review step for anything unmatched. Profit then reflects real net revenue minus print cost. Tax is stored but excluded from profit (it's remitted, not income).

Camera / live stream

The Printer screen shows polled camera snapshots in-app (works everywhere). For the live RTSP stream, the app hands the rtsp:// URL to an external player (VLC). Embedded in-app RTSP playback is not available on Mac Catalyst - the VLCKit binary has no Catalyst slice - so the stream is opened externally rather than embedded. Snapshots remain the in-app live view.

First-run demo data

A fresh install seeds a few generic example projects and filament spools (3DBenchy, a temperature tower, a planter, etc.) so the UI isn't empty. It's just illustration - delete it and add your own. See PrintQueue/Models/Defaults.swift.

Architecture

  • SwiftData models (ProjectModel, FilamentModel, AppSettings, HistoryEntry, SaleRecord) with optional CloudKit sync.
  • Services - PrusaLinkClient (local HTTP polling + file download), PrusaConnectClient (OctoPrint-compatible cloud upload), OpenPrintTagDecoder (CBOR), BGCodeMetadata (binary gcode metadata parser for filament/grams), SalesCSV (marketplace CSV parser), FilamentMatcher, and PrinterStore (observable polling actor).
  • Views split by feature: Board, Filaments, Printer, Analytics, Settings.
  • Monospaced, dark UI theme in PrintQueue/Theme/Theme.swift.
  • Mac build uses the "Optimize for Mac" idiom (UIDeviceFamily includes 6) for native sizing rather than scaled iPad layout.

Contributing

Issues and PRs welcome. Please don't include any real API keys, printer addresses, or personal data in code, screenshots, or commits.

License

MIT.

About

Native SwiftUI dashboard for Prusa printers: kanban print queue, filament inventory, live PrusaLink status, bgcode parsing, and real profit analytics from Etsy/Shopify/Amazon sales. iPhone, iPad, Mac. No backend.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages