Designing our SPA main pieces
Usually when designing SPA applications, I create a core application code base which is loaded in the browser at the application's initial load phase. This code base provides application-level functionality that is independent of the application's views. The application core consists of many modules that are loaded together. If you are familiar with Model-View-Controller (MVC) or Model-View-Wildcard (MV*) application design patterns, this core is essentially the controller of the application.
Note
MVC and MV* design patterns
These design patterns create a good degree of specialization and separation of concerns in the code. Understanding these patterns is important in creating a good application architecture. While I will be referring to these patterns from time to time, covering them in depth is beyond the scope of this book.
I recommend the following resources for more information:
https://www.packtpub.com/application-development/mastering-javascript...