Closed AndyLiang1 closed 11 months ago
@AndyLiang1 I've been used to MVC approach so can you tell me more about the how adding repo layer would be good to incorporate to the project?
The repo layer is purely responsible for CRUDing stuff in the DB. If for whatever reason someday, we wanna change our DB to SQLServer or smt, we won't have to change the service layer (imo, changing the service layer is very costly cus it has all the business logic).
Also, my coops companies did that so I follow them ahah
Will make decision after speaking with TAs
@AndyLiang1 Move this to issues closing for now
Hi. I am proposing we use a Controller -> Service -> Repo pattern for the BE.
Controller is responsible for dealing with api route stuff.
Service is responsible for dealing with business logic.
Repo is responsible for dealing with getting information (say from DB)
Model folder is for when we have mongo set up.
ExampleController.js
callsExampleService.js
which callsExampleRepo.js
. All services are combined together in a collectiveservices.js
file (this is in the future, for if we need services to call other services, it is nicer to have one where we can always access).