<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alon Men</title>
    <description>The latest articles on DEV Community by Alon Men (@menalon).</description>
    <link>https://dev.to/menalon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3551331%2Fd664b8cd-83ff-4193-8c3e-aad74ca846f6.jpg</url>
      <title>DEV Community: Alon Men</title>
      <link>https://dev.to/menalon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/menalon"/>
    <language>en</language>
    <item>
      <title>Simple instructions with real life example on how to create Sequence Diagrams</title>
      <dc:creator>Alon Men</dc:creator>
      <pubDate>Tue, 07 Oct 2025 15:14:52 +0000</pubDate>
      <link>https://dev.to/menalon/simple-instructions-with-real-life-example-on-how-to-create-sequence-diagrams-2lo8</link>
      <guid>https://dev.to/menalon/simple-instructions-with-real-life-example-on-how-to-create-sequence-diagrams-2lo8</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/menalon" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3551331%2Fd664b8cd-83ff-4193-8c3e-aad74ca846f6.jpg" alt="menalon"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/menalon/visualizing-api-flows-with-sequence-diagrams-3aa8" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Visualizing API Flows with Sequence Diagrams&lt;/h2&gt;
      &lt;h3&gt;Alon Men ・ Oct 7&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#api&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#documentation&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#diagrams&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#techwriting&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>api</category>
      <category>documentation</category>
      <category>diagrams</category>
      <category>techwriting</category>
    </item>
    <item>
      <title>Visualizing API Flows with Sequence Diagrams</title>
      <dc:creator>Alon Men</dc:creator>
      <pubDate>Tue, 07 Oct 2025 15:12:32 +0000</pubDate>
      <link>https://dev.to/menalon/visualizing-api-flows-with-sequence-diagrams-3aa8</link>
      <guid>https://dev.to/menalon/visualizing-api-flows-with-sequence-diagrams-3aa8</guid>
      <description>&lt;p&gt;Programmer-friendly API documentation should always include a substantial overview or programmer’s guide section that provides context to the API reference. One of the most important sections in this API doc is the part that explains the relationships between the various components in the deployment. Not just the inputs and outputs of your endpoints, but rather the flow of calls between all the various services in the deployment. You need to describe the order of the calls, the dependencies between the components at each stage, etc. &lt;/p&gt;

&lt;p&gt;That’s where sequence diagrams come in. They turn complex request flows into something visual, intuitive, and instantly understandable. Whether you're writing REST, GraphQL, or event-driven API docs, adding sequence diagrams can make the difference between “uh… what?” and “ah, got it.”&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a sequence diagram?
&lt;/h2&gt;

&lt;p&gt;A sequence diagram is a type of UML (Unified Modeling Language) diagram that shows how different components interact over time. Think of it as a timeline of API calls, who initiates a request, who responds, and what happens in between.&lt;br&gt;
Here’s a simple example using &lt;a href="https://mermaid.js.org/intro/syntax-reference.html" rel="noopener noreferrer"&gt;Mermaid syntax&lt;/a&gt;, which many doc tools (like &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, &lt;a href="https://www.notion.com/" rel="noopener noreferrer"&gt;Notion&lt;/a&gt;, and &lt;a href="https://www.mkdocs.org/" rel="noopener noreferrer"&gt;MkDocs&lt;/a&gt;) already support:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    participant Client
    participant API
    participant Database

    Client-&amp;gt;&amp;gt;API: POST /login
    API-&amp;gt;&amp;gt;Database: Verify user credentials
    Database--&amp;gt;&amp;gt;API: Return user record
    API--&amp;gt;&amp;gt;Client: 200 OK + JWT token
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it, four lines of text that explain an entire authentication flow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why use sequence diagrams in API docs?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;They clarify complex interactions&lt;/strong&gt; - instead of describing multiple steps in a paragraph, you show them visually.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;They reduce support questions&lt;/strong&gt; - developers can see exactly what happens at each stage of the flow.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;They support multiple endpoints&lt;/strong&gt; - you can use the same diagram concept across multiple endpoints or even microservices. This provides a better understanding of the relationship between the endpoints and their methods.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to create a sequence diagram in your API doc - a real world example
&lt;/h2&gt;

