Case study

Datrix: Generating a Microservices Platform

Describing a whole e-commerce platform once, and compiling it into consistent services instead of writing them one by one.

SunFox productCompiler & code generationPython + TypeScript

1Problem

The first microservice is always easy. By service four, after new developers join and requirements shift, services drift apart: one returns snake_case fields and another camelCase, a user ID is a UUID in one service and an integer in another, and auth middleware is wired three different ways. A cross-service change, such as adding Kafka events everywhere, touches every service.

2Approach

We built Datrix, a compiler for backends. The whole system is described once in a purpose-built DSL, and then:

  1. A real lexer, parser, and AST validate the spec, including cross-service types and event contracts, before any code is emitted.
  2. Application generators produce FastAPI (Python) or NestJS (TypeScript) services, SQL schemas and migrations, and config and docs.
  3. Platform generators add Docker, AWS (CDK, CloudFormation) or Azure (Bicep, ARM) infrastructure, and Angular and Flutter clients.

3Result

An e-commerce platform described in seven .dtrx files compiles into 1,595 production files, with 16× less code to write and maintain. The same input always produces the same output, and a change in the spec updates every service that references it, with matching migration scripts.

Have a similar problem?

Book a free 30-minute call with the architect who would do the work, and we'll talk through what it would take.