
One general ledger, many sources: how LIKVID is built
The till, the warehouse, the tax authority and the bank all send data at different times and in different forms. The general ledger has to build a single, verifiable state from all of it. Here are the layers LIKVID is made of, and what each one guards.
Contents
LIKVID is DataEdge's general ledger module: double-entry bookkeeping, customer and supplier ledgers, cash management, VAT returns, fixed assets, accruals and foreign-currency accounting. Most of its data comes from elsewhere. HERMES issues the invoices, the partner master lives in ATLAS, incoming invoices come from the Hungarian Tax Authority (NAV), statements from the bank and exchange rates from the central bank. The ledger's job is to build a single state from all of this that can be reconciled, with nothing lost and nothing entered twice.
Four clearly separated layers work together to do that.
Four layers, four responsibilities
Layer | Technology | What it guards |
|---|---|---|
Interface | SvelteKit, TypeScript | Presentation. It does no financial calculation. |
Business logic | Python, FastAPI, Pydantic | Accounting rules, permissions, validation |
Database | PostgreSQL | Balance, closed periods, mandatory dimensions, enforced by triggers |
Sync | Go service with its own staging store | Taking over data from source systems, with retries |
Stylised view.
The interface is thin on purpose. Margin, rounding, VAT deductibility and signs are calculated by the backend; the browser only shows the result. The same number therefore appears on screen, in the export and in the auditor's view.
The business logic is organised into services. The HTTP endpoints only check permissions and input; the work is done by one canonical service for each task. Every module, for example, creates general ledger entries with the same builder.
The database is the third line of defence. If a call somehow bypassed the application's checks, a PostgreSQL trigger would still stop an entry posted into a closed period, and a posting without its mandatory dimension.LIKVID · layersThe interface shows, the backend calculates, the database guards. Each rule lives in one place.
The sync runs on its own scheduler
Data from the source systems is taken over by a service written in Go. It is not started by the server's timer: every company and every command gets its own scheduler, with the interval taken from a settings table. The logic is simple:
a separate scheduler for every (company × command) pair:
before the first run: wait until the backend is healthy
repeat at the configured interval (at least 30 s):
if the previous run is still going → skip this round
if the command is switched off → wait
refresh the settings; if the interval changed, adjust to it
run → record last run, status and next runTwo small details save a lot of trouble. On deployment the sync waits for the backend to respond, so the first round does not fail just because both services started at the same time. And runs never overlap: if a slow round is still going, the next one is skipped, and the same processing never starts twice.
The monitoring screen shows, for each command, the last run, its result and the next scheduled run, and an immediate run can be requested with one button. How the sync copes when the other side is not responding is a subject of its own.
Several companies, strictly separated
One LIKVID installation can keep the books of several companies. Each company has its own database, and on every request the backend explicitly requires the caller to name the company whose data it is working with. Without that, there is no database access. There is no default company, so a forgotten parameter cannot put data in the wrong place.
The sync also runs per company. Company settings are loaded from a configuration file, and loading can be repeated. At one point it is deliberately cautious: it does not overwrite an existing company's tax authority credentials or active status. NAV access therefore cannot be replaced by a deployment step that is run again. The API never returns secrets, and they are masked on the monitoring screen.
External access: read only, and only what is allowed
Sometimes another program needs to query customer receivables or cash movements. For this LIKVID has a separate, read-only API, kept entirely apart from user login. Every request passes through the same gate:
def require_scope(scope: str):
def check(request, raw_key: str | None = Header(None, alias="X-API-Key")):
if not raw_key:
raise HTTPException(401, "Missing API key")
key = find_active_key(sha256(raw_key)) # constant-time comparison
if key is None:
raise HTTPException(401, "Unknown key")
if scope not in key.scopes:
raise HTTPException(403, "This key grants no access to this data scope")
if rate_limit_exceeded(key.id, key.per_minute):
raise HTTPException(429, "Too many requests")
audit("external_api", key=key.name, path=request.url.path)
return key
return checkThe key is never stored or logged in plain text, only its hash. Each key is limited to its own data scopes: a key granted receivables cannot see cash movements. The per-minute limit can be set per key, a key can be disabled instantly with a switch, and you can see when it was last used. External developers get their own, narrowed API documentation that lists only these endpoints.
A trail is left, and that is the point
In accounting, "who did what, and when" always needs an answer. For every significant change, the audit log records the user, the time, the table, the record, the operation, and the old and new values. The log only grows; it cannot be rewritten afterwards.
Logging runs through every level of the system:
Request log: every HTTP request gets a unique ID, and tokens are masked in the structured log.
Client-side errors: errors raised in the browser also reach the central log.
Live refresh: after a successful change, other signed-in users' screens refresh.
Data fixes: maintenance scripts start as a dry run by default and roll everything back at the end. Writing to live data needs a separate switch, and many scripts also check the database name before changing anything.
Releases and schema: a controlled path
Every database schema change lives in a timestamped migration file, and every environment records which ones it has already run. A CI step checks that the schema and the migrations agree. Releases are made by tag: the build only starts after the backend tests pass, and if a new test touching a financial engine has been left out of the CI list, the pipeline flags it.
None of this is spectacular. In a financial system, modern technology is good because it is predictable: the same input always gives the same posting, and if something does differ, you can find out where.
Related: When the other system is not responding · The guardians of the general ledger