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
generated views
payments-flow.png, drawn
All models are wrong, but some are useful.
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.
-
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.
-
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.
-
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.
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
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.
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.
-
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.
-
The model and its language working
The metamodel, the
.kqlanguage with persistent identity and validation, thekqcommand line, and the VS Code extensions. -
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.
-
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.
-
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)