Here's a quick explanation of of the MVC (Model-View-Controller) architecture.
The model part of a MVC architecture is where your database and application logic goes. This should be independent of the view and controller, so if your model was used in a web app, and reused in a CLI app, it should work perfectly fine.
The controller is what connects the model and the view. There should be no application logic inside your controller, it should just call the models with user data and serve the views to the user.
This is any representation of the data in the application. It could be a web app, a desktop GUI app, or even a CLI app (though web apps are the most common type of view).
Using this with Express.js
- Your models should go into a
- Your controllers should go into the routes folder and route with
- And your views should go into the