I recently stumbled upon the following question: When developing an Angular-App with a Spring Boot backend, should the Spring backend live in another Git repository than the Angular frontend? JHipster creates both in a common repository while many projects separate them.
Different sources suggest splitting if:
separate deployment of front- and backend is expected AND / OR heavy load on either backend or frontend is expected (because they should be scalable independently) AND / OR there is more than just the Angular frontend expected, for example native apps that connect to the backend (because Angular is just one of many frontend-projects).
Advantages when Splitting
- faster Builds and test runs because of parallel runs
- when deploying only changes on either backend or frontend, only necessary files are moved
- better performance in IDE because less code per workspace
- better structure of code because of enforced loose coupling between frontend and backend
Disadvantages of Splitting
- changes including both changes on frontend and backend have to be splitted, hence less traceability
- more effort to commit changes on both frontend and backend because two commits have to be made synchronously instead of just one
Sources
- https://medium.com/@joeyvmason/the-front-end-deserves-its-own-repository-86fe382b7d37
- https://github.com/erikras/react-redux-universal-hot-example/issues/1166
- https://quickleft.com/blog/six-reasons-we-split-front-end-and-back-end-code-into-two-git-repositories-working-with-github-repositories/