One model.
Every diagram true to it.

Kanoniq keeps your architecture as one model, written as code in plain text files in git. Every element keeps its identity through a rename or a move. The views are generated from the model and point back at it rather than copying it, so no diagram can quietly disagree with another.

Get started (opens in a new tab) Read the docs (opens in a new tab)

storefront.kq

Click a name in quotes and type a new one

platform storefront "Storefront" {

  component checkout ""
    : backend

  component payments ""
    : backend

  component orders ""
    : backend

  checkout -> payments/payments-api over http
  payments -> orders/orders-api     over http
}

canonical model

The model: three components written in the file, and the two interfaces the calls create, each attached to its component Checkout http Payments http Orders

generated views

Layered view: the three components above the two interfaces they provide application components Checkout Payments Orders application interfaces payments-api orders-api Who calls whom: Checkout calls Payments, Payments calls Orders, both over HTTP Checkout Payments Orders

payments-flow.png, drawn

A hand-drawn copy of the dependency view, which keeps the names it was drawn with Checkout Payments Orders
written generated Every view matches the source. Click a name in quotes and type to rename it.

All models are wrong, but some are useful.

George E. P. Box

Why this exists

Architecture diagrams go out of date. Not through neglect — through how the tools are built.

The same component sits in five diagrams. Change it once and four are wrong, so people stop trusting all of them and read the code instead.

In most tools the picture is the record, so the truth is whichever one you opened last. In Kanoniq the record is the model, and a picture is one way of looking at it.

Where to start with Kanoniq

If your team is facing… Start with…
The same system drawn in five diagrams, and no two of them agree One canonical model
Every change means redrawing each diagram it appears in Views generated from the model
The architecture sits in a tool's database, where nobody can diff or review it Plain files in git
Application, process and data models kept in separate tools One model, every notation
Every audience wants its own diagram, and someone has to draw each one Modeling, not drawing (opens in a new tab)

What Kanoniq does

One model, many projections

Point at a wall or the floor. Each holds a different view, and every one is cast from the same model, so when the model moves, every view moves with it.

  • A component renamed from Payments to Billing, its identifier tag unchanged Payments component payments Billing id 7f3c9a2e

    One canonical model

    Every element keeps a persistent identity. Rename it, move it to another file, take it into another tool: the identity holds, and every view follows it.

  • One element in the model, drawn into three generated views Billing layered Billing whole model Billing entity diagram Billing

    Views you don't have to draw

    The layered view of each domain, the whole model through lenses, and the entity diagram of its data are generated from the model as you type. Views you arrange by hand are on the way, and they will reference the same elements rather than copy them.

  • The rename as a one-line diff of storefront.kq storefront.kq +1 −1 component checkout "Checkout" - component payments "Payments" + component payments "Billing" : backend checkout -> payments/payments-api

    Plain files in git

    The model is text you can branch, diff and review alongside the system it describes. It lives in your repository, not ours, and it is parsed and drawn on your machine, with nothing sent anywhere to draw a diagram. Today you write it as code; editing in the diagram, writing back to the same files, comes next.

Why it's opinionated

A modeling language with no opinions is a data format. Kanoniq takes positions.

Only what runs goes in the model. Every element is something you can point at, such as a component, an interface or a database, and the abstractions above them are read off what they group. A Domain Object and a Data Entity are different things, kept apart on purpose. A message always travels through a Channel in a broker you name.

Nothing goes without saying. What a hand-drawn diagram leaves implicit, the model makes you state: nothing is a default and nothing is guessed, and each statement says everything needed to read it.

Rendering a diagram from a graph is not hard. Deciding what goes in which layer, which lines fold together and when two elements become one box takes judgment a generic diagramming tool doesn't have. Kanoniq's views are opinionated because a readable architecture diagram means committing to an interpretation, not because opinions are cheap to add.

Every rule is written down with why it exists, not just what it does, and dated. A tool trusted with how a company thinks about its own systems should be able to show its work, and expect its decisions to be argued with, not just adopted.

