The problem
Small businesses keep stock in back rooms, on shelves, and in bins, and the record of it lives in someone's head or a spreadsheet nobody updates. When something runs out, nobody can say where the last of it went or who used it.
Backroom answers five questions for an owner or a staff member: what do we have, where is it, how much is recorded, what changed and who recorded it, and what needs restocking. A café and a liquor store are the two workflows I designed around.
The signature feature is scanning. Every item and shelf can get a printed QR label, and staff scan it with an ordinary phone to see what's there and record what they did.
I also built it to learn Java and Spring Boot properly: Spring Security, Spring Data JPA, transactions, validation, and testing against a real database.
What it does today
- Accounts and teams. Owners register, create a business, and invite staff. There are three roles, checked against current memberships on every request.
- Storage. Rooms, shelves, cabinets, and bins nest inside each other. A shelf shows what's on it and how much.
- Stock. Each item has a quantity per location. Staff record receiving, use, waste, sales, transfers, and counts. Every change goes into a movement history.
- Labels and scanning. Managers print QR labels for items and shelves as a PDF. Items can also be linked to the manufacturer's barcode. Scanning a label on a phone opens the record.
- Restocking. Staff request more of something, a manager approves it, and the delivery is received against the request, including partial deliveries.
- Low stock. Each item on a shelf can have a minimum, and Home shows what's under it.
- Search, CSV import and export, item photos, password reset links, and an activity history.
How it's built
Backroom is a modular monolith: one Spring Boot application and one PostgreSQL database. The React frontend builds into static files inside the same JAR, so deploying it means running one Java process. The target was a demo that costs $0–5 a month to host, so there's no Redis, no message queue, no object storage, and no paid API. Item photos are stored in PostgreSQL for the same reason.
The code is split into modules by responsibility: access, locations, inventory, restocking, labels, search, exports, imports, and audit. Modules talk to each other through services, not through each other's tables. Inventory owns every change to a stock balance. Restocking, for example, can only add stock by calling the inventory service inside its own transaction, so the delivery, the stock movement, and the request's status commit together or not at all.
Database changes go through Flyway migrations, and Hibernate is set to validate the schema, never to change it.
Making stock numbers trustworthy
This is the part I spent the most time on.
The history can't be edited. Movements, operations, and counts are insert-only. A database trigger rejects any update or delete, so a mistake is corrected with a linked reversal, and the original entry stays visible. There is no endpoint that sets a balance directly.
Two people can record stock at once. Instead of locking a whole business, a stock command locks only the rows it touches, always in the same order: the item, then the locations, then the placement, then the balances by location id. That fixed order prevents deadlocks, and staff recording different things don't wait on each other.
A double tap doesn't count twice. Every command carries an operation key from the client. If the same key arrives again, Backroom returns the first result instead of recording the action a second time. If two copies arrive at the same moment, one wins on a unique constraint and the other returns the winner's result. CSV imports work the same way, so retrying an import doesn't double the starting quantities.
The tests for this coordinate competing transactions directly, by pausing one at a known point and watching PostgreSQL's activity table, never by sleeping and hoping.
Labels and scanning
A printed QR code holds a link to the item or shelf. Opening it needs a signed-in account with access to that business; a signed-out visitor goes through sign-in and lands back on the record.
Label PDFs are generated in memory with ZXing for the QR codes and PDFBox for the page, and nothing is stored. In the browser, the scanner uses the phone's built-in barcode detector where there is one, and otherwise loads a WebAssembly decoder from the app itself, not from a CDN.
Security
- Every API route needs a session except register, sign-in, and the CSRF token, and CSRF protection stays on.
- Sessions use HttpOnly cookies, and a password reset ends every existing session for that account.
- There is no default or demo account; users register through the app.
- The health endpoint returns only a status, and the admin endpoints are not exposed.
- The container runs as a non-root user.
Testing
The backend has 83 tests. The ones that touch the database run against a real PostgreSQL 17 in Testcontainers, the same version the app runs on. Playwright runs the main flows in a browser, from setting up a business to scanning a label with a fake camera. CI runs both on every push.
What's next
Equipment is the next module: individual things like a particular espresso machine, with their condition and where they are, which don't count toward stock. The design is written. Until it ships, equipment is tracked as an ordinary item. Connecting a point-of-sale system, so sales don't have to be recorded by hand, comes after that.


























