Skip to content

Sequence Diagrams

Sequence diagrams show interactions between actors over time.

sequenceDiagram
  participant Alice
  participant Bob
  Alice->>John: Hello John, how are you?
  John-->>Alice: Great!
  Alice->>John: See you later!
sequenceDiagram
  participant Client
  participant Server
  participant Database

  Client->>Server: POST /api/login
  Note over Server: Validate credentials
  Server->>Database: SELECT user WHERE email=?
  Database-->>Server: user row
  alt password matches
    Server-->>Client: 200 OK + JWT
  else invalid password
    Server-->>Client: 401 Unauthorized
  end
  Note over Client: Store token
sequenceDiagram
  Alice->>+Bob: Hello Bob, how are you?
  Bob->>+Alice: Great thanks!
  Alice-->>-Bob: See you later!
  Bob-->>-Alice: Goodbye!