Diagram Desk

Login sequence diagram

Messages between browser, web server and database during sign-in, with an alt box for right and wrong passwords.

The diagram

BrowserWeb serverDatabaseEnter ID and passwordSign-in requestLook up memberMember recordSession tokenHome screenErrorAsk to retryUseralt [Password matches][Wrong password]
Sequence diagram · 4 shapes

Reading it step by step

  • 1. 'User' sends a request to 'Browser': 'Enter ID and password'.
  • 2. 'Browser' sends a request to 'Web server': 'Sign-in request'.
  • 3. 'Web server' sends a request to 'Database': 'Look up member'.
  • 4. 'Database' replies to 'Web server': 'Member record'.
  • [alt: Password matches]
  • 5. 'Web server' replies to 'Browser': 'Session token'.
  • 6. 'Browser' replies to 'User': 'Home screen'.
  • 7. 'Web server' replies to 'Browser': 'Error'.
  • 8. 'Browser' replies to 'User': 'Ask to retry'.

Shape by shape

ShapeSymbolConnections
UserActor→ Browser(Enter ID and password) · ← Browser, Browser
BrowserParticipant and lifeline→ Web server(Sign-in request), User(Home screen), User(Ask to retry) · ← User, Web server, Web server
Web serverParticipant and lifeline→ Database(Look up member), Browser(Session token), Browser(Error) · ← Browser, Database
DatabaseParticipant and lifeline→ Web server(Member record) · ← Web server

Symbols used here

SymbolMeaning
Participant and lifelineA box on top and a dashed line below.
ActorA human participant; a stick figure.
Synchronous messageA call that waits; solid line, filled head.
ReplyThe answer; dashed line, open head.
Combined fragmentloop, alt and opt boxes.

All sequence diagram symbols and how to draw

Diagram text

Paste this text into the editor to get the same picture, then change the names to fit your own work.

# Login sequence diagram
sequenceDiagram
  actor U as User
  participant B as Browser
  participant S as Web server
  participant D as Database
  U->>B: Enter ID and password
  B->>S: Sign-in request
  S->>D: Look up member
  D-->>S: Member record
  alt Password matches
    S-->>B: Session token
    B-->>U: Home screen
  else Wrong password
    S-->>B: Error
    B-->>U: Ask to retry
  end

More sequence diagram examples

All SeewolLabs tools