Render erd Diagrams Online


If you ever wonder how to plot ER diagrams in plain text, you may have already heard of erd. It's a cool command line program written by Andrew Gallant in Haskell, to "compile" plain text files into nicely looking images, leveraging the power of GraphViz.

I've used erd for some time, it's cool and the syntax is quite simple. It's also quite simple to install it on Linux, just install GraphViz and erd itself, by following the instructions in the README page.

But there are times that there isn't an erd environment at hand:

  • erd is hard to install, or we don't have the permission to install it.

  • I shared the plain text file with my teammates, but they didn't know how to convert it to an image.

So I think maybe it's useful to have a web application that folks can try it out online, here it is: erd-repl , a simple Flask application hosted on Heroku. Although the name REPL, it's far from being a REPL, I think that a REPL helps ease the learning process, be it Emacs REPL, or Python REPL, as it gives you feedback as you type.

It's so simple that there isn't any user authentication mechanism, and here are some caveats:

  • the "source code" of plain text is simply stored in the browser cookie, together with your id.

  • no edit features, you need to edit it somewhere, e.g. Emacs, and then copied to erd-repl if it's complex, to prevent data loss.

  • only one image is stored per one user.

  • imaged will be cleared if being not touched for a few days

After hosting it on Heroku, I found that there is an issue discussing hosting a web service of erd on GitHub, take a look too if you're interested.


See also

comments powered by Disqus