Getting Started

One command to a running, seeded mako: `just dev` builds and starts every service with the Desk and fills one Stadtwerk; `just demo` runs the released images without Rust.

View as Markdown

On this page 5 sections

Two commands start mako. Both run the same world — Stadtwerke Musterstadt, Netzbetreiber, Lieferant and Messstellenbetreiber in Strom and Gas in one tenant — and both fill it through the services' public APIs, so the Desk opens on work to do.

NeedsWhat runs
just devDocker, Rust (rustup), Node for the DeskPostgreSQL in Docker; every service built by cargo and run on this machine; the Desk under Vite
just demoDockerThe released images of every service and the Desk, one published port

Check the machine

git clone https://github.com/hupe1980/mako.git
cd mako
just doctor

just doctor checks what just dev needs and names every miss with the command that fixes it: Docker running with Compose v2, the toolchain rust-toolchain.toml pins, curl, perl and python3, Node for the Desk (optional), the ports in deploy/ports.toml plus 5432 and 5173 free, and the disk — target/ grows to about 100 GB, so it warns below that. Then it prints one line per daemon's configuration, ready or blocked (Einrichtung explains the findings).

just dev — the estate on this machine

just dev
  1. PostgreSQL starts in Docker (deploy/dev/compose.yaml), one database per service, created by deploy/postgres/init.sql.
  2. Every service and the seeder are built with cargo. The first build takes 15–30 minutes; later ones take seconds.
  3. Each service runs its configuration deploy/demo/<service>.toml, rewritten into target/dev/ so its peers and its database are reached on 127.0.0.1. Every log line carries the service's coloured name, and each log is also written to target/dev/<service>.log. marktd starts first, agentd last, because it connects to every other service's MCP endpoint.
  4. The seeder fills Stadtwerke Musterstadt (below).
  5. The Desk starts under Vite on http://localhost:5173 against the running services.

It ends with the URLs, the token command and the time it took. Ctrl-C stops the services and keeps the data; the next just dev builds incrementally and does not seed twice. just dev-down removes the database.

OptionEffect
just dev --no-deskwithout the Desk
just dev --no-seedan empty estate
just dev --ciheadless: start, seed, verify, stop — what the CI job runs

A service that does not become ready stops the run with the last lines of its log. A changed service is a Ctrl-C and just dev away.

The seeded Stadtwerk

tools/mako-seed writes the world through the same REST routes and the same EDIFACT door an integrator uses, judged by the same checks and Cedar policies. Every step is keyed on a natural key, so just seed can run again and changes nothing.

WhatWhere it shows
Marktlokationen with their Messlokationen, MSB and grid record, and the Netzbetreiber's Preisblattmarktd
A UTILMD 55001 from Nordlicht Energie, decided Accept (E_0622 → A51) and answered with the 55002processd, makod
A 55001 from Musterstadt Energievertrieb, the Stadtwerk's own supplier, held for a person (§ 20 Abs. 1 EnWG parity)processd — the Desk's Freigaben
A 55001 on a Marktlokation with no supply record, escalated as a Klärfall (E_0622 Prüfschritt 50)processd — the Desk's Heute
A 9.8 kWp rooftop plant and its June 2026 feed-in, 2880 kWh, settled at EUR 233.568 under § 21 EEG 2023einsd, edmd
Erika Mustermann's household contract, its January invoice (111.33 netto, 132.48 brutto), the issued PDF, the Offener Posten and the payment that closes itvertragd, billingd, outputd, accountingd
Clara Sommer's online order: the frozen Endkunden-Angebot, the legal documents and the contract with its Bestellnachweisproductd, vertragd
Twelve more households with contracts and last month's daily readings, one of whose invoices the risk gate holds for reviewvertragd, edmd, billingd
The Stadtwerk in Gas on its own DVGW-Codenummer: six Gas Marktlokationen with Messlokation, MSB and supply record, and Hannah Brandt's Gas contractmarktd, productd, vertragd
A Gas NN-Rechnung (INVOIC 31002) from Gasnetz Nachbarstadt at 1.42 ct/kWh where its Preisblatt publishes 1.12 ct/kWh, disputedinvoicd — the Desk's invoice disputes
A UTILMD with a Prüfidentifikator no Anwendungsübersicht publishes, dead-letteredmakod — the Desk's dead letters
A KAV-Grenzpreis for 2024, synthetic demo data that names the seed file as its source — never a published figuremarktd Referenzreihen
just seed --verify

