#Architecture Problem

25 messages · Page 1 of 1 (latest)

tardy cosmos
#

I can't decide on the architecture. I feel like something is wrong when using any architecture. Can you share documents and examples regarding this?

heavy kraken
#

Example of what?

tardy cosmos
#

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?

faint spade
#

What do you mean by "independent modules"? What do you have in mind?

tardy cosmos
faint spade
#

Why would the blog be a part of the user module?

tardy cosmos
faint spade
#

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?

heavy kraken
#

You can relate features without making them belong to each other

tardy cosmos
#

Is'nt it?

faint spade
#

You could do that, yes.

tardy cosmos
#

So, how do you decide it? Why you use comment module inside blog? I can't decide this.

heavy kraken
#

Could you create a thing that comments could relate to besides blogs?

faint spade
#

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.

tardy cosmos
#

Thank you your answers and your dev.to article. I'll look into it.

burnt wren
#

@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 ?

faint spade
#

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.

burnt wren
faint spade
#

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.