Package: Generate plantuml diagram with .spy.yaml serverpod models

Hi there,

I wrote a package (my first one!) to generate a class diagram with my serverpod project’s .spy.yaml files to get an overview of it. People working with serverpod might find it useful, so here it is:

The diagrams look like this:

Using namespaces (folder structure):

You can customize (a bit) the appearance of the diagram with a .yaml file.

For whatever reason (could not find out why), when I paste the generated .puml code into the plantuml online editor, it does not render. My suspicion is that my file is just too big (63 objects and 64 relations)?. However, if you use the vscode puml extension ( PlantUML - Visual Studio Marketplace) it will work just fine.

I hope it is as usefull for others as it is for me!

I’ve been looking into the plantuml api for styling the diagram, but the api is quite fragmented and not very well documented. For now you can set some colors to your liking.

I also found a plantuml extension with an interesting api that might be worth having a look: GitHub - plantuml-stdlib/C4-PlantUML: C4-PlantUML combines the benefits of PlantUML and the C4 model for providing a simple way of describing and communicate software architectures

If you work on a serverpod project, I hope this helps you, and I look forward to your suggestions/contributions/feedback!

1 Like