All projects

NailToolInventory

Inventory management for a small distributor

C#, ASP.NET Core MVC (.NET 10), EF Core, Azure SQL, xUnit, GitHub Actions, Azure

Live on AzureSource code on GitHub

The problem

In the small distribution businesses I’ve worked with, the same inventory problems kept coming up:

How the system addresses it

Key design decision

The system keeps both a current balance for fast lookups and an immutable history of every stock movement. Each change and its history entry are saved in a single database transaction, so the balance and the history can never disagree.

Testing and delivery

Unit tests enforce the core stock rules: stock can’t be issued beyond what’s on hand, inactive products can’t be moved, and physical counts can’t go negative. GitHub Actions runs the tests on every pull request. Merges to main deploy automatically to Azure using secretless OIDC authentication, with health checks and automatic rollback.

A problem I solved

The first production deployment returned HTTP 500. The deployment script detected the failure and automatically restored the previous version. Using Windows Event Viewer, I traced it to a SQL connection timeout (error -2): Azure SQL was still waking from idle while the app started up. I fixed it by extending the connection timeout and retrying that specific error, and the next deployment succeeded.

Results

Piloted at a friend’s nail supply store, where checking stock became quick and easy. With one accurate source of stock numbers, keeping marketplace listings up to date became much simpler. The app is live on Azure.

What’s next

Automatic stock sync with marketplaces such as Amazon to prevent overselling, lot numbers and expiry dates (FEFO), concurrency checks so simultaneous updates can’t overwrite each other, and tests covering multi-location transfers.

I used AI coding assistants to help write the code. I set the requirements from real store operations, reviewed and ran every change, and tested the app with a working store.