DEV Community

Discussion on: Should I have my backend and my frontend in the same repo ?

Collapse
 
s1hofmann profile image
Simon Hofmann • Edited

I'm keeping everything in a single repository.
My approach to this setup is a lerna monorepo.

I'm typically using three subpackages, one for frontend, one for backend and a third one which basically contains entities used for communication between frontend and backend.
Since I'm mostly working with TypeScript, the communication package not only exports entities but also typeguards, which makes typechecking on both ends a breeze.

lerna makes working with multiple packages easy, which is why I stuck with this approach. yarn workspaces seem to be an alternative, but I haven't used them yet.

At the end of the day I'm deploying a bundle created with webpack.