&lt;p&gt;In one of the projects in my &lt;a href="https://www.writec.co.il/technical-writing" rel="noopener noreferrer"&gt;technical writing agency&lt;/a&gt;, I had to &lt;a href="https://www.writec.co.il/works/nsure-ai" rel="noopener noreferrer"&gt;document the API endpoints of a fraud detection solution&lt;/a&gt;. You can see the &lt;a href="https://www.writec.co.il/works/nsure-ai" rel="noopener noreferrer"&gt;live example of the API documentation&lt;/a&gt; with the diagrams. This specific diagram was created using the &lt;a href="https://sequencediagram.org/" rel="noopener noreferrer"&gt;free Sequence Diagram tool&lt;/a&gt;. But there are also other tools, as described below.  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create the entities&lt;/strong&gt; - in this case there is a merchant app, which communicates with the merchant server. The merchant server communicates with my client, &lt;a href="http://nSure.ai" rel="noopener noreferrer"&gt;nSure.ai&lt;/a&gt;, service to receive a response for the fraud check. As part of the check nSure.ai’s service communicates with a payment processor to receive a signal that is used in the check. If the transaction occurs, it communicates also with the inventory system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Draw the steps&lt;/strong&gt; - a step can describe something that occurred offline or online. For example, a purchase of a product or a payment. In addition, steps represent the API calls and their methods (e.g. GET, PUT, etc.). Each step should include the call to the entity and the response. Try to simplify this by not including all the possible responses (such as communication error responses etc.), as the idea here is to understand the flow. The details are found in the reference section. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Annotate optional flows&lt;/strong&gt; - if a part of the flow is optional, annotate it in an OPT box.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Annotate alternative flows&lt;/strong&gt; - if a part of the flow is optional, annotate it in an ALT box.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Annotate the end of a process&lt;/strong&gt; - if one of the processes in the flow hits a dead end, annotate it as “End Process”.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Write a worded description&lt;/strong&gt; - this is optional but recommended. You should write a step-by-step description of the flow, while naming all the endpoints and methods used. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Tools for creating sequence diagrams
&lt;/h2&gt;

&lt;p&gt;If I am missing anyone, please let me know in the comments. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://sequencediagram.org/" rel="noopener noreferrer"&gt;https://sequencediagram.org/&lt;/a&gt; - free tool. GUI and text-base. Browser-based live editor with real-time preview and easy sharing.   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://Mermaid.js" rel="noopener noreferrer"&gt;Mermaid.js&lt;/a&gt; - Text-based. Works in Markdown and static doc sites.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://plantuml.com/" rel="noopener noreferrer"&gt;PlantUML&lt;/a&gt; - Good for complex enterprise diagrams&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://WebSequenceDiagrams.com" rel="noopener noreferrer"&gt;WebSequenceDiagrams.com&lt;/a&gt; - Fast drag-and-drop editor.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://diagrams.net" rel="noopener noreferrer"&gt;Draw.io (diagrams.net)&lt;/a&gt; - Exports to SVG for embedding.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Best practices for technical writers
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Keep it simple.&lt;/strong&gt; Don’t show every internal service. Focus on what the reader needs to know.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use consistent participant names.&lt;/strong&gt; e.g., “Client,” “API,” “DB,” “Auth Service.”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Explain the diagram below it.&lt;/strong&gt; Treat visuals as complementary, not replacements for explanations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Version control your diagrams.&lt;/strong&gt; When APIs change, diagrams should too, especially if auto-generated from source.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to embed mermaid in your docs
&lt;/h2&gt;

&lt;p&gt;If you’re using Markdown-based documentation (like Docusaurus, MkDocs, or GitBook), you can usually add Mermaid blocks directly.&lt;br&gt;
If your system doesn’t support Mermaid out of the box, check if your static site generator offers a plugin, or simply export diagrams as SVG files. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;About the Author&lt;/strong&gt;&lt;br&gt;
I’m a technical writer and founder of &lt;a href="https://www.writec.co.il/" rel="noopener noreferrer"&gt;Writec – Technical &amp;amp; Marketing Writing&lt;/a&gt;, a &lt;a href="https://www.writec.co.il/technical-writing" rel="noopener noreferrer"&gt;technical writing agency&lt;/a&gt; that helps tech companies explain complex systems with clarity and style. If you enjoyed this post, follow me on &lt;a href="https://dev.to/menalon"&gt;DEV&lt;/a&gt; or &lt;a href="https://www.linkedin.com/company/writec-technical-and-marketing-writing-ltd/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; for more insights on technical documentation, UX writing, and API storytelling.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>api</category>
      <category>documentation</category>
      <category>diagrams</category>
      <category>techwriting</category>
    </item>
  </channel>
</rss>
