3D-Print-Pricing-(beta)
Docker app from Helmer's Repository
Beta (English): the development version of the app, built from its beta branch.
Overview
Bèta (Nederlands): de ontwikkelversie van de app, gebouwd vanaf de beta-branch. Hij kan onstabiel zijn en de database aanpassen op een manier die de stabiele versie niet kan lezen. Hij heeft een eigen data-map en poort, dus hij draait naast de stabiele app. Gebruik de data van de stabiele app niet voor de beta.
English: A cost price calculator and inventory for a 3D-print business: filament, parts, printer depreciation and energy, with orders, customers, invoices, Spoolman sync, the live state of Bambu Lab printers through HaspelSync, and push notifications. One container: the database is a SQLite file in the app data folder, so nothing else has to be installed. Put the app data on the cache pool or on an array disk, not on /mnt/user: SQLite does not belong on that FUSE share and can lose data there. Fill in a Setup code and a Session secret (both required). A password works on any address; passkeys only work on an https address with a domain name, so put a reverse proxy in front of it and fill in the passkey domain and addresses.
Nederlands: Een kostprijscalculator en voorraadbeheer voor een 3D-printbedrijf: filament, onderdelen, afschrijving van de printer en energie, met bestellingen, klanten, facturen, Spoolman-synchronisatie, de actuele stand van Bambu Lab-printers via HaspelSync en pushmeldingen. EΓ©n container: de database is een SQLite-bestand in de data-map, dus er hoeft niets anders geΓ―nstalleerd te worden. Zet de data-map op de cachepool of op een schijf van de array, niet op /mnt/user: SQLite hoort niet op die FUSE-share en kan daar gegevens verliezen. Vul een Instelcode en een Sessiegeheim in (beide verplicht). Een wachtwoord werkt op elk adres; passkeys werken alleen op een https-adres met een domeinnaam: zet daarvoor een reverse proxy ervoor en vul het passkey-domein en de adressen in.
Readme
View on GitHub3D Print Pricing
The self-hosted cost calculator for 3D-print businesses.
Work out what a print really costs, keep track of your filament stock, and turn customer orders into invoices: from your phone or your desk, on a server of your own.
π¬π§ English Β· π³π± Nederlands
Platform Self-hosted Home Assistant Languages Status
Last commit Commit activity Forks Stars Issues Contributors
Documentation (Dutch) Β· Release notes Β· Report a bug
Contents
- Why 3D Print Pricing?
- Features
- Screenshots
- Getting started
- Configuration
- Running it
- Data and backups
- Architecture
- Stable and beta
- Contributing
- Privacy and security
- Support 3D Print Pricing
- License
Why 3D Print Pricing?
Selling 3D prints means knowing what each one costs: filament by the gram, machine time, electricity, packaging and a fair share of the printer's purchase price. A spreadsheet gets you there, until the prices change, the stock runs out unnoticed, or a customer wants an invoice. 3D Print Pricing keeps the prices, the stock and the orders in one place that you host yourself, and works from your phone as well as your desk.
Features
- Cost price in seconds: filament, parts, accessories (cables, chargers), printer depreciation and energy add up to a cost price, with an optional margin for a recommended selling price. Every line is rounded to the cent first, so the lines on screen add up to the total, and a saved calculation keeps the prices of the moment you saved it, so changing a roll price later never rewrites your history.
- Straight from the slicer: attach a
.3mfor.stlfile. A sliced 3MF (Bambu Studio / Orca) gives the real grams per filament and the print time, which go into the calculation automatically; an STL gives a weight estimate. - Filament library: the specs of the filaments you buy (brand, type, colour, supplier filament ID, weight, diameter, temperatures, indicative price), so a new roll fills itself in. Fill it without typing (import a Bambu Lab invoice or a JSON file, add the rolls of your filament list, sync the shared library from GitHub, or contribute yours to it) and export it as JSON; an import or sync only adds and updates, never deletes, never holds the same filament twice, and leaves your stock alone.
- Filament stock with barcode scanning: your rolls with price, remaining weight, colour and temperatures, grouped per kind. Create a roll by hand, by scanning its barcode, from the library or, for Bambu Lab, from the web shop's products and colours, duplicate a roll to add one or more of the same, or add a whole delivery at once by scanning the rolls one after the other; search by name, barcode or material as you type; get a notification when a kind is nearly out, and book the usage of a calculation off the stock with one click.
- Business-ready: VAT on the selling price, a margin and a price rounding per order (to 5/10/50 cents, whole euros, or ending in ,95/,99, with your margin as the minimum), and a button to blur the costs when a customer looks over your shoulder.
- Every overview works the same: 3D models, orders, customers, filament, packaging, parts and printers are shown as tiles or as a list; you search while you type, filter, sort on a column and group rolls per kind. A 3D model keeps several links: the page of the model and the places where it is for sale (Marktplaats, Bol.com, your web shop).
- Put a model up for sale: every 3D model can have a listing: the title and text of the advertisement, your asking price (with the price the calculation advises next to it), an EAN and the photos in your order, your own or taken over from the product pictures. One click puts the title, the text and the photos ready to place an advertisement on Marktplaats, and another application reads what is for sale through the API.
- Customers, orders and invoices: customers with a customer number, orders with several prints each, a status from new to completed, and a PDF invoice with your logo, a unique invoice number and a SEPA payment QR code. Bring your own Word or PDF letterhead if you like.
- Connect your other applications: with an API key your bookkeeping or finance app reads orders, invoice details and the invoice PDF, and a sales channel reads your listings with their photos (read-only, without cost prices), and a signed webhook gives a sign as soon as you make an invoice or an order changes.
- Passkey login: no password to leak. Or a password where a passkey cannot work (an IP address on your own network), optionally with two-step verification, and recovery codes for emergencies.
- More than one person: an administrator invites people with a one-time link, and each chooses their own passkey or password, so nobody ever knows anyone else's. Regular users do the daily work; an administrator also manages users, the company details, backups and updates, and can promote a regular user to administrator.
- A real app on every device: installs on the iPhone and Android home screen and on the desktop, works with the camera and with notifications, and speaks Dutch and English.
- Your data, your server: everything runs in your own container, your data stays in one folder on your own host, and you back up and restore all of it from within the app, which also backs everything up by itself every 12 hours.
The full description of every feature is in the operations guide (Dutch).
Screenshots
Desktop
| 3D Models | Filament stock | Orders |
|---|---|---|
![]() |
![]() |
![]() |
iPhone: the iOS-style look
The floating, glass-like navigation bar. Installed on the home screen it runs full screen under the status bar.
| 3D Models | Cost price | Orders | Filament |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
Android: the Android-style look
The full-width navigation bar with a pill behind the active icon.
| 3D Models | Cost price | Orders | Filament |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
Settings and your own colour
Settings is grouped into Personal, Data and Administration, each part with an icon (what you see depends on your role). On a phone the parts form a row you swipe. Under Display you choose the language, light or dark, and your accent colour: eleven presets, bordeaux and graphite among them, or any colour of your own. The whole interface follows it, not only the buttons. On Filaments, the Spoolman and Import and share blocks fold away.
| Display: light, with the default violet | Display: dark, with teal |
|---|---|
![]() |
![]() |
| iPhone: settings | Android: settings |
|---|---|
![]() |
![]() |
Filament: library, import and new rolls
Settings β Filaments holds the filament library: add a filament, import a Bambu Lab invoice, add the rolls of your filament list, import or export the library as JSON, sync it from GitHub, or contribute your filaments to the central library through a pre-filled GitHub issue. Under Filament β New roll you create a roll, either by hand, by scanning its barcode or by picking a filament from the library. Filament β Scan adds a delivery: scan every roll (camera or barcode scanner), and the rolls with a known barcode are added in one go, each starting full.
| Library: import, export and sync | New roll |
|---|---|
![]() |
![]() |
| iPhone: library | iPhone: new roll | Android: library | Android: new roll |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
Under Settings β Display β Navigation bar, choose iOS-style or Android-style, or leave it on Automatic: the app detects the device and defaults to Android-style on Android and iOS-style elsewhere. Your choice is saved with your account and applies on all your devices. Light, dark and system themes and your own accent colour are included.
The screenshots show demo data.
Getting started
- π Web: open the address of your own installation. Passkeys need https and a domain name.
- π± iPhone / iPad and π€ Android: see Install as an app.
- π³ Self-hosted: see Installation, or as a Home Assistant app.
Install as an app
- Android (Chrome, Edge, Samsung Internet) and desktop: open the https address and choose Install app in the prompt, or under Settings β General β Install app. Long-press the icon for shortcuts (new calculation, filament).
- iPhone / iPad: open the https address in Safari β Share β Add to Home Screen. The app then starts full screen with its own icon and launch screen, without pinch-zoom or sideways swiping, like a native app.
Installation (self-hosted)
git clone https://github.com/Flux76HQ/3dprint_pricing.git
cd 3dprint_pricing
python scripts/init_env.py --port 6090 --domain print.example.com # creates .env with fresh secrets
docker compose up -d
init_env.py is the easy route; copying .env.example to .env and editing it works just as well. A server only needs docker-compose.yml and .env: the image is pulled from ghcr.io/flux76hq/3dprint_pricing. Without --domain, RP_ID and RP_ORIGINS stay empty and the app follows the address you open it on (also an IP address), enough to try it out.
Then open the address and go through the onboarding:
- Enter the setup code and your name. The setup code is the value after
SETUP_CODE=in the.envfile on your server (init_env.pyprinted it too;grep SETUP_CODE .envshows it again). Type or paste it into the Setup code field of the first screen; you only need it for this first setup, afterwards you sign in with your passkey or password. The onboarding screen explains this as well. - Choose how you sign in: create a passkey (fingerprint, face or device code), or choose a password (at least 12 characters). Where a passkey cannot work (an IP address, no https) the screen says so and the password is already open.
- Save the 8 recovery codes. They are shown once and each works once.
A password works on any address, also on your own network. For passkeys, installing, the camera and notifications put a reverse proxy with TLS in front of the app and set RP_ID and RP_ORIGINS to that domain: they only work over https (except on localhost).
Installation as a Home Assistant app
On Home Assistant OS or Supervised, add https://github.com/Flux76HQ/3dprint_pricing under Settings > Apps > Install app > Repositories and install 3D Print Pricing: the app keeps its data (one SQLite database and the uploads) in the app's folder, which Home Assistant backs up. Passkeys still need a domain with https in front of the app's port, so set rp_id on the Configuration tab for them; with a password the app also works on http://<address of Home Assistant>:6080. The steps are on the app's Documentation tab (homeassistant/DOCS.md). Runs on amd64 and aarch64 (Raspberry Pi 4/5, ARM mini PCs).
Configuration
Set in .env; .env.example documents every value. Never commit .env: it holds the secrets.
| Variable | Required | Default | Description |
|---|---|---|---|
DATA_PATH |
β | - | Host folder for all data: the database (db/, one SQLite file) and the uploaded files (uploads/). Plain folders, not Docker volumes. Must be an absolute folder of the Docker host on a local disk (e.g. /srv/printpricing, on Unraid the pool itself, /mnt/<pool>/appdata/printpricing, not /mnt/user/... unless appdata is an exclusive share: SQLite does not belong on a network share or FUSE mount), never ./data; data that ended up elsewhere is moved by scripts/migrate_data.sh |
PRINTPRICING_TAG |
β | latest |
Which build runs: latest (stable), beta (the development version) or a version number such as 0.26.15. docker-compose.yml pulls ghcr.io/flux76hq/3dprint_pricing:<tag> and passes the same value to the app, which shows a beta label next to its name on beta. Replaces APP_IMAGE |
WEB_PORT |
β | - | Port of the app; compose publishes it and the app listens on it |
POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DB |
β | - | Only for the PostgreSQL of the releases before SQLite, which the app reads once to move your data over when it starts without a SQLite file (see the operations guide, Overstap naar SQLite). Keep them as they are; the next release drops them. Letters and digits only in the password |
RP_ID |
β | empty | Domain the app runs on, without scheme or port. Passkeys are bound to it, so set it once you use them. Empty: the address the app is opened on |
RP_ORIGINS |
β | empty | Full origin(s), comma separated, for example https://print.example.com. When set, writes from any other origin are refused, and invitation links use the address the administrator is signed in on when it is listed here, otherwise the first one. Empty: the address the app is opened on |
SETUP_CODE |
β | - | One-time code for the onboarding, so the first visitor cannot take over the app |
SESSION_SECRET |
β | - | Signs session cookies, at least 32 characters |
RP_NAME |
β | 3D Print Pricing |
Name shown in the passkey prompt |
SESSION_HOURS |
β | 24 |
Lifetime of a session |
MAX_UPLOAD_MB |
β | 50 |
Largest STL/3MF upload in MB |
VAPID_PUBLIC_KEY / VAPID_PRIVATE_KEY |
β | empty | Key pair for push notifications (python scripts/generate_vapid.py); empty means notifications are off |
VAPID_SUBJECT |
β | mailto:admin@<RP_ID> (mailto:admin@localhost without RP_ID) |
Contact address for the push services |
AI_IMAGES_ENABLED |
β | FALSE |
Set to TRUE to show the optional AI images feature (product pictures from a photo, made with OpenAI GPT Image). The API key is entered in the app under Settings, not in .env |
FILAMENT_LIBRARY_URL |
β | this repository's library/filaments.json |
Where Settings β Filaments β Sync reads the shared filament library from: a JSON file in the format of the library export, on raw.githubusercontent.com. Empty switches the Sync button off |
SPOOLMAN_URL |
β | empty (type it in the app) | The address of your Spoolman as the app's container reaches it, e.g. http://spoolman:8000 (no login). With it, Settings β Integrations β Spoolman β Sync reads the rolls and what is left on them from Spoolman (a roll you already had here is linked, so it does not appear twice), Spoolman keeps track of what is used (booking it out from a 3D Model is then off), and the library and your own rolls can be pushed to it. Leave it empty to type the address in the app instead (administrators, Settings β Integrations); when it is set here, it wins and the app shows it read-only |
HASPELSYNC_URL |
β | empty (type it in the app) | The address of your HaspelSync as the app's container reaches it, e.g. http://haspelsync:4000 (no login). With it, the Printers page shows what each printer is printing now and which filament is in it (the app only reads from HaspelSync, it changes nothing there). A name that does not end in .local has to be listed under Allowed host names in HaspelSync; an IP address does not. Leave it empty to type the address in the app instead (administrators, Settings β Integrations); when it is set here, it wins and the app shows it read-only |
HASPELSYNC_API_KEY |
β | empty (type it in the app) | An API key made in HaspelSync under Network access (it starts with ams_). A HaspelSync key can do everything there, so make one for this app only. It needs HASPELSYNC_URL here as well and is only ever sent to that address. Leave it empty to type the key in the app instead: it is then kept encrypted, never shown again and not part of a backup |
PROXY_HOPS |
β | 0 |
Number of reverse proxies in front of the app |
WEB_CONCURRENCY |
β | 2 |
Number of Gunicorn workers |
WEB_THREADS |
β | 4 |
Threads per worker; workers x threads requests are handled at once, so one long request (a large 3MF, an invoice, a backup) does not hold up the rest |
PRINTPRICING_UPDATE_CHECK |
β | true |
The update check: the app asks GitHub whether a newer stable release exists and tells the owner with a banner and under Settings β Administration β About β Update check. It sends nothing about your installation and never updates anything. false (also 0, no, off) switches it off, for an installation that must not call out. A beta build only sees stable releases |
Running it
| Task | Command |
|---|---|
| Start | docker compose up -d |
| Stop | docker compose down (the data stays in DATA_PATH) |
| Update | sh scripts/update.sh, which copies the database to DATA_PATH/backups first; or by hand docker compose pull && docker compose up -d |
| Roll back | set PRINTPRICING_TAG to the previous version number, then docker compose up -d; the copy scripts/update.sh made is in DATA_PATH/backups |
| Logs | docker compose logs -f app |
- Health check:
GET /healthzanswers200with{"status": "ok", "version": β¦, "commit": β¦}while the process lives;GET /readyzalso checks the database and answers503when it does not respond. - Largest upload: 50 MB per STL/3MF file (
MAX_UPLOAD_MB). Whatever runs in front of the app (a reverse proxy, a CDN) must allow at leastMAX_UPLOAD_MB+ 1 MB, and as much as your backup when you restore one with print files (up to 2 GB). Every limit outside the repository is listed in the operations guide, Limieten buiten de repository. - Update check: the app tells the owner when a newer stable release exists. It asks GitHub for the latest stable release of this repository, sends nothing about your installation, shows a banner and Settings β Administration β About β Update check, and never updates itself.
PRINTPRICING_UPDATE_CHECK=falseswitches it off.
Notifications and everything else about running the app are in the operations guide (Dutch).
Data and backups
Everything lives under DATA_PATH:
| Folder | What is in it |
|---|---|
db/ |
the database, printpricing.sqlite3 (with a -wal and -shm file next to it while the app runs) |
uploads/ |
the uploaded STL and 3MF files |
backups/ |
the copies of the database that scripts/update.sh makes before an update, and in backups/auto/ the app's automatic backups |
postgres/ |
the database of the releases before SQLite, only when you come from one; read once to move the data over, then yours to remove |
Back up from within the app (Settings β Administration β Backup): one JSON file, or a ZIP when you include the print files. That backup never contains credentials (passkeys, recovery codes, passwords, push subscriptions), users or invitations. For the whole server, copy the database with docker compose exec -T app python backup_db.py /data/backups/backup-$(date +%F).sqlite3 and back up uploads/ too, or stop the stack and copy DATA_PATH; a plain cp of the database while the app runs is not a consistent copy. Keep .env apart, in your password manager.
The app also backs up by itself: by default every 12 hours it makes the same ZIP (with the print files, the orders and their invoices) in DATA_PATH/backups/auto and keeps the newest 14, a week; a new one replaces the oldest. An administrator can switch it off, choose how often (every 0.5, 1, 2, 7 or 14 days) and how many to keep (0 to 60) in Settings β Administration β Backup. Settings β Administration β Backup lists them together with every backup made with Make backup, which is kept there (not downloaded) and never removed by the rotation, to download, restore or delete (deleting asks for your passkey, or your password and code). They sit on the same disk as the data they protect, so copy one off the server now and then, and count on about 14 times the size of uploads/ plus the database. Details: operations guide, Automatische back-ups.
Restoring: Restore from backup⦠checks the whole file first, shows what comes back, and after you confirm replaces everything in one go; if something fails, nothing changes. A database copy is put back with the app stopped, in place of db/printpricing.sqlite3, after removing its -wal and -shm files; the commands are in the operations guide, Back-up en herstel.
Settings β System β Clean-up β Reset to factory settingsβ¦ puts the app back to a new installation: it deletes everything in the database and the uploads (the passkeys too) after a typed word and a fresh passkey (or password and code) confirmation, and leaves .env, the image and DATA_PATH/backups (the automatic backups too) alone. Make a backup first if you are not sure.
Architecture
flowchart LR
A[Phone or desktop<br/>installed PWA] -->|https| P[Reverse proxy<br/>TLS]
P --> B[App container<br/>Flask API + PWA files]
B --> C[(SQLite file)]
B --> D[/Uploaded STL and 3MF files/]
B -.->|optional web push| E[Push services]
B -.->|one-off import| F[(PostgreSQL of<br/>earlier releases)]
| Component | Purpose | Data |
|---|---|---|
app |
Gunicorn serving the Flask API and the PWA files; runs the database migrations before it takes traffic | DATA_PATH/db, DATA_PATH/uploads |
db |
the PostgreSQL 17 of the releases before SQLite, only read once to move the data over; it goes away in the next release | DATA_PATH/postgres |
- App / frontend: a Progressive Web App in plain JavaScript, no build step, with a service worker for the offline shell
- Backend: Python, Flask and Gunicorn; passkeys through the open-source
py_webauthnlibrary (webauthnpackage) - Database: SQLite (one file, WAL mode), with forward-only, checksum-guarded migrations
- Infrastructure: Docker Compose, an image published to GHCR by CI
Stable and beta
| Stable | Beta | |
|---|---|---|
| Branch | main |
beta |
| Image | ghcr.io/flux76hq/3dprint_pricing:latest (and X.Y.Z) |
ghcr.io/flux76hq/3dprint_pricing:beta |
| GitHub release | vX.Y.Z |
none |
Every change lands in beta first, and every push to beta builds a new beta image. Only when the beta proves itself is it promoted to main, which raises VERSION and builds latest and the release. To try the beta, set PRINTPRICING_TAG=beta in .env (the app then shows a beta label next to its name) and run docker compose pull && docker compose up -d; use a separate data folder for it.
Contributing
Contributions are welcome. Pull requests go to the beta branch, never directly to main; main is the stable line and only receives a promotion pull request from beta. The working conventions for people and AI assistants alike are in AGENTS.md: versioning, local checks, tests and the pull request workflow. For bugs and ideas, open an issue.
python -m venv .venv && . .venv/bin/activate
pip install -r backend/requirements-dev.txt
python scripts/setup_hooks.py
cd backend && PYTHONPATH=. python -m pytest -q
The screenshots above are generated from a demo instance: after a change that alters how a screen looks, run pip install playwright && python scripts/generate_screenshots.py and commit the updated images in docs/assets/.
Privacy and security
- Everything is stored on your own server: there is no account with us, no analytics and no tracking.
- Signing in uses passkeys or, where a passkey cannot work, a password (hashed with argon2id), optionally with two-step verification.
- A backup from the app never contains credentials (passkeys, recovery codes, passwords, push subscriptions) or invitations. An invitation link is shown once and only its hash is stored.
- Report a vulnerability privately, through a private security advisory or to the maintainers (@Flux76HQ) directly, never in a public issue.
Support 3D Print Pricing
3D Print Pricing is free. If it is useful to you, a coffee keeps the development going.
Buy me a coffee Support me on Ko-fi
License
No licence has been chosen yet: all rights reserved.
Categories
Related apps
Explore more like this
Explore allLinks
Details
ghcr.io/flux76hq/3dprint_pricing:beta



















