node-vision / strapi-plugin-entity-relationship-chart

Strapi Plugin displays Entity Relationship Diagram of all models, fields and relations.
180 stars 24 forks source link

Change charting library from storm-react-diagrams to mermaid.js or any other maintained lib #14

Open romanmandryk opened 2 years ago

romanmandryk commented 2 years ago

There are several issues with currently used storm-react-diagrams library. Currently the outdated version with some modifications is used to draw ER charts as latest version of SRD packaging would not build inside strapi and there is a lack of documentation how to use features. As a side effect, SRD was marked by strapi team as a potential security risk.

New library such as https://mermaid-js.github.io/mermaid/#/entityRelationshipDiagram can help alleviate the problems above and allow to add new features requested by community (such as adding cardinality and other annotations on relations)

luismts commented 2 years ago

+1

SalahAdDin commented 1 year ago

+1

SalahAdDin commented 1 year ago

There are several issues with the currently used storm-react-diagrams library. Currently, the outdated version with some modifications is used to draw ER charts as the latest version of SRD packaging would not build inside strapi and there is a lack of documentation on how to use features. As a side effect, SRD was marked by strapi team as a potential security risk.

New library such as https://mermaid-js.github.io/mermaid/#/entityRelationshipDiagram can help alleviate the problems above and allow to add of new features requested by the community (such as adding cardinality and other annotations on relations)

It will also be required to use dayjs or date-fn instead of momment.

Indeed, there is a problem with security, switching to the database view, we get these logs in the console:

Screen Shot 2022-08-15 at 00 42 56
ShahriarKh commented 1 year ago

I'm working on a new plugin! Here's a sneak peek 👀 :

image

The server functions are based on (read copy-pasted from) strapi-plugin-entity-relationship-chart, but I've completely replaced the diagrams and charts with React Flow. I will publish it soon, as it needs some testing and code cleanup (and maybe some additional features).

What do you think?

SalahAdDin commented 1 year ago

I'm working on a new plugin! Here's a sneak peek eyes :

image

The server functions are based on (read copy-pasted from) strapi-plugin-entity-relationship-chart, but I've completely replaced the diagrams and charts with React Flow. I will publish it soon, as it needs some testing and code cleanup (and maybe some additional features).

What do you think?

It looks f*** amazing, I want to test it!

romanmandryk commented 1 year ago

Hi @ShahriarKh , this looks really great! I think React Flow is the best OS library right now to build these kinds of charts. Looking forward to see the final version

ShahriarKh commented 1 year ago

https://github.com/ShahriarKh/strapi-content-model-diagram here we go