Templates / sequenceDiagram
Two-factor authentication
A TOTP-based second factor challenge after a successful password check.
Preview
Mermaid 11 renderer
Rendering preview...
Mermaid source
sequenceDiagram
sequenceDiagram
actor User
participant App
participant API as Auth API
participant Authenticator as Authenticator app
User->>App: Enter username and password
App->>API: Verify credentials
API-->>App: Credentials valid, MFA required
App-->>User: Prompt for 6-digit code
User->>Authenticator: Read current code
User->>App: Submit code
App->>API: Verify TOTP code
API-->>App: Code valid
App-->>User: Grant sessionMore templates
flowchartArchitecture
Microservices architecture
A service map with an API gateway, core services, and shared infrastructure. A solid starting point for README architecture sections.
sequenceDiagramProcess
User login sequence
A login flow with token issuance and a failure branch. Useful for documenting auth endpoints and session behavior.
stateDiagram-v2Process
Order state machine
Lifecycle states for an e-commerce order, from creation to fulfillment, with cancellation and refund paths.