DEV Community

Mahesh K
Mahesh K

Posted on

3

Node.js Projects: What directory structure you have for project?

When you are making any form of projects (not just web based).

What directory structure that you follow for the project?

Top comments (2)

Collapse
 
learnwithparam profile image
Paramanantham Harrison

Domain driven structure

  • routes, model, seed, controllers and whatever file which is needed for a minimum functionality in a project. How to separate domain depends on project to project. For example, in a e-commerce web app, domains can be
  • products
  • users
  • orders
  • wishlist
  • search
  • related products
  • faq
  • feedback
  • analytics

And so on. There is no hard rules, you can split when needed

Collapse
 
larswaechter profile image
Lars Wächter

Some time ago I wrote an article about how I structure my REST Apis in Node.js: dev.to/larswaechter/how-i-structur...

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay