Diagrams
ClaudeCursor
Foundations
Mermaid Flowchart Basics
Create flowcharts with Mermaid syntax for architecture docs
44 of 66
What is Mermaid?
Mermaid is a text-based diagramming language that renders in GitHub, GitLab, Notion, and many editors. Write text, get diagrams.
Basic flowchart
flowchart TD
A[Start] --> B{Decision?}
B -->|Yes| C[Action 1]
B -->|No| D[Action 2]
C --> E[End]
D --> E
Node shapes
A[Rectangle]
B(Rounded)
C([Stadium])
D{Diamond}
E[(Database)]
F((Circle))
Direction options
TDorTB-- top to bottomLR-- left to rightBT-- bottom to topRL-- right to left
Subgraphs for grouping
flowchart LR
subgraph Frontend
A[React App] --> B[Components]
end
subgraph Backend
C[API Server] --> D[(Database)]
end
B --> C
Common gotchas
- Do not use spaces in node IDs (
UserService, notUser Service) - Wrap edge labels with special chars in quotes:
A -->|"O(n)"| B - Avoid
endas a node ID (reserved keyword)