Ionic large project structure

I am creating a mobile app that is a port from a web app and I am trying to create a skeleton.

I have an administrative center with many different views that share one thing in common, they show all registers, create, update and delete. For example, I have one section for users where the first page shows all users, then there is a button to create and one to update that sends different views.

The skeleton of the project will be something like this:

/users
    users.html // show all users
    users_create.html // creates user
    users_update.html // update specific user
    users_detail.html // show specific user
/posts
    posts.html
    posts_create.html
    posts_update.html
    posts_detail.html
/communities
    communities.html
    communities_create.html
    communities_update.html
    communities_detail.html

.... much more the same for other sections

      

My question is, what would be the best approach to create this with ionic? have all these folders, or just one shared folder and allow all (number of fields, name of fields, etc.) passing the parameter to the route?

I ask you to regret it if I do not explain it very well, but I hope you will understand what I am trying to say.

Thank!

+3


source to share


1 answer


From Amos Haviv's amazing book MEAN Web Development, you can learn that there are basically two folder structures you can choose from:

  • Horizontal folder structure

The horizontal project structure is based on separating folders and files according to their functional role rather than the function they implement, which means that all application files are placed inside the main application folder containing the MVC folder structure. As you can see, the horizontal folder structure is very useful for small projects where the number of functions is limited and so files can be conveniently placed inside folders that represent their common roles.



  • Vertical folder structure

The structure of a vertical project is based on the separation of folders and files with the function they implement, which means that each function has its own standalone folder containing the MVC folder structure.

So, in your case, what I actually do is to use the structure of the vertical folder (as you said, that the application (to be) great, where you (in your case) should have a folder users

where you will then Folder controllers

, views

, model

(if used) and all the related files within it You can see the folder structure in action if you look at the mean.js project from the same author as the book.

+1


source







All Articles