Architecting Node.js applications is a very extensive topic that could take an entire book on its own. However, we are going to cover one of the most commonly used design patterns, the Model-View-Controller (MVC) design pattern, defined as follows by MSDN:
The MVC framework includes the following components:
- Models: Model objects are the parts of the application that implement the logic for the application's data domain. Often, model objects retrieve and store model state in a database. For example, a Product object might retrieve information from a database, operate on it, and then write updated information back to a Products table in a database. In small applications, the model ...