Back to projects Projects

MedStock

A healthcare inventory and order management system with FEFO lot allocation, an append-only stock ledger and real-time updates.

Portfolio demo
Synthetic data
Open source (MIT)
Real time
.NET 11
Source code
Coming soon
App version

v1.2.0

Last updated

Nov 16, 2026

Screenshots

Overview in dark mode: KPIs, movements chart and live activity feed.

On a phone (390 px wide)

MedStock overview on a 390 pixel wide phone in dark mode Overview on a phone.
MedStock inventory on a phone with a compact card for each product Inventory on a phone.
MedStock order detail on a phone in light mode Order detail on a phone, light mode.
MedStock products management on a phone in dark mode with a New product button and one card per product Products management on a phone.

The problem

Distribution centers that move medical supplies must ship the lots that expire first, never let stock go negative, keep cold-chain items in cold-chain sites, and see low stock and expiring lots before they become a problem.

Who it is for

Warehouse managers, pickers, purchasing staff and administrators across several distribution centers. MedStock is a portfolio demo: all products, companies and people are fictional.

Key features

Overview with live feed

KPI tiles (inventory value, low-stock SKUs, lots expiring in 30/60/90 days, open purchase orders, fill rate, open orders), movement and stock-value charts, top products and a live activity feed.

Inventory and lots

Server-side paging, sorting and filtering (search, location, category, low stock, expiring, cold chain) with lot drill-down, and a product page with stock by location and a movement timeline.

Master data management

Products, warehouses, suppliers and customers each get a searchable grid with create and edit dialogs and validation. A record that stock, lots, orders, purchase orders or movements reference cannot be deleted, so the dialog offers deactivate and reactivate instead.

Orders with FEFO allocation

Create orders with form validation, allocate first-expiry-first-out across lots, then pick and ship. While an order is Pending or Allocated its lines can be added, removed or changed and the order is fully released and re-allocated in one transaction; cancelling asks for confirmation.

Purchase orders

Reorder suggestions from min/max levels (counting stock already on order), manual purchase orders (supplier, warehouse, lines), quantity edits (never below what was received), cancel before any receipt, and full or partial receiving that books new lots.

Transfers and reversal

Move stock between locations; reserved stock cannot move and cold-chain products only go to cold-chain sites. A transfer can be reversed with compensating movements, leaving the original ledger rows untouched.

Alerts

Low stock, expiring and expired lots, and cold-chain temperature excursions.

Role-based permissions

Admin, Warehouse Manager, Picker and Viewer roles. Services take the acting user and enforce permissions themselves, so a denied call returns an error and changes nothing; the admin-only reset of the demo data stays.

Architecture highlights

FEFO allocation

A pure FefoAllocator in the domain library picks lots by earliest expiration date, skipping expired lots and honoring what is available.

Append-only stock ledger

Every change is a ledger movement and rows are never edited or deleted (a reversal is a compensating movement, such as TRF-xxxxx-REV for a transfer). Balances per warehouse and lot can never go negative, and a verify endpoint replays the ledger to check it.

Real time over SignalR

Writes are serialized, saved and announced on an event hub with topic flags; every connected Blazor circuit reloads only the components whose topic fired, so dashboards, grids and the feed update live.

Background simulator

A hosted BackgroundService creates orders, ships them, receives purchase orders, transfers stock and raises alerts every few seconds (10 s by default), so the demo always has live activity. It ignores inactive products, warehouses and customers and leaves user-created orders and purchase orders alone. It can be switched off from the app bar or in settings.

Schema-version reset

The schema version is kept in SQLite PRAGMA user_version; an older database is dropped, recreated and reseeded on startup with a clear log message, so an existing host database upgrades cleanly.

Isolated domain library

Business rules (FEFO, reorder, expiry, ledger, PO receiving, order workflow) live in MedStock.Domain with no EF Core or ASP.NET dependencies and are unit-tested on their own.

Tech stack and versions

Exact versions taken from the project files.

TechnologyVersionUsed for
net11.0 (.NET 11)Target framework and SDK used to build (no global.json pin)
SDK 11.0.100
Target framework and SDK used to build (no global.json pin)
Blazor Web App (Interactive Server)Server-rendered UI over a live circuit
ASP.NET Core 11.0
Server-rendered UI over a live circuit
SignalRPart of the framework; carries the Blazor circuit and live updates
ASP.NET Core 11.0
Part of the framework; carries the Blazor circuit and live updates
MudBlazorUI components, dark and light theme, and charts
9.13.0
UI components, dark and light theme, and charts
Microsoft.EntityFrameworkCore.SqliteData access with SQLite
11.0.0
Data access with SQLite
Microsoft.AspNetCore.Identity.EntityFrameworkCoreCookie authentication and roles
11.0.0
Cookie authentication and roles
xunitTest framework
2.9.3
Test framework
xunit.runner.visualstudioTest runner
3.1.4
Test runner
Microsoft.NET.Test.SdkTest host
17.14.1
Test host
Microsoft.AspNetCore.Mvc.TestingWebApplicationFactory for integration tests (throw-away SQLite file)
11.0.0
WebApplicationFactory for integration tests (throw-away SQLite file)
GitHub ActionsCI/CD: build, test and deploy over FTPS
-
CI/CD: build, test and deploy over FTPS

137 xUnit tests in two projects (78 domain, 59 web): domain unit tests (FEFO, reorder, expiry, ledger, PO receiving, order workflow, domain rules) and service and integration tests against the real app (authentication, roles and denials for every mutation, create, edit, delete and deactivate paths, order re-allocation, manual and edited purchase orders, transfer reversal and ledger integrity, simulator with inactive and user-created data).

Demo accounts

Everything in the demo is synthetic and the credentials are public on purpose. Each account has a different role, so you can see how permissions change what you can do.

admin@medstock.demo
manager@medstock.demo
picker@medstock.demo
viewer@medstock.demo

Password: MedStock-Demo-2026!

© 2026 Miguel Alonso. All rights reserved. v2.5.2

An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.