What Kanoniq is not

The model is a file you can read

The Northwind example: a retailer's six domains, fifteen components, their data and every connection between them, in one file of 241 lines.

Declarations are highlighted, and each reference links to the declaration it points at: the same identity every view uses. The /// lines are descriptions, kept with the element they describe and shown wherever it is drawn.

ecommerce.kq, lines 86–114 of 241

86 /// Holds a basket for a signed-in shopper or an anonymous session, and
87 /// reprices it on every change.
88 component basket-service "Basket Service" : backend technology "Go" {
89 /// Real but short-lived, and nothing outside depends on it.
90 sql basket-db "Basket DB" {
91 root basket authoritative origin transient
92 identifier "Basket Id"
93 property "Updated at"
94 }
95 }
96
97 web-shop -> storefront-bff/storefront-bff-api over http
98 mobile-shop -> storefront-bff/storefront-bff-api over http
99
100 storefront-bff -> catalogue-service/catalogue-api over http
101 storefront-bff -> search-service/search-api over http
102 storefront-bff -> basket-service/basket-api over http
103 storefront-bff -> platform-orders/order-service/order-api over http
104 storefront-bff -> platform-customer/identity-service/identity-api over http
105
106 /// Pulls product data to rebuild the index. Not on the shopper's read path.
107 search-service -> catalogue-service/catalogue-api over http
108
109 web-shop realizes shop-selling/browse-catalogue
110 web-shop realizes shop-selling/manage-basket
111 mobile-shop realizes shop-selling/browse-catalogue
112 storefront-bff realizes shop-selling
113 search-service realizes shop-selling/search-products
114 basket-service realizes shop-selling/manage-basket
  • declaration
  • relationship
  • kind and transport
  • flag
  • name
  • date and period
  • description
Read the whole file

Edit where you already write code

The VS Code extensions check a .kq file as you type, rename a name across every file of the model, and draw the diagram beside it, kept live with every keystroke.

Get the VS Code extensions

Take the model out again

Export is one-way on purpose. Kanoniq holds the model; other tools receive a copy of it, and nothing writes back into it.

That constraint is what keeps the model canonical. A two-way sync means two things can both claim to be right, and reconciling them is a problem nobody solves well. An export is a copy that is correct at the moment it is written, carries the identifiers it came from, and makes no claim to be the source.

The storefront model exported one way to a view in ArchiMate's notation, to BPMN later, and to an entity diagram, each copy carrying Billing's identifier; an arrow back into the model is struck out storefront.kq Checkout Billing 7f3c Orders View, SVG and PNG Checkout Billing 7f3c Orders BPMN, later Checkout Billing 7f3c Orders ERD Order id placed at status Payment id amount order id owned by Billing 7f3c nothing writes back
KQ
  • SVG
  • PNG
  • JSON
  • SVG and PNG working

    Any view as an image file, from the same layout the editor draws. The same model gives the same SVG every time, and every box and line in it carries the identifier of what it draws.

  • Model JSON working

    The whole model in one JSON file, nothing lost, checked against a published JSON Schema: the form other tools and scripts read.

Where it stands

Kanoniq is built in order: the model first, because everything else rests on it, then each layer on top of the one before.

  1. The model and its language working

    The metamodel, the .kq language with persistent identity and validation, the kq command line, and the VS Code extensions.

  2. Generated views working

    The layered view of each domain, the whole model through lenses, the entity diagram, SVG and PNG export, and a browsable site of pages built from the model.

  3. Editing in the diagram next

    Create and change elements and relationships in the diagram, written back to the same files, and views you arrange by hand over the same elements.

  4. Documentation and the Marketplace after that

    Documentation kept beside the elements it describes, and the extensions on the Marketplace.

The language, the command line, the VS Code extensions and the first views work today.

Get started (opens in a new tab) Read the docs (opens in a new tab)

One solid plate of three elements above two dashed plates, each showing a subset of the same elements