DEV Community 👩‍💻👨‍💻

Mahesh K
Mahesh K

Posted on

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
 
paramharrison 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...

DEV

Thank you.

 
Thanks for visiting DEV, we’ve worked really hard to cultivate this great community and would love to have you join us. If you’d like to create an account, you can sign up here.