alp@vilnius: ~ up since 2019 · Vilnius Download cv.pdf

← ALP-OS

alp ~ $ work inventory-app

The inventory app that outgrew 50k reads

My test-hardware inventory app hit Firebase’s 50k read limit. I priced switching to an off-the-shelf tool (64 h) against moving to my own API (40 h), and moved it. It has been used company-wide since June 2026.

487 ms  to 92 mslist sort, 2,640 devices

R&D and QA have a lot of test hardware, and every device is identified by its IMEI. I built and run the inventory for it: Expo / React Native for Android, iOS and web, an Express API, MongoDB, a C++ scanner service, Docker and GitLab CI. So far that’s at least 33 tickets and about 356 commits.

It started as a small tool and grew into a company-wide service.

Outgrowing Firebase

The first version went live on GitLab Pages the same day it was asked for. Then it moved to Firebase. When it hit Firebase’s 50k read limit, it needed a new home.

Before rebuilding, I priced the alternative. Moving to an off-the-shelf open-source asset manager came to 64 hours. Moving my app to its own backend came to 40. So I moved it to MongoDB behind my own Express API.

Scanning etched codes

The app reads QR and DataMatrix codes with zxing-cpp in three places: a Kotlin module on Android, WASM in the browser, and the scanner service on the server. Laser-etched codes are hard to read, so the decoders try several scales and inverted images.

I also added a server-side photo decoder (OpenCV, Tesseract OCR, zxing). It reads every code on a PCB from one photo, and does it better than the live scan.

One C++ decoder in three runtimes, feeding one API that serves people and CI Top: the same zxing-cpp decoder, with multi-scale and inverted passes for hard-to-read laser-etched codes, runs in three places. On Android it is a Kotlin module fed by a live phone-camera scan. In the browser it is WASM fed by a live browser-camera scan. On the server it is a C++ scanner service, with an OpenCV and Tesseract OCR photo decoder that reads every code on a PCB from one photo. All three produce the IMEI, the unique key of every device, which goes to the Express API. Bottom: the Express API rejects duplicate IMEIs, fills in device details automatically, and has an OpenAPI spec with a drift test. People use the Expo app on Android, iOS and web and log in through company single sign-on. The firmware CI pipeline uses a separate machine API with its own credentials to fetch its device list, responses carry ETags for 304s, and webhooks are HMAC-signed. The API stores data in MongoDB with a daily backup and a change tree with revert. MongoDB replaced Firebase after the app hit Firebase's 50k read limit. ONE C++ DECODER · compiled into three runtimes Laser-etched codes are hard to read, so every runtime runs multi-scale and inverted passes. live scan, phone camera live scan, browser camera one photo of a PCB Android Kotlin module zxing-cpp multi-scale + inverted Browser WASM zxing-cpp multi-scale + inverted Server C++ scanner service zxing-cpp multi-scale + inverted + OpenCV, Tesseract OCR every code on a PCB, one photo IMEI, the unique key people Expo app Android, iOS, web SSO company Express API duplicate IMEI rejected details filled in automatically OpenAPI spec + drift test firmware CI fetches its device list machine API ETag, 304 when unchanged HMAC-signed webhooks MongoDB daily backup, change tree Replaced Firebase after its 50k read limit.
One C++ decoder in three runtimes, feeding one API that serves people and CI

Everyday use

Search supports AND/OR, exact (=) and partial (~) matching, suggestions and shareable filter links. Excel import and export puts each location on its own sheet. Device details fill in automatically, duplicate IMEIs are rejected, and devices can be reserved and released. There’s a daily backup, and admin mode has a git-like change history with revert.

An API for CI

The firmware CI pipeline needed the device list, but the app only had interactive single sign-on. So I built a separate machine API for CI, with its own credentials. CI firmware builds now use it to fetch their device list.

Webhooks are signed with HMAC, responses carry ETags for 304s, and a test catches the OpenAPI docs falling behind the routes.

Conclusion

Sorting 2,640 devices went from 487 ms to 92 ms. The app has 352 Jest tests and 1,371 screenshot comparisons. In June 2026 it launched company-wide, with company single sign-on.

List sort, 2,640 devices

Pricing the off-the-shelf option was worth it, even though I didn’t take it. 40 hours against 64 made it a decision, not a preference.

Tags apps tooling testing