Bookshop
Map
The atlas's root: the bookshop's systems and the people and partners around them. Each card opens the view that tells its part of the business.
An online bookshop modelled end to end as one model: a map of its systems and the people around them opens into its C4 views, the shopper's use cases, buying a book step by step, its components and sales domain, an order's life, the database, the data flows, fulfilling and paying, the order's way from basket to courier in BPMN, returns, the deployment in production and on three clouds, and the plan for opening the shop. The same names run through every view.
Map
The atlas's root: the bookshop's systems and the people and partners around them. Each card opens the view that tells its part of the business.
C4
The system context: the shopper and the shop staff as people, the bookshop as the system, and the payment provider, the email service and the courier as external systems.
Use case
What a shopper does with the shop: use cases inside the online bookshop's boundary, with include and extend relationships and a member who is a kind of shopper.
C4
The containers inside the bookshop's boundary, the storefront, the shop API, the order worker, the database and the order queue, each with its technology.
C4
The shop API's components: the catalogue, checkout, accounts and sign-in, the payment client and the order store.
C4
Placing an order as a C4 dynamic view: numbered steps from the shopper through the storefront, the API, the payment provider and the queue to the courier.
Interaction overview
Buying a book as an interaction overview: find a book, check out, a decision on whether payment was accepted, then the receipt and the queued order in parallel.
Sequence
Finding a book: the shopper searches through the storefront and the API answers.
Sequence
Checking out: the storefront calls the API, which asks the payment provider to charge the card.
Sequence
Emailing the receipt: the API sends it through the email service to the shopper.
Sequence
Queueing the order: the API puts it on the queue and the order worker takes it.
Component
The bookshop's components and their Orders and SignIn interfaces, the information that flows between them, and the image the shop API manifests in.
Class
The sales domain as classes: Customer, Order, OrderLine, Book, the Payable interface, Payment and CardPayment, the OrderStatus enumeration and Money, with a note on the order's total.
Class
The same domain filtered to payments: Order, Payable, Payment and CardPayment.
State machine
An order's life as a state machine: placed, a choice on whether it was prepaid, fulfilling with picking and capturing payment between a fork and a join, in delivery with a shallow history state, cancelled with a terminate, and delivered.
Object
Order 1042 just after it was placed: Ada's order, its two lines, the books Middlemarch and Frankenstein, and the card payment, as objects with their slots.
Package
The bookshop's packages, shared, catalog, sales and payments, with their imports and a merge, a wholesale package with an Order of its own, and the conventions profile applied.
Profile
The modelling conventions as a profile: the entity and aggregateRoot stereotypes on Class, owned and column on Property, applied to the sales package's Order.
Composite structure
Inside OrderService: its ports, its parts checkout, pricing, orders and listeners, and a publish-subscribe collaboration for the order events.
Information flow
What travels with an order: the order, the card details, the receipt and the stock level, conveyed between the shopper, the storefront, the API, the payment provider, the warehouse and the email service.
Entity-relationship
The bookshop's database: customer, order, order_line, book, author, book_author and payment, with their keys and cardinalities.
Data flow
The bookshop at level 1 of a data flow diagram: take order, take payment and ship order, the books and orders stores, and the shopper, the payment provider and the courier.
Data flow
Take order, one level down: check the basket, total the order and record it, with the same stores and the shopper.
Activity
Fulfilling an order as an activity in swimlanes for the order worker, the warehouse and the email service: a stock check with a restock loop, payment and packing in parallel, and the handover to the carrier.
Activity
Take payment, the action fulfilling calls: charge the card, then record the payment on the order.
Timing
One charge on a timeline: the order worker's and the payment provider's states while a card is charged.
Sequence
Checkout as a sequence: the shopper, the storefront, the API, the payment provider and the receipt, with the calls and replies of a paid order.
Communication
The same checkout as a communication diagram: the lifelines as objects with numbered messages, for the case where payment is accepted.
BPMN
From order to shipment in BPMN: pools for the shopper, the bookshop and the payment provider, a payment timeout on a boundary event, a gateway on whether the order was paid, invoicing and packing in parallel, the courier's pickup timer, data, a group and the message flows between pools.
BPMN
Pick and pack, the subprocess the order-to-shipment process calls: pick the books, then pack and label the parcel.
Flowchart
Handling a returned book as a flowchart: reading the slip, inspecting the book, a decision on whether it is fit for resale, the refund, the stock records and a connector.
C4
The production deployment in C4: the user's device and browser, the web server, the Docker Compose host running the shop API and the order worker, and the database server.
Deployment
Production as a UML deployment diagram: devices, execution environments, the artifacts deployed on them and the components they manifest.
Mindmap
The plan for opening the bookshop as a mindmap: the catalogue, the website, the launch, the warehouse, legal and money, and three ways to host it.
Google Cloud
The bookshop on Google Cloud: a project with DNS, a load balancer, a CDN, storage for the storefront, a queue, the API and the worker in a region, and the database across two zones.
Azure
The bookshop on Azure: a resource group with routing, monitoring, storage, a queue and secrets, and a virtual network with subnets for the apps and the database.
AWS
The bookshop on AWS: DNS and a CDN, a region with storage, a queue, email and monitoring, and a VPC across two availability zones with public and private subnets.