Technical overview

How the system is built,
and what keeps it correct.

For the engineer or the CTO who has to say yes. What every a-systems build is made of, how its data stays correct, how it is protected, and how a change reaches your live system. Each figure was measured on a running system, and the text says where.

Download the PDF Read the security status Edition October 2026 · updated every month
01 · In one page

The system on one page.

What it isOne system for a company’s sales, purchasing, warehouse, delivery, invoicing, HR, production, service and accounting. It replaces the ERP you already have one business flow at a time, and accounting moves last.
How it is builtEvery client gets a system of its own: its own build, its own database and its own containers. Every build stands on one shared foundation, so a fix made in the foundation reaches every build.
StackTypeScript end to end. Bun runs it, Hono serves the API, Next.js draws the screens, PostgreSQL holds the data through Prisma, background jobs wait in the same database, and Docker runs it all.
Where it runsOn servers in the European Union, where we run and update it. On request we export all your data in open formats.
Size of the reference build290+ data entities, 860+ API routes and 220 screens in 19 modules (counted in the code on 25 October 2026)
SpeedOn a database of 1.6 million+ rows shaped like a distributor’s live system, the slowest list answers in about 120 ms against a budget of one second (measured 25 October 2026)
CorrectnessMoney is stored in whole cents. Every posted entry is sealed to the one before it. The database itself refuses to change a posted entry.
Checks12,000+ automated tests on the reference build and its foundation, run against a real PostgreSQL database; at this edition every one passed. 800+ browser scenarios walk the screens the way a person does.
AIEvery build can carry the AI door. Where it does, an assistant such as Claude or ChatGPT connects as a named person, with that person’s role, through the same API the screens use. How a person connects one: a-systems.pro/ai.
02 · Principles

Six rules every part follows.

  • The screens never touch the database. All business logic lives in the API. So a rule exists in exactly one place, and a script has to obey it just like a person on screen.
  • One step simpler than the obvious answer. One PostgreSQL database per client, one API process, background jobs in the same database, Docker Compose instead of Kubernetes. Every extra layer costs something in every month of operation, not once at installation.
  • Every part of the stack has a boring way out. Replacing any part costs a configuration change, not a rewrite. Section 05 names each one.
  • Rules that must never be broken live in the database. PostgreSQL itself refuses a change to a posted entry, whoever sends it, and the database has no door from outside the server. A script, a console session or a future developer cannot get round these rules by not knowing about them.
  • Anything that runs by itself must say when it stops. Monitoring asks “is it doing its job”, not “is the process alive”.
  • A written specification before the code, and a failing test before the code that moves money, tax or stock. Section 11 shows how each change follows both.
03 · Architecture

One way in, and the database at the end of it.

Every request takes the same road: through the edge server, into the API, and only then to the data. Neither the screens nor any outside system reaches the database directly.

Architecture: people, sales channels and AI assistants reach the system only through the edge server and the API; the screens and outside systems never touch the database. People office, warehouse, scanners Sales channels, partners orders in, catalogue out AI assistants as a named person (MCP) The old ERP its integrations keep working Edge server HTTPS only, TLS 1.2 and 1.3 rate limits, security headers the only door: the applications and the database listen only inside the server Screens Next.js, in the reader’s language; no database access API Hono; roles checked on every request doors, each with its own sign-in and its own log: staff · channel intake partner API · AI (MCP) old-ERP compatible RPC signing · document links background jobs in the same database PostgreSQL one database per client double entry, hash chain posted entries locked by the database itself no port outside the server Outside services, each behind an adapter with a stand-in e-invoicing chain · carriers · label printers · mail · marketplaces · the old ERP
The screens ask the API, the API asks the database. Outside services are reached from the API through adapters, never the other way round.

Doors into the API

