Mastodon

Splitting (Angular) Frontend and (Spring) Backend in Separate Git Repositories

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

  1. faster Builds and test runs because of parallel runs
  2. when deploying only changes on either backend or frontend, only necessary files are moved
  3. better performance in IDE because less code per workspace
  4. better structure of code because of enforced loose coupling between frontend and backend

Disadvantages of Splitting

  1. changes including both changes on frontend and backend have to be splitted, hence less traceability
  2. more effort to commit changes on both frontend and backend because two commits have to be made synchronously instead of just one

Sources

  1. https://medium.com/@joeyvmason/the-front-end-deserves-its-own-repository-86fe382b7d37
  2. https://github.com/erikras/react-redux-universal-hot-example/issues/1166
  3. https://quickleft.com/blog/six-reasons-we-split-front-end-and-back-end-code-into-two-git-repositories-working-with-github-repositories/