Your prose, now diagrammed — by AI, with hand-drawn charm
A web app that turns rambling text into Mermaid diagrams, then renders them in either crisp SVG or sketchy Excalidraw style.

What it does
Smart Mermaid is a Next.js web app that takes natural language text — pasted, typed, or extracted from .txt, .md, or .docx files — and asks an LLM to emit valid Mermaid code. It renders the result in a split-pane editor: Mermaid syntax on the left, visual output on the right. You can toggle between a standard SVG renderer (with zoom, pan, download) and an Excalidraw “hand-drawn” renderer for PNG export.
The interesting bit
The app treats Mermaid as an intermediate language that needs curation, not just generation. It exposes dedicated /api/fix-mermaid and /api/optimize-mermaid endpoints to repair broken syntax and suggest layout improvements — acknowledging that LLMs often botch the grammar. The Excalidraw integration via @excalidraw/mermaid-to-excalidraw is the polished touch: same semantic content, two visual personalities.
Key highlights
- File ingestion: drag in Word docs and get diagrams back
- Streaming generation via SSE so you watch the code assemble character by character
- One-click layout flip (top-down ↔ left-right) without re-prompting the model
- Local-only history and usage counting; the server never stores your inputs
- Docker Compose one-liner for self-hosting with your own API key
Caveats
- Demo site caps you at 5 free generations per day, counted per-browser — trivial to reset, mostly an honesty box
- Output quality is chained to whatever upstream model you plug in; complex diagrams still need human cleanup
- The “AI optimization” and “AI fix” features are thin wrappers around additional LLM calls, not rule-based validation
Verdict Worth a spin if you write a lot of docs and hate maintaining Mermaid syntax by hand. Skip it if you already have a ChatGPT subscription and a browser tab open to the Mermaid live editor — this is essentially that workflow, productized.