sequenceDiagram
  title User Sign-in and Profile Update Flow
  autonumber

  actor User as User
  participant Web as Web App
  participant API as API Server
  participant DB as Database

  User->>Web: Open login page
  Web->>API: Submit credentials
  API->>DB: Query user by email
  DB-->>API: User record
  API-->>Web: Authentication result (token)
  Note over User,Web: Display login status

  rect rgb(255, 245, 204)
    Web->>API: Request user profile
    API->>DB: Fetch profile details
    DB-->>API: Return details
    API-->>Web: Profile details
  end

  alt First login
    Web-->>User: Show onboarding
  else Returning user
    Web-->>User: Show dashboard
  end

  rect rgb(200, 220, 240)
    User->>Web: Update profile form
    Web->>API: Submit update
    API->>DB: Update row
    DB-->>API: Confirm update
    API-->>Web: Update result
    Web-->>User: Display success message
  end

  loop Heartbeat every 30s
    Web->>API: Ping
    API-->>Web: Pong
  end
      

Mermaid Online

FAQ

This FAQ applies to product manuals, official website pages, course quizzes, and live Q&A.

1. What is Mermaid?

Mermaid is a JavaScript-based diagramming tool that lets you create diagrams and visualizations using text. With a Markdown-like syntax, you can define and update diagrams dynamically. Mermaid helps documentation stay up to date with development, and even non-programmers can create detailed diagrams using the Mermaid Live Editor.

2. Which diagram types does Mermaid support?

Mermaid supports many types of diagrams, including:

3. What are the key features of Mermaid?

Mermaid works perfectly with AI chatbots such as Claude and ChatGPT. These AI tools can quickly generate Mermaid code from natural language descriptions, so you don’t need to hand-write complex syntax. AI dramatically simplifies the creation process and improves productivity.

4. What is Mermaid Online?

Mermaid Online is a web tool designed to easily display and render Mermaid code generated by AI tools like Claude and ChatGPT. Simply paste the code into the online editor to instantly preview the visuals—no installation or environment setup required.

5. Which export formats does Mermaid Online support?

Mermaid Online can export diagrams as multiple image formats:

These formats suit documents, web pages, slide decks, and other scenarios.

6. How do I share diagrams in Mermaid Online?

Mermaid Online supports sharing via URL. After creating a diagram, the app generates a unique link so others can view the diagram directly in their browsers. It’s convenient for collaboration and remote work—no downloads or attachments needed.

7. How do I use Mermaid on a webpage?

It’s straightforward. Include the Mermaid library via a CDN and add a <div class="mermaid"> or <pre class="mermaid"> element containing Mermaid syntax. For example:

<script type="module">
  import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
  mermaid.initialize({ startOnLoad: true });
</script>

8. Is Mermaid syntax hard to learn?

Mermaid’s syntax is relatively simple—especially for users familiar with Markdown. With AI assistants, you don’t even need to memorize the syntax. Just describe the diagram you want and AI will generate the code for you.

9. What are typical use cases for Mermaid?

10. What are the advantages of using Mermaid?

11. How about Mermaid’s security?

Mermaid takes security into account. Accepting text input from the Internet can be risky on public sites. Mermaid provides a sandboxed iframe rendering mode so diagrams are rendered in an isolated environment, preventing malicious code execution and adding an extra layer of protection.

12. How do I get started with Mermaid?

We recommend beginners start with the online editor and pair it with an AI assistant for the fastest onboarding.