Skip to main content

Architecture

This diagram shows the functional components of the Mosterd Platform and the external systems they work with. It describes responsibilities, not deployment units.

Mosterd Platform architecture: clients reach the API, the business logic service connects the metadata, data, file and script and gateway services, and external systems sit around them

Clients​

  • Browsers use the platform through the content app, the generated web application.
  • Third-party apps call the API directly.
  • Agents always go through the MCP service, a generic service that derives its behaviour from the tenant's data model and uses the API itself.

API and authentication​

All requests except file transfers enter through the API and authentication layer. It authenticates the caller, with OAuth2 tokens issued by an external identity provider (IdP), and establishes the tenant the request belongs to. See Authentication.

Business logic service​

The centre of the platform. It orchestrates every operation: it asks the metadata service what an object means, stores objects through the data service, and hands long-running work to a message queue. Accounts and tenants are managed here too.

It also guards one of the platform's most important guarantees: access control is handled entirely in this service. It decides which labels a user carries and makes sure every read and write respects them.

Metadata service​

Turns the files in a tenant's Git repository, such as company.json, contract.json, invoice.json and createInvoice.js, into a working data model. This is where the model comes to life: the service merges all files and extensions, checks the result for correctness and analyses it in depth, for example how each formula must be interpreted.

The business logic service consumes this model by asking concrete questions, such as what the structure of a company is and how it must be interpreted.

Data service​

Registers objects, their attributes and relations, and the graphs they form, and keeps them searchable. It is completely agnostic about what an object means: that knowledge belongs to the metadata service. It does not know users either, but all data is tagged with labels that say who may reach it.

The no-SQL database is the primary source and holds the full documents. The relational database and the search index hold derived information, used for filtering, sorting and full-text search.

File service​

Stores files, with its own document storage and no-SQL database. Files are never shared with the data service or the metadata service: they travel directly between the clients and the file service, with signed URLs and without OAuth. The only exception is files the platform generates itself, such as those created by a script, which the business logic service hands to the file service.

The business logic service at most asks the file service about a document, such as its text or its invoice interpretation by Document AI.

Script and gateway service​

Runs scripts in its own script engine and connects the platform to the outside world through gateways: BigQuery, email, Gemini, webhooks, public company registers and more. Scripts work with the platform's data, so the connection to the business logic service goes both ways.