Model-Routes-Controllers-Services Directory Structure

suggest change
├───models
│   ├───user.model.js
├───routes
│   ├───user.route.js
├───services
│   ├───user.service.js
├───controllers
│   ├───user.controller.js

For modular code structure the logic should be divided into these directories and files.

Models - The schema definition of the Model
Routes - The API routes maps to the Controllers
Controllers - The controllers handles all the logic behind validating request parameters, query, Sending Responses with correct codes.
Services - The services contains the database queries and returning objects or throwing errors

This coder will end up writing more codes. But at the end the codes will be much more maintainable and seperated.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Route-controller-service structure:
* Model-Routes-Controllers-Services Directory Structure

Table Of Contents
1 npm
41 cli
43 grunt
59 Hack
64 ES6
67 Redis
69 MongoDB
86 MongoDB
87 Lodash
91 CORS
105 N-API
108 Require
109 Route-controller-service structure