Self-hosted filament inventory & Bambu Lab printer control for iPhone
No cloud subscription. No vendor lock-in. Your data stays on your hardware.
- โจ Features
- โ๏ธ Requirements
- ๐ Setup
- ๐ Updating the Server
- ๐ ๏ธ Troubleshooting
- ๐งฐ Tech Stack
- ๐ Project Structure
- ๐ License
- ๐ท Barcode scanning โ camera scan auto-fills brand, SKU, colour, and fetches a spool image
- ๐งต Full spool tracking โ brand, type (PLA / PETG / ABS / TPU / ASA / PA / PC / โฆ), colour, weight, price, notes
- ๐จ Colour picker โ preset swatches + full colour wheel with hex display
- ๐ Filter & search โ by brand, colour, type, or stock status (In Stock / Low / Empty)
- ๐ผ๏ธ Spool images โ auto-fetched and mirrored to your server for offline use
- ๐ Restock detection โ scanning a duplicate SKU prompts a restock instead of adding a duplicate
- ๐ Two weight update methods โ enter grams directly, or measure the gap from the spool rim to estimate remaining weight
- ๐ถ Cost per print โ automatically calculated from price-per-gram ร grams used
- ๐ Price history โ log and chart price changes per filament over time
- ๐ฐ Spend analytics โ total spend, cost per gram, cost per print
- ๐ Log print jobs โ name, duration, grams used, success/fail, multi-filament support
- โก Auto weight deduction โ remaining weight updated automatically on save
- ๐ Print history per spool โ full job list with weight, cost, and duration
- ๐ Global print log โ all jobs across all spools in one view, with total weight used, filament length, and total cost
- ๐ก Live printer status โ progress bar, layer count, elapsed time, finish time, temperatures
โถ๏ธ Start prints remotely โ browse your printer's SD card and USB drive, tap any.3mffile to start- โธ๏ธ Pause / Resume / Stop โ full in-app print control
- ๐ก๏ธ Temperature control โ tap nozzle or bed tile to set a target temperature
- ๐ก Chamber light toggle โ turn the LED on/off from the dashboard
- ๐ AMS slot mapping โ map AMS 2 Pro slots to spools for automatic weight deduction
- ๐ฅ๏ธ Multi-printer support โ add multiple printer profiles, switch between them instantly
- ๐พ SD card browser โ navigate the full directory tree on your printer's internal storage
- ๐๏ธ Multi-select delete โ long press a file to get a context menu; select multiple files and delete in bulk
- ๐ฌ Timelapse viewer โ browse, stream full-screen, save to Photos, or delete recordings
- ๐ Customisable cards โ drag to reorder, show/hide sections
- ๐ Stats cards โ total spools (by kg), weight remaining, low stock count, total spend
- ๐ Charts โ filament type breakdown, spend by brand, price trends
- ๐ Shopping list โ auto-generated from low-stock spools
- ๐ธ Live camera feed โ MJPEG stream from your printer cam
- ๐ Recent prints โ quick glance at the latest activity
- ๐ผ Full business cost model โ filament, electricity, printer depreciation, consumables, fixed overhead
- ๐ Profit margin โ true margin as % of selling price
- ๐ข Live breakdown โ see exactly what drives each cost
- ๐พ All settings saved across app restarts
- ๐๏ธ Siri Shortcuts โ App Intents integration for inventory queries
- ๐ค Export / Import โ full JSON backup of filaments and print jobs via share sheet
- ๐ Push notifications โ alert when any spool drops below your low-stock threshold
- ๐ช Liquid Glass UI โ iOS 26 native design, graceful fallback on iOS 16โ25
- ๐ช๐บ European number formatting โ dot thousands separator, comma decimal separator
- Any machine that can run Docker (Synology NAS, Raspberry Pi, home server, VPS, etc.)
- Docker + Docker Compose installed
- A Bambu Lab printer on your local network (X1 / P1 / A1 series with LAN mode enabled)
- iPhone running iOS 16.0 or later
- A way to install unsigned IPAs: Signulous (recommended) or Sideloadly
1. Clone the repo on your server
git clone https://github.com/PanSketo/PrintHub-iOS-app.git
cd PrintHub-iOS-app2. Create your environment file
cp NAS-Backend/.env.example .envEdit .env and fill in your values:
API_KEY=your_long_random_secret_key
PRINTER_IP=192.168.1.x
PRINTER_SERIAL=XXXXXXXXXXXXXXXX
PRINTER_ACCESS_CODE=XXXXXXXX
BASE_URL=http://your-server-ip:3456| Variable | Description |
|---|---|
API_KEY |
Any strong random string โ you'll enter this in the app |
PRINTER_IP |
Your Bambu printer's local IP address |
PRINTER_SERIAL |
Shown on the printer screen under Settings โ Device |
PRINTER_ACCESS_CODE |
Shown on the printer screen under Settings โ Network |
BASE_URL |
Your server's address (local IP or DDNS hostname) |
3. Start the containers
sudo docker-compose up -d
sudo docker-compose logs --tail=20A successful start shows:
๐จ๏ธ PrintHub Backend running on port 3456
๐ Database: /data/filaments.db
๐ API Key configured: YES โ
4. Verify it's working
Open http://YOUR_SERVER_IP:3456/api/health in a browser โ it should return {"status":"ok",...}.
5. Remote access (optional)
Forward port 3456 on your router to your server's local IP. Use a DDNS hostname for a stable remote URL.
No Mac required โ use GitHub Actions (free).
- Fork this repo to your GitHub account
- Go to Actions โ Build PrintHub IPA โ Run workflow โ Run workflow
- Wait ~10 minutes
- Download
PrintHub.ipafrom the Artifacts section when the build goes green โ
Signulous (recommended โ no expiry, no re-signing)
- Upload the
.ipato signulous.com - Install directly to your iPhone
Sideloadly (free, requires re-signing every 7 days with a free Apple ID)
- Download Sideloadly on your Mac or PC
- Connect your iPhone, drag the
.ipain, sign with your Apple ID - On iPhone: Settings โ General โ VPN & Device Management โ trust your Apple ID
- Open PrintHub on your iPhone
- Enter your Server URL and API Key when prompted
- Tap Test Connection โ โ
- Tap Continue โ you're in!
To add more printers later: Settings โ Printers โ Add Printer
cd /volume2/docker/filament-backend
git pull origin main
sudo docker-compose down && sudo docker-compose up -dโ Cannot connect to server
- Check the container is running:
sudo docker-compose ps - Test locally first:
http://YOUR_SERVER_IP:3456/api/health - Make sure port
3456isn't blocked by a firewall
โ Print files tab shows an error
- Verify
PRINTER_IPandPRINTER_ACCESS_CODEin your.env - The printer must be powered on and on the same network as the server
- LAN mode must be enabled on the printer
โ Timelapse list is empty
- Timelapses only appear after the first timelapse is recorded
- Enable timelapse recording in Bambu Studio or Bambu Handy before starting a print
โ GitHub Actions build fails
- Check the Actions log for the specific error
- Most common cause: Xcode version โ the workflow auto-selects the latest available
โ Barcode scanning not working
- Go to iPhone Settings โ PrintHub โ Camera โ Allow
โ No push notifications
- Go to iPhone Settings โ PrintHub โ Notifications โ Allow All
| Layer | Technology |
|---|---|
| ๐ฑ iOS app | Swift + SwiftUI + AVKit + Photos + App Intents |
| ๐ข Minimum iOS | 16.0 |
| ๐ฅ๏ธ Backend | Node.js + Express + SQLite (better-sqlite3) |
| ๐ก Printer communication | MQTT over TLS + implicit FTPS port 990 |
| ๐ MQTT bridge | Node.js Docker sidecar |
| ๐ Barcode lookup | UPC Item DB + Open Food Facts |
| โ๏ธ CI/CD | GitHub Actions |
PrintHub-iOS-app/
โโโ ๐ฑ iOS/
โ โโโ FilamentInventory/
โ โโโ Models/ # Data models
โ โโโ Services/ # NAS API client, inventory store, notifications
โ โโโ Intents/ # Siri Shortcuts
โ โโโ Extensions/ # Shared utilities (number formatting, etc.)
โ โโโ Views/ # All SwiftUI views
โโโ ๐ฅ๏ธ NAS-Backend/
โ โโโ server.js # Express REST API + SQLite + FTP proxy
โ โโโ docker-compose.yml # Docker setup
โ โโโ .env.example # Environment variable template
โ โโโ mqtt-bridge/
โ โโโ bridge.js # Bambu Lab MQTT โ server bridge
โโโ โ๏ธ .github/workflows/
โโโ build-ipa.yml # GitHub Actions IPA builder
MIT โ use it, fork it, adapt it for your own setup.
Built with โค๏ธ by Pantelis Tzelesis