in-house web app for mobile/desktop managing of SnipeIT Assets
  • JavaScript 53.9%
  • Python 21.4%
  • CSS 15.9%
  • HTML 8.7%
Find a file
Ryan Hughes dba7b01bd9
All checks were successful
Build & deploy / test (push) Successful in 6s
Build & deploy / deploy (push) Successful in 35s
Deploy: data volume at /home/bgcmanage/snipe-scanner/data
2026-10-28 13:56:55 -04:00
.forgejo/workflows Deploy: Dockerfile + compose, Forgejo Actions workflow (tests, then build & restart the container on the VM), DEPLOY.md runner setup 2026-10-28 13:33:36 -04:00
static New asset: EOL date (asset_eol_date) — empty uses the model default, a date overrides it; mock keeps explicit EOL and computes dates on create 2026-10-27 15:02:37 -04:00
templates Desktop Labels tab: print queue (paste/ranges/CSV/quick filters/scan to add), per-row templates by category, print via printer transport module (CUPS or file mock), verify-after-print, sqlite print history + History tab; mock: scannable DataMatrix labels; tests/test_labels.py 2026-10-26 11:05:19 -04:00
tests Assets panel: Verify label — click, scan the label on the device; marks the print verified (or wrong), works for older labels too (POST /labels/check) 2026-10-27 14:49:41 -04:00
.dockerignore Deploy: Dockerfile + compose, Forgejo Actions workflow (tests, then build & restart the container on the VM), DEPLOY.md runner setup 2026-10-28 13:33:36 -04:00
.env.example Desktop Labels tab: print queue (paste/ranges/CSV/quick filters/scan to add), per-row templates by category, print via printer transport module (CUPS or file mock), verify-after-print, sqlite print history + History tab; mock: scannable DataMatrix labels; tests/test_labels.py 2026-10-26 11:05:19 -04:00
.gitignore Desktop Labels tab: print queue (paste/ranges/CSV/quick filters/scan to add), per-row templates by category, print via printer transport module (CUPS or file mock), verify-after-print, sqlite print history + History tab; mock: scannable DataMatrix labels; tests/test_labels.py 2026-10-26 11:05:19 -04:00
compose.yaml Deploy: data volume at /home/bgcmanage/snipe-scanner/data 2026-10-28 13:56:55 -04:00
DEPLOY.md Deploy: data volume at /home/bgcmanage/snipe-scanner/data 2026-10-28 13:56:55 -04:00
Dockerfile Deploy: Dockerfile + compose, Forgejo Actions workflow (tests, then build & restart the container on the VM), DEPLOY.md runner setup 2026-10-28 13:33:36 -04:00
label_history.py Assets panel: Verify label — click, scan the label on the device; marks the print verified (or wrong), works for older labels too (POST /labels/check) 2026-10-27 14:49:41 -04:00
label_printer.py Desktop Labels tab: print queue (paste/ranges/CSV/quick filters/scan to add), per-row templates by category, print via printer transport module (CUPS or file mock), verify-after-print, sqlite print history + History tab; mock: scannable DataMatrix labels; tests/test_labels.py 2026-10-26 11:05:19 -04:00
mock_datamatrix.py Desktop Labels tab: print queue (paste/ranges/CSV/quick filters/scan to add), per-row templates by category, print via printer transport module (CUPS or file mock), verify-after-print, sqlite print history + History tab; mock: scannable DataMatrix labels; tests/test_labels.py 2026-10-26 11:05:19 -04:00
mock_snipe.py New asset: EOL date (asset_eol_date) — empty uses the model default, a date overrides it; mock keeps explicit EOL and computes dates on create 2026-10-27 15:02:37 -04:00
printers.example.json Print label: live Snipe-IT label preview (vendored pdf.js), Left/Right roll picker redesign, label cache keyed by asset version 2026-10-22 11:35:45 -04:00
README.md Deploy: data volume at /home/bgcmanage/snipe-scanner/data 2026-10-28 13:56:55 -04:00
server.py Deploy: Dockerfile + compose, Forgejo Actions workflow (tests, then build & restart the container on the VM), DEPLOY.md runner setup 2026-10-28 13:33:36 -04:00

Snipe-IT Scanner

A small web app for scanning BGCWPA asset labels and working with them in Snipe-IT. Scan a label with a phone camera or a USB barcode gun to look up, audit, check out/in, or print labels for an asset.

What each section does

Phone app (/)

Scan a label with the camera, upload a photo of one, or type a tag or serial number.

  • Check In/Out: check an asset out to a person, return it (to Ready to Deploy at Carnegie by default), or reassign it to someone else in one step.
  • Audit: scan an asset and mark it audited, with an optional note.
  • Carts: scan a Chromebook cart, then every Chromebook in it. Shows which ones are missing or belong to another cart, then audits the cart and the Chromebooks in it.

Desktop app (/desktop/, for a USB barcode gun)

  • Dashboard: live counts from Snipe-IT (checked out, ready to deploy, audits due, overdue returns, out for repair), plus recent activity and a list of assets that need attention.
  • Scan station: choose a mode and scan. Auto just looks the asset up. Check out, Return and Audit apply that action to every asset you scan. Undo reverses the last action.
  • New asset: add an asset quickly (warranty, EOL date, optional checkout) and print its label.
  • Assets: a searchable, sortable list of every asset. Open one in the side panel to view or edit it, or select several to check out, return, audit, edit or print labels for all of them at once.
  • Cart check: the same cart check as the phone app, using the barcode gun.
  • Labels: a print queue for asset labels. Add assets by pasting tags, ranges, a CSV, filters or scans, then print. You can scan each new label to make sure it opens the right asset, and every print is saved in a history.

Print label buttons throughout the app print the asset's Snipe-IT label on the CUPS label printer. Both apps support light and dark mode.

Setup

Needs only Python 3, no packages to install.

cp .env.example .env    # set SNIPE_URL and SNIPE_API_KEY
python3 server.py

Then open http://localhost:8080 (phone layout) or http://localhost:8080/desktop/.

For label printing, copy printers.example.json to printers.json and set your CUPS printer. Other options are documented in .env.example.

Deploy (Forgejo Actions)

Every push to main runs .forgejo/workflows/deploy.yml: the tests run in a container, then the runner on the Docker VM builds the image (Dockerfile) and restarts the snipe-scanner container (compose.yaml) on port 8080.

The server keeps its settings and data outside the repo:

  • /opt/snipe-scanner/.env – same keys as .env.example. Set CUPS_SERVER=<cups-host> for label printing from the container.
  • /home/bgcmanage/snipe-scanner/data/ – printers.json, the label history DB and label PDFs (survives redeploys)

The runner needs the labels docker:docker://node:lts and deploy:host. One-time server setup: DEPLOY.md.

Security

The API key stays on the server. server.py proxies only an allow-listed set of Snipe-IT endpoints (ALLOWED), so use a Snipe-IT account with just the permissions the app needs.

Testing

Run against a fake Snipe-IT instead of the real one:

python3 mock_snipe.py     # fake Snipe-IT on :9000
SNIPE_URL=http://localhost:9000 SNIPE_API_KEY=test python3 server.py

Tests: python3 tests/test_labels.py and python3 tests/test_assets.py.