On the server side, we divided the code according to functionality by separating code that defines business models from code implementing routing logic and code that responds to client requests at these routes:
| -- server/ | --- controllers/ | --- models/ | --- routes/
In this structure, each folder contains code with a specific purpose:
- models: This folder is meant to contain all the Mongoose schema model definitions in separate files, each file representing a single model.
- routes: This folder contains all routes that allow the client to interact with the server - placed in separate files where each file may be associated with a model in the models folder.
- controllers: This contains all the controller functions that define ...