Friday, November 3, 2017

What is the best project folder structure for Angular projects?

There no straight answer to this as every project is different, developers are of different mindset and architecture have their own though process.

But whatever it is you will end up with some kind of nearby folder structure for angular as shown below:-

  • You will need two root folders one for the server code and the other for client code. The client code folder sometimes is also named as “app”.
  • If you have a big project then inside in the client folder you can create sub folder which represent modules of your project. Normally developers divide project in modules for better management so these subfolders represent those modules.
  • In this those module folder you can have separate folder for component, model, module and routing.
  • A common folder is also needed where in you can push your common utilities like common pipes, filters, http components, injectables and so on.
  • Server folder will have its own folder structure depending on whether you are doing ASP.NET or JSP or PHP. In this discussion we will restrict only to client side angular folder structure.

This question was raised in our Mumbai angular training of 86th batch http://stepbystepschools.net/