Situation: You have two projects, a UI and a REST API


Situation:

You have two projects, a UI and a REST API.

The UI and API are written in different languages, so different devs do UI vs API dev.

The UI is the API’s only consumer. Longer-term, a few other apps will call the API.

Do you put the UI and API in the same repo?
My take? Put them in the same repo.

Doing so supports atomic commits and assures integration happens early and often.

If the API has many consumers later, then we can have a monorepo with all consumers, or pull the API out to its own repo if the monorepo becomes impractical.
General principle: Code that changes together belongs together.

Collocate if you can. Separate if you must.
Also, this need not be a binary or final decision.

It can make sense to start dev in a monorepo while churn is high and there only one consumer. Then, extract the API project later when it is more stable and called by more than one project.

View original on X