Case Study · Web Application

StockPilot — inventory that can never go negative

A full-stack admin panel for a business that keeps stock in more than one place. It tracks every unit across warehouses, runs purchase and sales orders, keeps a complete ledger of how each quantity changed, and gives each person only the permissions their job needs.

Project
Inventory management admin
Scope
Stock · Orders · Reports · Roles
Stack
React · Node.js · PostgreSQL
Status
Working application
StockPilot dashboard showing inventory value, units in stock, a 14-day revenue chart and stock value by category
The Brief

A spreadsheet stops working the day stock lives in two places

The hard part of inventory is not listing products. It is trusting the number.

Small businesses often start with a spreadsheet. It breaks when there is a second warehouse, when a supplier delivers half an order, or when two people sell the last unit at the same moment. StockPilot is designed around those cases rather than around the product list.

Every change to a quantity is a row in a ledger with a reason, a user and a running balance, so any number on screen can be traced back to what caused it.

Every quantity change is a ledger row, so any number can be explained.
What We Built

What it does

01

Multi-warehouse stock

Current quantity for each product in each warehouse, with transfers between locations and manual adjustments that must carry a reason.

02

Movement ledger

Purchases, sales, adjustments and transfers are written as signed rows with the balance after each change, who made it and what it refers to.

03

Purchase orders

Draft, placed, partly received, received. Goods can arrive in parts, and the product cost is updated as a weighted average on delivery.

04

Sales orders

Fulfilment is all or nothing. If one line cannot be covered, nothing is taken, and stock cannot fall below zero.

05

Reorder suggestions

Products at or below their reorder level are grouped by supplier, less what is already on order, with one click to create a draft purchase order.

06

Four permission levels

Admin, Manager, Staff and Viewer. Rules are enforced on the server and mirrored in the interface, and every important change goes to an audit log.

The Product

Inside StockPilot

Screens from the running application, loaded with demo data.

Select any screen to view it full size.

Design Thinking

Decisions that mattered

One door for stock changes

Every change to a quantity goes through a single function. It subtracts only if enough stock remains and writes the ledger row in the same transaction, so overselling is blocked by construction.

A ledger, not just counters

The current quantity is easy to read, but the ledger is what lets you answer “why is this 12 and not 20?”.

Transactions where it matters

Receiving a purchase order, fulfilling a sale and transferring stock each run as one transaction. If any step fails, all of it is rolled back.

Permissions checked on every request

The role is read from the database each time, so demoting or deactivating someone takes effect at once. The last active admin cannot be removed.

History is never deleted

A product that has been bought or sold is archived instead of deleted, and profit uses the cost recorded at the time of sale.

Money you can reason about

Prices and costs are fixed-precision numbers in the database, not floating point, and every input is validated before it is written.

4
Permission levels
enforced on the server
8
Integration tests
on a real database
3
Warehouses in the
demo data
5
Types of stock
movement in the ledger
Where It Stands

What is real, and what is sample data

A working application, shown here with demo data.

Working: the React interface, the API, the PostgreSQL schema, login, all four roles, purchase and sales orders, transfers, reports and CSV export. The screenshots on this page come from the application running on a local database. The automated tests create their own records and pass, including a test where two orders compete for the same last units and exactly one succeeds.

Sample data: the products, suppliers, warehouses, people and figures shown are demo data. They are not from a real business.

Not included: barcode scanning, batch and expiry tracking, email alerts and image uploads. These are listed as extensions, not claimed features.

Under the Hood

Design & stack

Interface
React 18React RouterRechartsHand-written CSS with no UI framework, charts for the dashboard, and a layout that adapts down to a phone.
API
Node.jsExpressZodEvery write is validated, and database errors are turned into clear 400 and 409 responses.
Database
PostgreSQL 16SQL schemaConstraints, indexes and a check that quantity can never be negative, as a second line of defence.
Security
JWTbcryptHelmetRate limitingPasswords are hashed, login attempts are rate limited and roles are re-checked on each request.
Testing
node:testIntegration testsTests run against a real database and cover roles, validation, partial receiving, costing and concurrent orders.

Want something like this for your business?

Tell us a little about your idea. We will tell you honestly what it would take, how long it would take and what it would cost.

  • Free discovery call
  • Reply within 24 hours
  • First working version in 72 hours

Need an inventory or admin system for your business?

Stock, orders, reports and permissions around the way your team really works. Tell us what you track and we’ll scope it.

Start a Conversation