Skip to main content
Version: 0.4.1

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.

Start from the systems people name​

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:

ecosystem shop "Shop" { platform storefront "Storefront" { component web-shop "Web Shop" : user-facing-app } monolith erp "ERP" : cots { module accounting "Accounting" : grouping { component ledger "Ledger" : backend } } }

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.

Add the components​

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:

ecosystem shop "Shop" { platform storefront "Storefront" { component web-shop "Web Shop" : user-facing-app technology "Next.js" component order-service "Order Service" : backend technology ".NET" component payments "Payments" : saas component send-reminders "Send reminders" : job schedule daily at 08:00 Europe/Amsterdam } monolith erp "ERP" : cots { module accounting "Accounting" : grouping { component ledger "Ledger" : backend } } }

A job runs on a schedule and nothing calls it: send-reminders runs every morning at eight. See Component kinds and Jobs and robots.

Say how each is reached​

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:

ecosystem shop "Shop" { platform storefront "Storefront" { component web-shop "Web Shop" : user-facing-app technology "Next.js" { spa web-shop-ui "Web Shop" } component order-service "Order Service" : backend technology ".NET" component payments "Payments" : saas component send-reminders "Send reminders" : job schedule daily at 08:00 Europe/Amsterdam web-shop -> order-service/orders-api over http auth user-token order-service -> payments/payments-api over http auth key send-reminders -> order-service/orders-api over http auth client-credentials } monolith erp "ERP" : cots { module accounting "Accounting" : grouping { component ledger "Ledger" : backend } } }

Declare an API only to give it a name, a schema or versions. See Interface, and Model integration for the connections.

Say which function each carries out​

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:

ecosystem shop "Shop" { domain selling "Selling" { function place-order "Place an order" function remind "Remind customers" } domain finance "Finance" { function pay "Take payments" function book "Keep the books" } platform storefront "Storefront" { component web-shop "Web Shop" : user-facing-app technology "Next.js" { spa web-shop-ui "Web Shop" } component order-service "Order Service" : backend technology ".NET" component payments "Payments" : saas component send-reminders "Send reminders" : job schedule daily at 08:00 Europe/Amsterdam web-shop -> order-service/orders-api over http auth user-token order-service -> payments/payments-api over http auth key send-reminders -> order-service/orders-api over http auth client-credentials web-shop realizes selling/place-order order-service realizes selling/place-order primary order-service realizes finance/pay payments realizes finance/pay send-reminders realizes selling/remind } monolith erp "ERP" : cots { module accounting "Accounting" : grouping { component ledger "Ledger" : backend } accounting/ledger realizes finance/book } }

Without the mark, a component realizing into several domains is KQ046. See Realization, and Model what the organization does for the functions.

See what you modeled​

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
  • Order Service → Payments: connection, http · key
  • Send reminders → orders-api: connection, http · client-credentials

In VS Code, the viewer draws it as you type. See Layered view.

Where next​

© 2026 Extenza Works. All rights reserved.