One codebase, five cities: what changes when a system becomes a product

There is a neighbourhood marketplace running in five Brazilian cities: Mauá, Capanema, Vinhedo, Itariri and Palmas. All of them run the same commit. What changes between them are environment variables and whatever the administrator saves in the panel.

It did not start that way. It started as one city’s marketplace. The version that became the base was extracted on 6 August 2026, and between then and 15 September the platform took 104 commits.

The rule that made the difference

Just one, and it fits in six words: the code knows no city. Name, state, domain, contacts, logo and legal text all come from configuration. There is no city if anywhere, and when the urge to write one shows up, what is actually missing is a configuration field.

The second rule is about direction. Every improvement is born in the platform and then carried to the oldest deployment, never the other way round. Without that, in three months you have five similar systems and no product.

The money does not pass through here

The most important architectural decision was not a technical one. Every sale lands directly in the seller’s account, through a connection the seller authorises. There is no commission, fee, withholding, payout or withdrawal. Without that connection the seller simply cannot sell, because the charge is refused.

That removes from the platform any duty to hold somebody else’s money, with everything attached to it. There is a visible price: the cart takes one store at a time, since a single payment cannot land in two accounts. We would rather explain that limit than administer payouts.

The debt standardisation collects

Consolidating five systems into one exposes the decisions nobody ever made. The case that stuck with me: there were six different definitions of “seller with payment connected” scattered through the code, and they disagreed with each other. The same seller could look eligible on one screen and ineligible on the next.

Today there is one, in a single file. Alongside it went, deliberately, fee calculation, automatic payouts and withdrawals. They existed half-built and nobody used them.

What I would tell someone on their first client

Do not build for five cities on day one. Build for one, and keep the discipline of never writing its name inside the code. It is a cheap rule at the start and a very expensive one to apply once the second client is already live.

Need this solved at your company?

A twenty minute call is usually enough to tell whether it makes sense, and you talk straight to the engineer who builds it.

Talk to the studio ↗︎