The folder`s organization are according to the MVC (Model-View-Controller) model, which separates in three main layers:
1 - Models: Responsible for dealing with the application data and interacting
with the database. In the project architecture, it was separated into Service, which contains all the data manipulation logic and calls Models to manipulate the data, and Model, where they manage the data structure and interact with the data bank.
2 - Views: Contains the files that are responsible for the user interface.
3 - Controllers:Manage the user requests, activating the necessary services and providing the appropriate responses.
1./Controllers Contains the files that process HTTP requests and interact with services.Example: “proceduresController” interacts with “proceduresService”.
/Services Contains the logic, such as database searches, and
Indirectly interacts with the database by calling “Models”.
Example: “proceduresService” contains the logic for registering, searching, and modifying procedures in software processes, interacts with the database through Models, and creates functions for inserting, searching and modifying data.
/Views Contains the user interface templates (HTML, CSS and JS).
Example: activity.js contains Javascript functions that make the page “activity”dynamic and collect and processes data to send to the back-end.
/routes Defines application routes and directs requests to controllers.
Example: routesActivity.js maps to activityController.js.
/Model Manages the data structure and interact with the database.
Example: “activityModel.js” represents the model of the “activity” table in the database. It defines the structure of the “Activity” entity, specifying its attributes, data types and validation rules.
server.js file Configures the Express server, loads the routes and starts the application.