Merlive

Architecture diagrams

A service is a box with its icon, a group is a group, and the sides an edge leaves by say which way the diagram runs. Held to the same measure.

Declared with architecture-beta. Of 28 features Mermaid documents for an architecture diagram, 17 drawn as written, 11 drawn less something. See all 28 drawn both ways, or draw one yourself.

Mermaid
Architecture diagram, as Mermaid draws it
Merlive
Architecture diagram, as Merlive draws it

What is read

architecture-beta (and architecture, as a later Mermaid has it) is read into the same boxes and links as a flowchart, so everything else on this page holds for it: the rules, the design, Merlive's own lines.

WrittenRead as
service api(server)[Orders API]A service: a box with its title for its words and its icon beside them
service api[Orders API], service api(server)A service with no icon is a box with its words alone; one with no title takes its id for its words
service api(server)["Orders API, version 2"]A title in quotes may hold what a bare one may not
(cloud), (database), (disk), (internet), (server)The icons Mermaid is born with, each in Merlive's own drawing. A service with database or disk is of the kind that holds data, as a flowchart's cylinder is
(logos:aws-lambda)An icon from a pack is somebody's mark, which Merlive neither fetches nor draws: it is left out, the words are kept, and it is said once for each such icon. A name from a set Merlive knows (fa:fa-key) gets its drawing
group cloud(cloud)[Azure], group office[Head office]A group, drawn as a frame with its title. Its icon is read past
service api(server)[Orders API] in cloud, group net(server)[Network] in cloudWhat is in a group, and a group inside a group, to any depth. A group may be declared after what is in it
junction split, junction split in cloudWhere edges meet and part: a dot, of the kind junction
api:R -- L:dbAn edge: a link with nothing at either end
shop:R --> L:api, api:R <-- L:db, api:B <--> T:erpAn arrowhead on the service it points into: the second, the first, or both
api:R -[saves to]- L:db, api:R <-[reads and writes]-> L:dbThe words on a link
The sides, T, B, L, RRead for order, not for place. The link runs from the first service when it leaves by its right or its bottom, and from the second when by its left or its top, so what an author put first comes first. The diagram runs left to right when more edges leave by a left or a right side than by a top or a bottom, and top to bottom otherwise. Where each box sits, and which side a line meets, is by rule
db{group}:R --> L:erp{group}A link out of a group or into one is drawn from the service it names, and that is said once: a line ends at a box, not at a frame
one:R --> L:two, where both are groupsMermaid cannot draw it. It is joined as a flowchart's link to a group is: from the end of one to the start of the other
align row a b c, align column a b cRead past: where a box goes is by rule
title Where an order is kept, title: in front matterThe picture's title, drawn above a still picture and as the heading of a page
accTitle, accDescr, %% comments on a line or after one, config: in front matterAs in a flowchart
An id with a hyphen (orders-api)In Merlive's own lines it is the id with _ for the hyphen (orders_api), and a number after it if that is taken

Said in a note, line when met, each with what to do: an id declared twice (the first is kept); a service or a group said to be in a group that is never declared, or in something that is not a group (it is drawn in no group); two groups each inside the other; a group with nothing in it (it is not drawn); an edge that names something never declared (it is drawn as a box named by its id). A line that is none of the above is said with its line number and nothing is drawn from it.

Feature by feature

Every feature Mermaid’s own pages set out for an architecture diagram, each with a sample of it in the corpus. A sample is drawn when every box, link and word it has is read and every rule passes. Drawn, less something is the same with one thing known to be missing, named beside it.

FeatureResultWhat is missing
Services, each with an icon and a title, and an edge between themDrawn
The icons Mermaid is born with: cloud, database, disk, internet, serverDrawn, less somethingA disk is drawn with the database's drawing: Merlive has no drawing of a disk of its own yet
An icon from a pack by its name (logos:aws-lambda)Drawn, less somethingAn icon from a pack is somebody's mark, which Merlive neither fetches nor draws: the words are kept, and it is said
A service with no iconDrawn
A service with no titleDrawn, less somethingA box says something: a service with no title takes its id for its words, where Mermaid draws the icon alone
A title in quotes, with what a bare title may not holdDrawn
Ids with a hyphen and an underscoreDrawn
A group, the services in it, and one outside itDrawn, less somethingA group's icon is not drawn: a frame is named by its title
A group inside a groupDrawn, less somethingA group's icon is not drawn: a frame is named by its title
A group declared after the services said to be in itDrawn, less somethingA group's icon is not drawn: a frame is named by its title
A group with no iconDrawn
Edges that leave by every side: right to left, left to right, bottom to topDrawn
An edge that leaves by the top and meets a sideDrawn
Arrowheads: into the second, into the first, into bothDrawn
Words on an edgeDrawn
Words on an edge with arrowheadsDrawn
Edges written with no spacesDrawn
An edge out of a group and into a group ({group})Drawn, less somethingA link out of a group is drawn from the service its author named, not from the frame: a line ends at a box. A group's icon is not drawn: a frame is named by its title
An edge from a service to itselfDrawn
A junction: where edges meet and partDrawn, less somethingA junction is drawn as a round box with no words, the size of every other box, not as the point where lines meet
A junction in a groupDrawn, less somethingA junction is drawn as a round box with no words, the size of every other box, not as the point where lines meet. A group's icon is not drawn: a frame is named by its title
Services lined up in a column (align)Drawn, less somethingLining services up in a row or a column is read past: where a box goes is by rule. A group's icon is not drawn: a frame is named by its title
A title written in the diagramDrawn
Front matter: a title, and Mermaid's own settingsDrawn
accTitle and accDescr, on a line and over severalDrawn
Comments, on a line of their own and after a lineDrawn
A diagram whose edges run top to bottomDrawn
A whole diagram: groups in groups, services, a junction, edges with arrowheads and wordsDrawn, less somethingA junction is drawn as a round box with no words, the size of every other box, not as the point where lines meet. A link out of a group is drawn from the service its author named. A group's icon is not drawn: a frame is named by its title

Written from skills/merlive/reference.md in the repository, so the two cannot disagree.

Before: C4 diagramsNext: Block diagrams