mindmap
root((Topic))
Branch A
Leaf 1
Leaf 2
Branch B
GitGraph
gitgraph
commit
branch feature
commit
checkout main
merge feature
Flowchart Reference
Directions:TD (top-down), LR (left-right), BT (bottom-top), RL (right-left)
Node Shapes
Shape
Syntax
Example
Rectangle
[text]
A[Process]
Rounded
(text)
A(Start)
Stadium
([text])
A([Terminal])
Diamond
{text}
A{Decision}
Circle
((text))
A((Event))
Hexagon
{{text}}
A{{Prepare}}
Cylinder
[(text)]
A[(Database)]
Subroutine
[[text]]
A[[Subprocess]]
Parallelogram
[/text/]
A[/Input/]
Trapezoid
[\text\]
A[\Manual Op\]
Link Types
Type
Syntax
Description
Arrow
-->
Solid with arrowhead
Open
---
Solid, no arrowhead
Dotted arrow
-.->
Dotted with arrowhead
Thick arrow
==>
Thick with arrowhead
With text
--|text|>
Label on link
Multi-length
---->
Longer link (more ranks)
Subgraphs
flowchart TD
subgraph Backend["Backend Services"]
direction LR
API --> DB[(Database)]
end
Client --> API
Styling
flowchart TD
A[Node]:::highlight
classDef highlight fill:#ff9,stroke:#333
style A stroke-width:2px
Sequence Diagram Reference
Arrow Types
Syntax
Style
->>
Solid with arrowhead
-->>
Dotted with arrowhead
-x
Solid with cross
-)
Async (open arrow)
<<->>
Bidirectional
Participants
sequenceDiagram
actor User
participant API as API Server
participant DB as Database
Activations
sequenceDiagram
User->>+API: Request
API->>+DB: Query
DB-->>-API: Result
API-->>-User: Response
Control Flow
sequenceDiagram
alt Success
A->>B: OK
else Failure
A->>B: Error
end
loop Every 5s
A->>B: Ping
end
opt Optional
A->>B: Maybe
end
Notes
sequenceDiagram
Note right of A: Single note
Note over A,B: Spanning note
Grouping with Boxes
sequenceDiagram
box Blue Frontend
participant U as User
participant W as Web
end
box Green Backend
participant A as API
end
Class Diagram Reference
Visibility Modifiers
Symbol
Meaning
+
Public
-
Private
#
Protected
~
Package
Relationships
Type
Syntax
Meaning
Inheritance
<|--
Extends
Composition
*--
Strong owns
Aggregation
o--
Weak owns
Association
-->
Uses
Dependency
..>
Depends on
Realization
..|>
Implements
Full Example
classDiagram
class Animal {
<<abstract>>
+String name
+int age
+makeSound()* void
}
class Dog {
+String breed
+fetch() void
}
Animal <|-- Dog
Dog "1" --> "*" Toy : plays with
Generics
classDiagram
class List~T~ {
+add(T item)
+T get(int index)
}
erDiagram
USER {
int id PK
string email UK
string name
datetime created_at
}
POST {
int id PK
int user_id FK
string title
text content
}
USER ||--o{ POST : writes
C4 Diagram Reference
C4 provides 4 levels of abstraction for architecture documentation.