The API has one door per kind of visitor, and each door checks its own kind of credential. Not every build carries every door.

  • Staff: the screens, the warehouse scanners and phones, with the person’s session and roles.
  • Channel intake: orders from sales channels and marketplaces. It is idempotent: the same order sent twice is one order. It keeps every order it receives for thirty days, so an order can be replayed.
  • Partner API, where a build carries it: catalogue and offers out to a marketplace or a partner, and its orders in, each partner with its own token.
  • AI door, which every build can carry: assistants such as Claude or ChatGPT, signed in as a named person (section 09).
  • Old-ERP compatible RPC, where a build carries it: an integration written for an Odoo-style XML-RPC or JSON-RPC interface keeps working during the move for the records it uses (contacts, products, sales orders), without being rewritten.
  • Accounting feed, where a build carries it: an importer on the client’s side collects the documents the system issued for the old accounting system, and sends that system’s history back (section 10).
  • Signing and document links: an outside party signs a document, or opens a shared file or folder, at a link that expires and can be withdrawn. The link opens only what it was made for.

Background work waits in a queue inside the same PostgreSQL database (pg-boss), so a job and its data survive a restart together. By the project’s rules, a request that would take longer than two seconds becomes a background job, never a slow screen.

04 · Foundation and builds

One foundation, and a build of its own for each client.

We sell one product, built more than once. What every build shares lives in one place, the foundation. What is specific to one client lives in that client’s build and nowhere else.

The foundation

The foundation’s core is a versioned package of pure business logic: no database client, no web framework, no runtime of its own, so every build can use it whatever else it runs. It holds the rules that must behave the same everywhere: stock valuation, putaway and removal, landed cost, barcode scanning, the ledger, budgets, approvals, CRM, HR and payroll, electronic signature, currency conversion, carriers, order intake, document versions, translations and the AI door.

  • One rule in one place. A fix to a rule in the foundation reaches every build with its next version. A build may never import another build’s code; a check at the start of every deploy refuses one that does.
  • Each build moves on purpose. A build takes a new foundation version as a pinned package, and its whole test suite runs against it. Nothing changes under a build that did not ask for it.
  • No registry, no outside credential. The package travels inside the build’s own repository. No server that runs a client system needs access to our code hosting.
  • What you hold. Your data, whenever you ask. We build the export on your system’s own server: a database dump, every table as CSV and JSON, every stored file, a data dictionary and a list of checksums. It is made from a restored copy, so nobody waits on it, and a second restore checks it before we hand it over. Passwords and keys are emptied first. A licence to run the system on your own server has a price fixed in your agreement, and source escrow is part of the agreement.

The build

A build is described by a profile: which modules it carries, which add-on packs (label printing, a carrier, cameras at the packing desk), which connections to outside systems, and which book it keeps (currency, country, time zone). Every file in the code base is marked as foundation, shared template, specific to one client, or our own operations, which never ships. A check refuses a file that no rule marks.

Each release records the exact version it put on the system. Before a migration, the deploy dumps the database of every system that holds a client’s data and keeps the last five dumps; the public demos are rebuilt from empty instead. The deploy also keeps the images it replaced, to roll back to. One image of the screens serves every system: each system’s brand and languages come from the system itself, at run time.

05 · Stack

The stack, and the way out of each part.

The stack is fixed in the project’s written rules and changes only by an explicit decision. What matters more than each choice is that each one has an exit written down in advance.

LayerChoiceWhyThe way out
RuntimeBun 1.4, TypeScript in strict modeFast, and one tool to run, test and installNode LTS: the business logic uses no Bun-only API, and a test checks it
APIHono 4Small, independent of the runtime, typed end to endRuns on Node as it is
ScreensNext.js 16, Tailwind, TanStackThe industry standard; server rendering and fast lists on large volumesPlain React: the screens hold no business logic to move
DatabasePostgreSQL 16, Prisma 7One database for all data, a typed schema, declared indexes, migrations reviewed like codeAny PostgreSQL host: moving it is one connection string
Queuepg-boss, in the same databaseOne service fewer; the job and its data survive a restart togetherRedis and BullMQ, a configuration change, if a measurement ever shows the need
DeploymentDocker Compose and one script from the repositoryThe application reaches a server only through the deploy script from the repositoryAny host that runs Docker

The system is not tied to a hosting provider or to a managed database, and its business logic is not tied to Bun. It runs anywhere Docker runs.

