ecommerce.kq

A whole model as it is stored — plain text in git, nothing else. Northwind sells to the public and hands parcels to a carrier; this is all of it.

Every reference links to the declaration it points at, so the file can be read the way the model resolves it. Nothing on this page is derived: it is the source Kanoniq parses, shown unchanged.

  • 2 ecosystems
  • 6 domains
  • 4 platforms
  • 16 components
  • 16 connections
  • 17 realizations
1/// Everything Northwind runs to sell to the public: the storefront, the order
2/// pipeline behind it, and the customer record either side.
3ecosystem shop "Northwind Retail" (SHOP) {
4
5 /// Moving a shopper from browsing to a placed order.
6 domain shop-selling "Selling" {
7 function-group browse-catalogue "Browse catalogue"
8 /// Finding a product without knowing its name: facets, synonyms, ranking.
9 function-group search-products "Search products"
10 function-group manage-basket "Manage basket"
11 function-group place-order "Place order"
12 function-group apply-promotions "Apply promotions"
13 }
14
15 /// Everything that happens to an order once it has been placed.
16 domain shop-fulfilment "Fulfilment" {
17 /// Holding stock against an order so two shoppers cannot buy the last one.
18 function-group reserve-stock "Reserve stock"
19 function-group pick-and-pack "Pick and pack"
20 function-group arrange-delivery "Arrange delivery"
21 function-group handle-returns "Handle returns"
22 }
23
24 /// Who the shopper is, what they have told us, and how we answer them.
25 domain shop-customer "Customer" {
26 function-group register-account "Register account"
27 function-group manage-preferences "Manage preferences"
28 function-group answer-enquiries "Answer enquiries"
29 }
30
31 /// The range, the ranging decisions, and the catalogue content behind them.
32 domain shop-merchandising "Merchandising"
33 /// List price, markdowns, and the rules that choose between them.
34 domain shop-pricing "Pricing"
35
36 /// Everything a shopper touches, and the read paths that serve it.
37 platform platform-storefront "Storefront" default {
38
39 /// The public web shop. Listing and product pages are server-rendered;
40 /// basket and checkout are client-side routes.
41 component web-shop "Web Shop" : userFacingApp tech "Next.js" {
42 spa web-shop-ui "Web Shop"
43 }
44
45 /// The iOS and Android shop. Same journeys as the web shop, and the same
46 /// BFF behind it.
47 component mobile-shop "Mobile Shop" : userFacingApp tech "React Native" {
48 mobileApp mobile-shop-ui "Mobile Shop"
49 }
50
51 /// The single front door for the storefront apps. Fans out to the
52 /// catalogue, search and basket services; owns no data of its own.
53 component storefront-bff "Storefront BFF" : backend tech ".NET" {
54 derived httpApi storefront-bff-api "Storefront BFF API"
55 }
56
57 /// Product, variant and category master data. Read far more than written.
58 component catalogue-service "Catalogue Service" : backend tech "Go" {
59 /// Read-only. Catalogue changes arrive from merchandising, not over this API.
60 derived httpApi catalogue-api "Catalogue API"
61 }
62
63 /// Free-text and faceted product search over a denormalised index.
64 component search-service "Search Service" : backend tech "Elasticsearch" {
65 derived httpApi search-api "Search API"
66 }
67
68 /// Holds a basket for a signed-in shopper or an anonymous session, and
69 /// reprices it on every change.
70 component basket-service "Basket Service" : backend tech "Go" {
71 derived httpApi basket-api "Basket API"
72 }
73
74 web-shop -> storefront-bff-api over http
75 mobile-shop -> storefront-bff-api over http
76
77 storefront-bff -> catalogue-api over http
78 storefront-bff -> search-api over http
79 storefront-bff -> basket-api over http
80 storefront-bff -> order-api over http
81
82 /// Pulls product data to rebuild the index. Not on the shopper's read path.
83 search-service -> catalogue-api over http
84
85 web-shop realizes browse-catalogue
86 web-shop realizes manage-basket
87 mobile-shop realizes browse-catalogue
88 search-service realizes search-products
89 basket-service realizes manage-basket
90 catalogue-service realizes shop-merchandising
91 }
92
93 /// Order handling, promotions, stock, and the warehouse behind them.
94 platform platform-orders "Orders" {
95
96 /// Owns the order lifecycle from placement through to dispatch.
97 component order-service "Order Service" : backend tech "Java" {
98 derived httpApi order-api "Order API"
99 }
100
101 component promotion-service "Promotion Service" : backend tech "Java" {
102 derived httpApi promotion-api "Promotion API"
103 }
104
105 component stock-service "Stock Service" : backend tech "Java" {
106 derived httpApi stock-api "Stock API"
107 }
108
109 /// Bought in, runs in the distribution centre, and is the system of record
110 /// for physical stock movement.
111 component warehouse-wms "Warehouse WMS" : cots
112 component returns-portal "Returns Portal" : userFacingApp tech "Mendix" {
113 spa returns-portal-ui "Returns Portal"
114 }
115
116 /// Published once the order is accepted and payment is authorised.
117 derived channel channel-order-placed "Order placed" : topic
118 /// Every physical movement in the distribution centre, picks included.
119 derived channel channel-stock-moved "Stock moved" : topic
120
121 order-service -> promotion-api over http
122 order-service -> stock-api over http
123
124 order-service -> channel-order-placed over serviceBus
125 channel-order-placed -> warehouse-wms over serviceBus
126 warehouse-wms -> channel-stock-moved over serviceBus
127 channel-stock-moved -> stock-service over serviceBus
128
129 order-service realizes place-order
130 promotion-service realizes apply-promotions
131 stock-service realizes reserve-stock
132 warehouse-wms realizes pick-and-pack
133 returns-portal realizes handle-returns
134 promotion-service realizes shop-pricing
135 }
136
137 /// Identity, the customer record, and the people who answer the phone.
138 platform platform-customer "Customer" {
139
140 /// Sign-in, sign-up and tokens. Not the customer record.
141 component identity-service "Identity Service" : saas tech "Auth0" {
142 derived httpApi identity-api "Identity API"
143 }
144
145 /// The customer record, contact history and marketing preferences.
146 component crm "CRM" : saas tech "Salesforce" {
147 derived httpApi crm-api "CRM API"
148 }
149
150 component contact-centre "Contact Centre" : cots {
151 spa contact-centre-ui "Contact Centre"
152 }
153
154 contact-centre -> crm-api over http
155 crm -> identity-api over http
156
157 identity-service realizes register-account
158 crm realizes manage-preferences
159 contact-centre realizes answer-enquiries
160 }
161}
162
163/// A third party. Modelled only as far as Northwind depends on it.
164ecosystem carrier "Parcel Carrier" (CARR) {
165
166 /// Consignments, labels and tracking, from the shop's point of view.
167 domain carr-delivery "Delivery"
168
169 platform platform-carrier "Carrier" default {
170
171 component carrier-api-gateway "Carrier Gateway" : saas {
172 derived httpApi carrier-api "Carrier API"
173 }
174
175 component tracking-service "Tracking Service" : saas {
176 derived httpApi tracking-api "Tracking API"
177 }
178
179 carrier-api-gateway -> tracking-api over http
180
181 carrier-api-gateway realizes carr-delivery
182 tracking-service realizes carr-delivery
183 }
184}
185
  • declaration
  • derived
  • relationship
  • kind and transport
  • name

Back to Kanoniq