This is unreleased documentation for Kanoniq docs Next version.
For up-to-date documentation, see the latest version (0.4.1).
Version: Next
Model the applications
Say which systems the organization runs, what each one is, how people and software reach it, and which functions it carries out. The guide grows one small model, a shop, a step at a time, and every step is a whole model that builds with no error or lint: type it into model/ in a repository kq init made, and check it with kq validate or in VS Code as you type. Every statement used here is described in full in Applications.
Write a platform for a product or system made of separately deployed components, and a monolith for one system with at least one single tier, such as an ERP or a mainframe. A monolith's kind is required: custom for one you build, saas for one you subscribe to, cots for one you buy and run.
The shop has a storefront it builds and an ERP it bought:
A monolith's parts are modules, grouping or deployable, and modules don't nest: the ERP's accounting part is a module that groups its ledger. See Platform, monolith and module.
A component is something that runs. Its kind after : is required, and says what it is: backend, user-facing-app, saas, cots, integration, job or robot. What it runs goes in technology, which is optional. Add the order service, the payment provider the shop subscribes to and a job that sends reminders:
A user interface is always declared, in the component that serves it, or in the platform when no component does: the web shop serves web-shop-ui. An API usually needs no declaration: a connection that names it creates it, so orders-api and payments-api exist once a connection names each. A connection also says how its caller authenticates, after auth: user-token carries the signed-in user's identity on, key is a shared secret the caller stores, and client-credentials is the caller's own token:
realizes joins a component to a domain, function group or function in the same ecosystem. A component whose realizations lead to several domains marks one of them primary, the domain it belongs to. Add the two domains and a realization for every component; the order service serves both, and belongs to Selling:
ecosystemshop"Shop"{domainselling"Selling"{functionplace-order"Place an order"functionremind"Remind customers"}domainfinance"Finance"{functionpay"Take payments"functionbook"Keep the books"}platformstorefront"Storefront"{componentweb-shop"Web Shop":user-facing-apptechnology"Next.js"{spaweb-shop-ui"Web Shop"}componentorder-service"Order Service":backendtechnology".NET"componentpayments"Payments":saascomponentsend-reminders"Send reminders":jobscheduledailyat08:00Europe/Amsterdamweb-shop->order-service/orders-apioverhttpauthuser-tokenorder-service->payments/payments-apioverhttpauthkeysend-reminders->order-service/orders-apioverhttpauthclient-credentialsweb-shoprealizesselling/place-orderorder-servicerealizesselling/place-orderprimaryorder-servicerealizesfinance/paypaymentsrealizesfinance/paysend-remindersrealizesselling/remind}monolitherp"ERP":cots{moduleaccounting"Accounting":grouping{componentledger"Ledger":backend}accounting/ledgerrealizesfinance/book}}
A Domain's layered view answers what the Domain does and which components do it: its functions above, the components that realize them below. Selling's, drawn from the last step:
The diagram in words
Selling · Layered application view
Ecosystem
Shop (Ecosystem)
Domains
Selling (Domain)
Domain Components
Storefront (Platform)
Web Shop (User-facing app)
Web Shop (SPA): no line on this view reaches it
Order Service (Backend)
orders-api (HTTP API)
Send reminders (Job)
Components
Payments (SaaS)
Domains
Finance (Domain)
Ecosystems
Shop (Ecosystem)
Lines
Web Shop → orders-api: connection, http · user-token