Software engineering

One platform, ten products: why we build a modular monolith

How ten products run on one platform: one ledger, one login, modules instead of copies, and why the GoBD principles favour a modular monolith.

The starting point

TWT offers ten products, from TWT Invoice for invoicing and TWT Kasse for the shop counter to TWT One, which brings every module together. Each product has its own address, its own home page and its own price. The obvious approach would be a separate application for each product, and that is exactly what we decided against.

Every product runs on one platform: an API written in Go, one PostgreSQL database, one ledger and one login. Which pages a customer sees follows from the modules their company has booked and never from the address they arrive at.

A product is a selection of modules

Each module, such as invoicing, point of sale, banking or payroll, is a distinct part of the platform with its own pages, its own permissions and its own endpoints. A product only states which modules belong to it. That mapping lives in one single place in the code, and every endpoint checks on every request whether the company has booked the module. A customer who combines invoicing, bank reconciliation and receipt scanning therefore works in one interface rather than three.

The interface is delivered in modules, and the browser loads only the code of the modules in use. A product that grows by fifty components makes the pages of another product not a single byte heavier.

Why not microservices

Bookkeeping sets a strict standard. The German GoBD principles require every entry to be traceable, complete and unalterable, and invoice numbers must be issued without gaps. In a system with one ledger and one database, a transaction holding a database lock guarantees both. Spread across many services with their own databases, every entry would need coordination across system boundaries, and every audit would have to merge several data stores.

The product family adds a second reason. TWT One contains every module, so a split TWT One would again be the whole platform, only spread across more boundaries. A split pays off only once an area has its own team and its own rhythm.

Where we separate on purpose

A monolith does not mean that everything runs in one process. Where a real technical boundary exists, a separate service works from its own repository: identity with signed tokens, document processing with PDF, electronic invoicing and text recognition, and notifications by email and push. Each of these services has a narrow interface, and none of them writes to the ledger.

Should an area one day get its own team, its pages can be taken out and run against the same API and the same login. The ledger is never divided.

One build for test and production

Every change takes the same path. It is built once, named after its commit as an image, and tested on a test environment that matches production in everything except data and access keys. Only when every check has passed does exactly that image go to production, without a new build. What was tested is therefore, byte for byte, what customers work with.

What this means for customers

No customer sees the architecture itself, but every customer sees its consequences. A company can start with one product and later choose a larger package without moving any data. Invoices, receipts and entries live in one system, and the export for the tax adviser or the tax audit comes from a single source.

We develop software for clients on the same principles: first a clear core with a clean data model, then boundaries where they pay for themselves.

Talk about a project

Are you planning an application, an interface or the move to electronic invoicing? Describe your project, and we will reply with a proposal for the next steps.

Start a project