06 · Speed

Speed measured on real volumes, not on demo data.

Before a build reaches production, we read the volumes out of the client’s live system and generate a database of the same size and shape. Then we measure every list over HTTP: the time until the answer reaches the screen, with its filters, counters and totals, not a bare database query.

On the reference build that database held 1.6 million+ rows: products, customers, orders and their lines, purchase orders, transfers, stock and the full movement ledger. The budget for any list is one second, written into the project’s rules as a property of the product.

Surface, production volumeAnswer
Product list, one page of 92,000+14 ms
Product search by name71 ms
Customer list with counters15 ms
Order list with its total11 ms
Order list, page 10 (deep paging)11 ms
Orders grouped by customer37 ms
Purchase order list with its total12 ms
Movement ledger, one page of 867,000+33 ms
Vendor prices, one page5 ms
Stock on hand, one page117 ms
CSV export of all 54,000+ transfers185 ms

Measured on 25 October 2026 against the current code, over HTTP: the median of three runs, each the best of five after a warm-up. The slowest list, stock on hand, takes about an eighth of the budget; the heaviest operation, exporting every transfer to CSV, under a fifth.

What the rehearsal is for

The only surface that ever broke the budget was not one a person sees: an internal stock check compared every balance in memory and took almost twelve seconds. It moved to a nightly job and its answer became three milliseconds. That is the point of measuring before production: the limits are found in rehearsal, not by users.

Headroom

The reference build’s working data fits in the memory of a modest server with an order of magnitude to spare, so growth does not mean buying hardware in advance. Each step up is tied to a signal that can be measured: a bigger server when the processor stays above 60%, the queue moved out of the database if jobs start to compete with people, a read replica if heavy reports slow the warehouse, a second application server when one is not enough. Its data and its jobs live in the database, so scaling out means adding machines, not redesigning.

07 · Data integrity

Data that stays correct, even when someone makes a mistake.

A bigger server fixes slowness. It does not fix a wrong number in the ledger. These are the mechanisms that keep numbers right.

  • Money is a whole number. The ledger stores amounts as integer cents. Debits equal credits exactly, not “within a tolerance”, and no amount ever passes through floating point. The classic rounding bugs cannot happen.
  • Double entry with a hash chain. Every posted entry stores a cryptographic fingerprint of itself and of the entry before it, per journal. Change a figure after the fact and the chain breaks, and the nightly check finds it.
  • The database refuses changes to what is posted. PostgreSQL triggers, not only application code, forbid editing a posted entry. A rule inside a service protects only the paths that go through that service. A rule in the database protects every path. A correction in accounting is always a reversal, never a delete, and lock dates stop anyone rewriting a closed period.
  • Two people, one document. Sales orders and invoices carry a version that the database moves on every write. When two people edit the same document, the second save is refused with the name of the person who changed it and when, and what was typed stays on screen to apply again. Nothing is silently overwritten.
  • The business date is separate from the typing date. Every document that moves stock or revenue carries the date it takes effect, apart from the moment it was entered. Reports use the business date by default.
  • Nightly checks of the books against the documents. Every night the ledger balance, the stock valuation and the control accounts are reconciled against the documents behind them, and any difference opens an item on the attention list. Every night the stock in the bins is also checked against each product’s total on hand.
  • A unit cannot change under the stock. A product’s unit of measure cannot change while any stock, movement or open document still counts in it.
  • Backups are encrypted and leave the machine. On our servers each daily backup is encrypted, and the key that opens it is kept on no server. Right after a backup is written, the restore tool reads its contents list back, so an unreadable file is found the same night. Copies stay on the server for seven days and on a second machine for thirty. On our servers an alert fires when a backup fails, when it does not reach the second machine, or when none has completed for a day and a half.
  • Restore is tested by doing it. On 8 October 2026 every database on our server was restored from its offsite copy into empty databases with no network, and a client’s own server was restored from its own backup. There were no errors. Every table matched the live database at the moment of the backup, apart from tables written to after it, such as job queues and logs. The drill also found that the backups lacked the database roles a restore needs; they carry them since.
