DEV Community

Discussion on: Node.js Folder Structure

Collapse
 
asamolion profile image
Muhammad Osama Arshad • Edited

Cool.

Here are my thoughts:

  1. The folder structure is expressive enough to handle most cases, however I find that most of this stuff is unnecessary in small to medium scale applications. For larger applications I suppose that many layers may make sense.
  2. I see that you've grouped together all of the feature related code, however I don't see a goods.test.js file. is the by design?
  3. For most small to medium scale applications, a simple service layer and database model layer is sufficient, so this folder structure would be overkill in those cases.
Thread Thread
 
slimcoder profile image
Slim Coder

I also write test.
I was thinking about changing it to follow SRP and then DI and make a factory within each and every responsibilities.

Thread Thread
 
asamolion profile image
Muhammad Osama Arshad

What's SRP and DI?

Thread Thread
 
slimcoder profile image
Slim Coder • Edited

SRP: Seperation of Responsibility Principle.
DI: Dependency Injection

Thread Thread
 
asamolion profile image
Muhammad Osama Arshad

and these are used for?