Server-side code

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 ...

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.