08 · Security

Security that is built in, not added on.

These are properties of the running system. What we do not have yet (an external penetration test, ISO 27001, disk encryption on our own servers) is listed with its status on the Trust page, and this document does not repeat it.

Signing in

  • Passwords are stored only as salted scrypt hashes. A password exists in clear text nowhere and is never sent by email.
  • Every failed sign-in (unknown address, disabled account, wrong password) gets the same answer, so the answer does not tell anybody outside which accounts exist.
  • Five failures in a row lock the account for fifteen minutes, and the edge server limits attempts before they reach the application.
  • A second factor is available to every person: an authenticator app, or a six-digit code by email where the system sends real mail. A used code never works twice, and an administrator sees who has it on and can reset it. AI access requires the authenticator app.
  • The session lives in a cookie that page scripts cannot read (HttpOnly, SameSite, and over HTTPS a host-only Secure cookie). It ends twelve hours after sign-in. A person switched off loses access at their next request.

Who may see and do what

  • Roles (sales, purchasing, logistics, finance, quality, administration, read-only) are checked by the API, not by hiding buttons. A person can hold more than one.
  • Rights decide what is sent, not only what is shown: cost and margin never leave the server for a person not entitled to them.
  • Sign-ins, failed sign-ins and lockouts, password and second-factor changes, changes to people, AI connections, deletions and changes to settings are written to an append-only access log, with who, when and from which address. An administrator reads it on screen and can export it.

The perimeter

  • The edge server is the only door: TLS 1.2 and 1.3 only, HSTS, a Content-Security-Policy that is enforced, a referrer policy, rate limits, and no software versions announced.
  • The applications and the database listen only inside the server. The database has no port on the internet, so it cannot be scanned and no password can be guessed against it.
  • On our servers, access is by key only, with password login disabled. Repeated failed attempts are banned automatically, the firewall refuses everything that is not the web or the key-only door, and security updates install themselves. Every sign-in to a server is kept month by month, encrypted, and copied to the second machine.

The code

  • Every database statement goes through the ORM with its values bound. Raw SQL is allowed only for what the ORM cannot say (a row lock, an aggregate), and each file that holds it is recorded with its reason. The deploy refuses a file that is not.
  • Uploads are limited in size, and a file opens in the browser only when its type is on a safe list; anything else downloads.
  • Library security advisories arrive automatically, and every increment gets an automated code review before it ships.

Test systems cannot do harm

  • A system sends nothing to a client’s customers until we switch that on at the client’s request. Until then every letter is redirected to a test address and marked as such.
  • The public demos run on invented data and rebuild themselves. A check on every deploy confirms that neither their data nor their pages contain anything that belongs to a real person or company.
09 · AI access

AI assistants, through the same door as people.

An assistant such as Claude or ChatGPT can work in the system for a person: find an order, read the stock, prepare a document. It does so as that person, never as a robot with a master key.

  • It signs in as the person. The AI door is an MCP endpoint (MCP is the open protocol assistants use to call tools). The assistant connects through OAuth 2.1 with PKCE. The signed-in person chooses which areas it may read or change, and approves with a fresh code from their authenticator app. From then on it acts with that person’s roles, within those areas, and nothing more.
  • Its tools are the screens’ own routes. Every tool calls the same API route a screen calls, so every rule, role check and audit entry applies to the assistant exactly as to a person.
  • What cannot be undone waits for a person. The assistant prepares a confirmation or a posting, and the person confirms it in the system. The confirmation carries the version of the document the person saw, and a document changed since then refuses it. Sending, payments, stock moves and deletions are not open to an assistant at all.
  • It leaves a trail. Every change it makes is recorded under the person’s name, and the history and the access log name the assistant it came through.
  • It is off until you turn it on. An administrator turns AI access on for the system, and each person can disconnect an assistant at any moment. A changed password or authenticator ends the connection. How a person connects one is on a-systems.pro/ai.
10 · Integrations

Every outside system behind an adapter.

