The office API
ASP.NET Core minimal APIs on .NET 9, running as a container service on AWS in us-east-1. It is the only thing that talks to the databases, and every request it serves names the store it is for.
Architecture
Most of this page is engineering detail. It is here because the decisions below are the reason the till behaves the way it does at the counter — and because if you are replacing a system you have relied on for a decade, you are entitled to know what you are moving onto.
01
An office in the cloud, and lanes in the stores that keep trading when the office cannot be reached. That single sentence drives nearly every other decision on this page.
ASP.NET Core minimal APIs on .NET 9, running as a container service on AWS in us-east-1. It is the only thing that talks to the databases, and every request it serves names the store it is for.
PostgreSQL. One platform catalogue holding retailers, stores, licences and API clients, and then one database per retailer. Your data is not a filtered view of a shared table.
A Windows application with its own embedded database, an outbox of unsent sales, and everything it needs to price a basket. It asks the office for news; the office never reaches into it.
02 · The one that matters
A shop with no network is still a shop with customers in it. AdvEntRetail treats an unreachable office as ordinary, and says so in plain words rather than throwing an error at a cashier who cannot do anything about it.
Neither the start-up path nor the sale path is allowed to block on the office, the update feed or anything else across the network. A lane that has never seen the internet today still opens, signs a cashier on and rings a basket.
Not a cache that expires. A local database with the catalogue, the prices, the promotions, the tax rules, the users and their PINs, the label templates and the screen layouts — plus every sale it has not yet managed to send.
Completed sales go to an outbox. When the office comes back they drain on their own, in order, without anyone pressing anything. A till that has been isolated for a fortnight catches up unattended.
If a cashier corrects an item's price offline while head office changes its description, neither change is lost. The draft records what the lane could not see, and the office merges the two rather than letting the last writer win.
03
The lane asks what has changed and takes only that. Nothing is pushed at a till, which means a till that was switched off, moved, re-imaged or offline for a month needs no special handling.
"Here is the version I hold for each group of data. What has moved?" The office answers with a list, not with the data.
Changed records come back a page at a time against a cursor the lane carries, so an interrupted sync resumes rather than restarting.
If a lane is too far behind for changes to be worth it — or it is brand new — it takes a complete snapshot of that group instead.
The data lands in the local database at a moment the till has declared safe, and the lane's own version markers move forward.
The office keeps no session for a lane. Any instance can answer any request, so scaling out costs nothing in complexity.
The cursor lives with the lane. A dropped connection mid-sync costs one page, not the whole transfer.
Items, prices, promotions, users, layouts and label templates each sync as their own group, so a big catalogue change does not hold up a price fix.
04
The platform holds one catalogue — the list of retailers, their stores, their licences and their API clients. Every retailer then has their own database.
An application holds exactly one connection string, pointing at that platform catalogue. It reaches a retailer's data only through the store a request names, resolved per request from credentials the caller supplies. There is no ambient "current tenant" that could be wrong, and no shared table where a missing filter would leak one retailer's sales into another's report.
For a chain, one database covers every shop in the group, so a six-store group shares its catalogue and reports across all six without anything being copied between them.
| Level | What it holds |
|---|---|
| Platform catalogue | Retailers, stores, licences, API clients |
| Retailer database | Items, prices, stock, sales, customers, users — for every store in that group |
| Store | The scope a request resolves to; its own parameters, lanes and stock |
| Terminal | One registered lane, with its own identity, licence and outbox |
05
New software reaches your estate in stages, so a bad build meets a test lane rather than a Saturday queue.
Every build, published each night without approval. Only lanes that have deliberately opted in ever see it; a production till cannot reach this ring by accident.
A build a person has chosen, byte for byte the same one that ran on nightly. Stores join from the till itself and leave the same way.
The release, after pilot, byte for byte what pilot ran. Lanes find it within a few hours and install when idle.
It checks the feed on its own schedule, verifies the package against the hash the release published, downloads in the background while trading continues, and applies only once it has told itself that no sale, payment or sync is in progress.
One installer, run in the till's own Windows account. Its wizard registers the lane against your licence, fetches the right version for your ring, checks it, installs it and hands over to the till. Support can still take a lane back a version by hand when it has to.
06
Every route resolves its store from supplied credentials. A request without them reaches no retailer data at all.
Repeated bad credentials lock the key rather than inviting a guessing run.
A refusal says no without saying why, so it cannot be used to probe what exists.
Passwords and till PINs stored as salted hashes. Nothing recoverable is kept.
The Users and Roles screens refuse to grant more than the editor already holds, so nobody can promote themselves.
Cloudflare Turnstile in front of the office sign-in, shown only when Cloudflare asks for an answer.
The feed is refused unless it is HTTPS, and every package is checked against a published hash before it runs.
Only named roles can write to the update store, with alerts on every write and separate credentials per ring.
A lane's credentials are protected by the operating system's own user-scoped encryption, tied to that Windows account.
07
No secret sauce, and nothing exotic that will be hard to hire for in five years.
| Layer | Technology | Why |
|---|---|---|
| Office API | ASP.NET Core · .NET 9 | Fast, long-supported, and the same language as the till |
| Databases | PostgreSQL | Mature, open, and strong at the reporting work a retailer actually does |
| Hosting | AWS (us-east-1) | Container services, object storage and a CDN for the update feed |
| The till | .NET MAUI Blazor Hybrid | One UI codebase for Windows, Android, iOS and Mac |
| Lane database | Embedded document store | No server to install or administer in the shop |
| Web applications | Blazor | Shares components and rules with the till, so the two cannot drift |
| Real-time | SignalR | Live stock, menu and kitchen updates where they are wanted |
| Lane updates | Velopack | Per-user installs, background download, verified packages |
08
AdvEntRetail runs on ordinary retail kit. Printers, scanners, scales, drawers and card terminals you can buy anywhere, from more than one supplier, and replace on a Saturday when one dies.
Bring them to the demo. We would rather have the hard conversation before you buy than after.