--verify asserts the outcomes, not status codes — the decision and its Antwortcode, the kWh and the Vergütung, each invoice line to the cent, the document, the closed receivable — and that each Desk view the seed fills has rows.

Personas and tokens

The demo configurations set [oidc] mode = "demo": a service accepts tokens signed by the published development key, and its configuration check reports that as a warning. The Desk's account menu switches between the personas; on the command line, just token prints one:

PersonaRoles
nb — Sachbearbeitung NetzNB
lf — Sachbearbeitung VertriebLF
admin — Administration (the default)NB, LF, MSB, ESA, ADMIN
agent — AgentNB, LF, MSB
TOKEN=$(just token lf)
curl -s http://127.0.0.1:9780/api/v1/vertraege -H "Authorization: Bearer $TOKEN"

Each request is decided by the same Cedar policies as in production. A configuration without mode = "demo" refuses to start against an issuer that publishes the development key. makod is reached with its API key (deploy/demo/makod.toml, [http] auth_keys).

Watch the events

just listen

subscribes to marktd's fan-out — every CloudEvent of the estate passes through it — verifies each delivery's Standard Webhooks signature and prints it as it arrives. Ctrl-C removes the subscription.

Every service

Each service answers on its port from deploy/ports.toml, at http://127.0.0.1:<port>: /health/ready, /api/v1/openapi.json, /mcp.

ServicePortServicePort
makod8080productd9080
marktd8180einsd9180
invoicd8280billingd9280
edmd8380accountingd9380
processd8580portald9480
netzbilanzd8680agentd9580
vertragd9780outputd9880

PostgreSQL is postgres://mako:mako@127.0.0.1:5432/<service>.

A configuration problem is reported in one go — the file read, the environment prefix (MARKTD_, nested keys joined with __) and every missing, unknown or invalid key:

cargo run -p marktd -- --help                                              # usage, reads no config
MARKTD_CONFIG=deploy/demo/marktd.toml cargo run -p marktd -- --check-config  # every finding with its path

just demo — no Rust needed

just demo

starts the released images of the version this checkout carries (ghcr.io/hupe1980/mako-<service>): PostgreSQL, every service, the Desk and a seed container that fills and verifies the same Stadtwerk. One port is published: open http://localhost:8000. The Desk's edge routes each /svc/<service>/ to its service with the token of the persona chosen in the account menu; just token <persona> prints the same tokens for curl.

just demo --build builds the images from this tree instead of pulling them — budget 20–45 minutes cold. just demo-down stops it and removes its data. just listen subscribes through the demo's edge when it is running.

The Desk alone

just dev-ui

runs the Desk on its recorded answers (desk/fixtures) — Node only, no Rust, no Docker.

Next steps

TopicGuide
Configuration findings and the deployment checklistEinrichtung
EDIFACT parsing and validationParsing guide
ERP integration — CloudEvents, HMACERP integration
makod operator referencemakod guide
marktd operator referencemarktd guide
processd — NB STP + LF answer automationprocessd guide
INVOIC plausibility, § 147 AO / GoBDinvoicd guide
Energy data, imbalance, billing periodsedmd guide
Process read model, § 7a Abs. 5 EnWG parityprocessd guide — process read model
Full system architectureArchitecture
Process catalogue (GPKE, WiM, …)Processes
Building, testing and the gateCONTRIBUTING.md

Edit this page ↗