Each connection to the outside world is an adapter with at least two forms: the real one and a stand-in. The whole system runs end to end with every adapter in stand-in mode, which is how it is tested and how a new stand starts. Credentials live only in the server’s environment, never in the code.

  • The national e-invoicing chain. Every outgoing e-invoice file is built by the system and checked against the tax authority’s official schema, and the automated checks run it on every change.
  • Carriers. Booking a shipment with the client’s own carrier account, customs data, cancellation, and the label printed at the packing desk.
  • Label printers. Through a cloud print service to the printers at each station, with templates in the printers’ own language, and a sweep that reads back what each printer actually did.
  • Sales channels and marketplaces. Orders come in through the channel intake door; catalogue and offers go out through the partner API.
  • The systems you have today. While a flow has not moved yet, the new system works beside the old one, and each connection has its own direction. An old ERP is followed read only: catalogue, stock and orders arrive every few minutes, and nothing is written back to it. An old accounting system can be kept up to date instead. An importer on the client’s side enters the documents the new system issued there, such as invoices, sales and delivery documents and goods receipts, and every evening it sends back the accounting system’s document history, landed costs and stock. Each connection the system runs itself reports when it last succeeded.
11 · Release process

How a change reaches production.

Discipline that lives in a document is forgotten under deadline pressure. So wherever it can, a check holds it, not a habit.

  • A specification first. Every change starts as a written specification. Each one lives in the repository beside the code it describes, and the code follows it, not the other way round.
  • A failing test first, for money, tax and stock. Margins, VAT, invoice files and reservations are written “red before green”: the failing test comes before the code. Every new check is first broken on purpose, because a test that cannot fail is worse than no test.
  • Contracts over every document page. A test reads the source of every document page and fails if one arrives without its change history, without its links to related records, or outside the shared page layout. The system looks and behaves the same everywhere because a machine checks it.
  • One set of checks on every change. Every change to the main code runs code style, types, the database schema and its migration history, the full test suite against a real PostgreSQL database (not a mock), the build, and validation of outgoing e-invoice files against the tax authority’s official schema.
  • A guarded deploy. The one deploy script refuses to run with uncommitted changes. It checks that the target server is the one it means, by a marker on the server, not a hostname typed by hand. It refuses a release that would carry finished work the roadmap has not released. It records the exact version it published, and afterwards runs the system’s own checks against its real data.
  • A failed release rolls itself back. If the new version does not answer its health check, the deploy puts back the images that ran a minute earlier and stops with an error. A migration is not undone this way: the dump taken before it is the way back.
  • Your build holds only your system. A build may never import another client’s code, and a check at the start of every deploy refuses one that does.
  • The guides come from the tests. The browser scenarios that test the system also take the screenshots for the step-by-step user guides, so a guide shows the screens as they are.
12 · Operations

Operations, and what happens when something breaks.

Every system reports on a health page whether each part is doing its job: the database, the background jobs, each connection to an outside system and when it last succeeded, and the stock against its totals. Every service runs with a memory limit, restarts by itself, and rotates its logs.

What brokeWhat people seeWhat happensExpected time
One application containerNothing, or a few seconds of errorsIt restarts by itselfseconds
The whole serverThe system is downRestore from a disk image, or rebuild a new server with Docker, the edge server and the deploy script15-40 min
Damaged or deleted dataRecords are missing or wrongRestore last night’s backup, or the dump taken before the last release, into a separate database and carry the affected records over. The restore has been run, not only written1-3 hours
An outside service (mail, a carrier, the e-invoicing chain)Some functions take their fallback pathEvery outside service has a stand-in, and each connection reports when it last succeededat once

The alerts come to us, because we run the system. Who does what, on our side and on yours, is on the Trust page.

A question this document
does not answer?

Ask the Project Engineer who builds the system, not a sales team. If the answer belongs in this document, the next edition carries it.

Book a technical review Sign the mutual NDA Edition October 2026 (v.3). Every month the figures are recounted and the sections changed where the system changed.

Which business should the demo show?

Each one opens in a new tab. The data is invented and rebuilt every few hours. No call, no card.

Next: clinic groups and schools, on the same foundation.