• Architecture
  • Reliability

One system, cleanly divided: why Fravolo is a modular monolith

Fravolo runs the counter, the kitchen, the books and the WhatsApp inbox for restaurants in several countries. Behind all of that is one server program, one web app and one database. This post explains why we built it that way, and what that choice means for a restaurant using it.

Fravolo Engineering · 5 min read

Why one program

We settled on this shape in May 2026, before most of the features in these posts existed, and everything since has been built on it.

A restaurant does not care whether our ordering code can grow separately from our billing code. It cares that the bill number is right, that an order only ever moves forwards, and that no other restaurant can ever see its data. Those are questions of being correct, and being correct is much easier when everything runs in one place. There is one set of changes to ship, one log to read, and when something fails, one trail that leads all the way to the cause.

So the server is a modular monolith: a single program made of many separate parts — orders, the counter, billing, the menu, stock, printing, messaging and more. The parts talk to each other directly, not over a network. Nothing can be lost between them, and there is no extra machinery to keep running.

Splitting a system into many services solves a problem of large teams. We do not have that problem yet. The seams are already in the design, so we can cut along them when we do.

Keeping the parts apart

The risk with one program is that everything ends up depending on everything else, and a change in one corner breaks another. We keep two rules.

  • Each part owns its own data. Billing does not read the counter’s records directly; it asks the counter. If a part needs something, it is handed that thing when the system starts, and it cannot reach around to grab more.
  • Dependencies point one way. The counter depends on orders and billing. Orders do not depend on the counter. Where two parts genuinely need each other — an online order has to send a ticket to the kitchen — the lower part describes the small thing it needs, and the two are connected at start-up.

The payoff is that a boundary between two parts is a real boundary. If one part ever has to run on its own, the parts that call it do not need to change. We have not needed that yet.

Background work, kept on a short lead

The same program also does the quiet work no one asks for: closing unpaid website orders, making sure every paid order gets its bill, noticing printers that have stopped, sending birthday messages and the owner’s daily report, and ringing again for an online order nobody has accepted.

Each of those tasks runs separately, with a time limit, and a task that is still busy is skipped rather than started twice. If one task hits a bad record and fails, that one run is lost and logged; the rest of the system carries on taking orders. A slow database query fails visibly instead of quietly holding things up.

Some work must have exactly one owner — each restaurant’s linked WhatsApp number is the clearest example. We designed for that on purpose, and the tasks themselves are written so that two copies would not repeat a message. Adding more machines later is a planned step, not a surprise.

The web app shows things; the server decides

The web app draws everything with a screen: the public site, the back office, the counter, the kitchen display, the waiter’s phone, the printed slips and the guest’s bill page. It does not hold the restaurant’s data or decide anything about it. Every price, tax and permission is worked out again on the server, so a tampered screen cannot change a bill.

One small decision there carries a lot of weight. When the counter cannot reach the server, it gets a clear “unreachable” answer rather than a vague error, and it switches to billing offline. That is where “the internet is down” becomes something the counter can act on, which we wrote about in the invoice-numbering post.

Shipping changes safely

  1. 1Every change runs the full test suite, including tests against a real database: the tests that keep restaurants apart and keep bill numbers in order run on every change, not just before a release.
  2. 2Only a change that passes is built into a release.
  3. 3A release first updates the database, and only then switches to the new version. If the database step fails, the switch does not happen and the old version keeps serving.

Database updates are written so that running them twice does no harm. That lets every release run them every time, which is the only way we trust a step to run at all.

What we gave up

  • A small footprint is also a small margin. Fewer moving parts means fewer things to break, but also less spare capacity sitting idle. We would rather add room before we need it than during a busy Saturday.
  • Background tasks run on a simple clock. Nothing a kitchen needs is finer than about a minute, so a simple timer is enough. It is not a general-purpose scheduler, and it does not pretend to be.
  • Connections made at start-up can be forgotten. If one is missed, a feature quietly does nothing. A test that checks every connection is made would catch that early; if we started again, we would write it on the first day.
Written by Fravolo Engineering, 24 November 2026.