Diagrams / Mermaid Architecture Diagram: Syntax & Examples

Mermaid Architecture Diagram: Syntax & Examples

Explore Mermaid architecture syntax with an editable service diagram. Understand groups, connection endpoints and the boundaries of an architecture view.

When to use Architecture Diagram

Use a Mermaid architecture diagram to show services, resource groups, and their connections. It is useful for explaining the boundaries of a deployed system. Decide whether each link means communication, dependency, or ownership and state that meaning in the diagram’s surrounding text.

Read the Architecture Diagram example

Diagram source

architecture-beta
  group app(cloud)[Customer portal]
  service web(internet)[Browser]
  service api(server)[API] in app
  service db(database)[Database] in app
  web:R --> L:api
  api:R --> L:db
The browser reaches an application service, which connects to a data store. A group makes the system boundary explicit. The connectors explain relationships; they do not prove that a network path exists in a running environment.

How to use this tool

  1. Start with the example in the editor and identify the elements that answer your question.
  2. Replace the sample labels and values, previewing after each structural change.
  3. Review the diagram at its intended reading size, then keep the source and export the format your document accepts.

Syntax and interpretation

ConceptHow to apply it
DeclarationStart with architecture-beta. Resource groups and services have distinct IDs.
ConnectionsConnection endpoints select sides of a service. Use sides to improve readability without changing what the relationship means.
Level of detailKeep infrastructure resources separate from business workflows. A C4 context view may be better for a nontechnical audience.

Common questions

Is this an automatically discovered architecture?

No. It represents the source you provide. Validate it against actual deployment information when accuracy about infrastructure matters.