Using AI to generate a sequence diagram from real production code

The cool diagram in the image is a Sequence Diagram of part of a live software system I built for a client — and the way I created it was just as cool.

-

In software architecture, this kind of diagram lets you clearly visualize what a program does, step by step.

It serves as a planning map that helps developers understand the required code structure and the relationships between its different components. It also makes it easier to identify weak points in the codebase and opportunities for improvement.

I recently finished an architecture course and decided to run an experiment: building such a diagram for a piece of software that scrapes product data from websites.

-

The source code is stored on GitHub.
I connected it to Google's Firebase Studio — an online code editor somewhat similar to Cursor, and also an app-building tool driven by prompts, much like base44. It offers a Gemini-powered side panel that can answer questions, explain code structure, and suggest bug fixes.

I asked it to analyze the software's structure and generate JS code I could use to create a detailed diagram of the codebase.

I fed the code I received into Mermaid, a popular diagramming tool, and instantly got the finished diagram.

The diagram describes the product-scraping workflow from the source websites, the error-handling logic, and the sending of a final activity report by email. It lets developers grasp the software's structure at a glance — no digging through lines of code required.

-

If you work with code or technology, a short software architecture course is one of the most valuable and enjoyable gifts you can give yourself.

It will answer one of the biggest mysteries in the field — how systems like Facebook or Google manage to serve hundreds of millions of users simultaneously without crashing.

An architecture course alone probably won't turn you into a practicing architect — that's an extremely complex role requiring exceptional skills and experience — but a solid understanding of the field's principles and methods will absolutely make you a far better technologist.

--

👋 Hi, I'm Shlomo Strauss — follow me for more interesting content on science and technology.

Using AI to generate a sequence diagram from real production code