Should I keep my backend and frontend canisters in the same repository?

All of the tutorials that I have the backend and frontend canisters in the same repository. The frontend interacts with the backend by calling the Candid UI file.

However, I have seen developers completely separate the backend and frontend into separate repositories and use the Javascript agent to call the backend canister and frontend.

Which method is the best? I know that you are still using the agent in the background when you are using the Candid UI file.

I don’t think there is a best way, but i would say management and ease of use might be better with a single repository. I always keep it simple unless there is a need to split it up, more complexities come with more headaches.
When im developing as a solo developer i find it easy to have the front end and the backend close because if im working fullstack, i want to edit them in the same place.
But if you have multiple teams or have isolated roles, then it might make sense to have multiple repositories so they don’t interfere with one another

1 Like