#Architecture Problem
25 messages · Page 1 of 1 (latest)
Example of what?
Maybe github projects for clean architecture. I searched on Github but many users say clean architecture for their projects. But they are not similar. What do you suggest? What is the idea behind Nest in Architecture?
Is it good for modules for each feature? Can we really code independent modules?
@tardy cosmos - you can read my article for a start. https://dev.to/smolinari/nestjs-and-project-structure-what-to-do-1223
What do you mean by "independent modules"? What do you have in mind?
Let's discuss your article. In it, you've added a comment module to the blog. However, isn't the blog also a part of the user module? In the case of being a part of the user module, will you integrate the blog module into it?
Why would the blog be a part of the user module?
Isn't a blog something that users share?
Sure, but what if you add an eCommere feature. Would that also go under the users module? Or a CMS?
The blog feature would need to know who is creating the blog, yes. But, the user module can be imported into the blog module, right?
My confusion starts here.
You can relate features without making them belong to each other
Also, the comment module can be imported into the blog module.
Is'nt it?
You could do that, yes.
So, how do you decide it? Why you use comment module inside blog? I can't decide this.
Could you create a thing that comments could relate to besides blogs?
I noted one can argue if the comment module should be in the blog module. It all depends on what you decide. And, the decision can be fairly easily changed with Nest. So, don't sweat these details. Make a good best guess, make it work, refactor and improve.
@faint spade in your article i see you have created module inside module
for e.g. blog module has commenting, drafting, publishing module inside it
How does that work, is it like a child module ?
Correct. Modules can be children to other modules. This hierarchy should stay as flat as possible, but the reason for doing it in the article is to show the possibility.
So will the child modules can have dependency with their siblings similar to normal modules ?,
also do i just create it using nest generate mo parent/child
where parent is already created nest module ?
child modules can have dependency with their siblings similar to normal modules
yes
also do i just create it using nest generate mo parent/child
where parent is already created nest module ?
I don't think that would work. You have to cd into the directory where you want the module generated.