samchon / prisma-markdown

Markdown generator of Prisma, including ERD and descriptions
MIT License
393 stars 18 forks source link

suggestions and enhancements #2

Closed devmanbr closed 5 months ago

devmanbr commented 11 months ago

firstly, it's important to say: I really liked the tool! Thanks for developing! I've seen a lot of use for it since I found it.

I wanted to suggest to you, who are already experts, to develop another tool for Prisma, somewhat related to this one. It is always very bad to start the typescript code base following DDD (domain driven design) standards right at the beginning of the project, as it ends up, in a way, being exhaustingly repetitive work (to create entities, value objects, etc.). Certainly, it would be great if we could also count on a tool developed by you to generate at least the initial typescript code base (entities, value objects, services, etc.), following DDD standards, from Prisma schema.

I loved the idea of having control based on what is stated in the comments, this is fantastic and saves a lot of work.

thank you again!

samchon commented 11 months ago

You're meaning that generating DTO structures based on the prisma schema including comments?

It sounds good idea, but I know that there're some similar purposed libraries (I've not used them yet).

devmanbr commented 11 months ago

more than just DTOs, but that would be a great start. very briefly: entities, in DDD, more than simply being objects, are more "powerful" classes, offering methods derived from the domain needs.

an example to make it clearer: an Order entity could have a addItem(item: Item) method, as long as there was something in the Prisma schema that signaled this need.

There are some libraries that offer similar things, in fact, but I didn't like them when I used them (as they didn't do the job well), and also, unlike what you were able to establish here, they don't offer the ability to customize at the model level. The concept you established of grouping, here, for example, prevents the entire code base from becoming a mess, from the generation of assets, and this is something that none of the other libraries I have tested have.

the customization in Prisma schema that generates effects on the generated assets is what makes everything fantastic.

references: there is a small article that ends up mentioning important introductions about the DDD pattern in typescript: https://medium.com/@alessandro.traversi/getting-started-with-domain-driven-design-in-typescript-a-practical- introduction-4b2082a44287

samchon commented 10 months ago

I can't understand how prisma-markdown can be enhanced to accomplish it.