Key Takeaways:
- When the backend is built in parallel with the app, a backend-for-frontend (BFF) gives the app a stable contract while upstream services keep changing.
- Owning the app and the BFF in one team means the people who see a broken flow can fix it on either side of the boundary.
- Start with the riskiest dependency. Validating sign-in through the client's identity service first unblocked every other flow.
- A BFF can absorb changes in data, but not changes in what users have to do. Those need a product decision, not a quiet technical fix.
- Mocks keep demos moving, but everyone should know which parts of a demo are real.
- Verify the app build, the BFF version, and the environment together before sharing a build with testers.
Stormotion built a new EV charging app for a European charge point operator while the client's own team was still building the services behind it: identity, charging data, pricing, and billing. To keep the app moving, Stormotion took ownership of a backend-for-frontend (BFF), an app-facing API layer between the mobile app and the client's services.
In this article, we explain the four decisions that shaped that work. We also describe how we handled backend changes that altered user journeys, and what reached the app stores about six months after the BFF decision.
Why the app needed its own backend layer
The client's backend team was building the identity, charging, pricing, and billing services at the same time as Stormotion was building the app. Contracts and response formats changed as those services took shape, and some changes affected what users had to do in the app.
To keep mobile development moving, Stormotion built and owned a backend-for-frontend (BFF): a stateless layer between the app and the client's services, shaped around what each screen needs. When an upstream service changed, we updated the BFF and kept the app's contract stable. When a change affected a user journey, we raised it with the client's product team as a decision.
The BFF keeps no user data or sessions of its own. Each request carries the user's token, and the client's services stay the single source of truth, so the BFF is easy to redeploy and has nothing to migrate when upstream services change. Mocks can be switched on for one upstream service at a time, so a single missing service doesn't push the whole app onto fake data.
const pricing = config.mocks.pricing
? new PricingMock()
: new PricingClient(config.pricingUrl); Each upstream service can be mocked on its own, so a demo shows exactly which parts are real.
Decision 1: Prove sign-in through the identity service first
Sign-in was the riskiest dependency: if the app could not authenticate users through the client's identity service, every other flow would be blocked. The client made validating it the first priority, and Stormotion started there.
Stormotion's backend engineer built a proxy between the BFF and the identity service and set it up locally to test authentication from the mobile client. About three weeks after the BFF decision, sign-in ran through the BFF. Until then, the app had used an in-app mock, and the team removed it.
Two product decisions came out of this early work:
- Password reset messages stay generic. The team agreed that the app should not reveal whether an email address has an account. A reset request returns the same neutral message either way. Choices like this change copy and acceptance criteria, so they need product sign-off, not just a developer's judgment.
- Password rules come from the identity service. Rather than hard-coding the rules in the app, Stormotion proposed exposing them from the identity service so they can change later without an app release.
Decision 2: Keep the product moving with mocks, and be clear about what each demo proves
Mocked data let the team keep design reviews and sprint demos going while some client services were still unavailable. At a mid-project sprint review, part of the app was still shown on mocked APIs because the real business endpoints did not exist yet.
The risk with mocks is that a demo looks finished when the data behind it is not. Where a mock sits decides what a demo can prove:
Where the mock sits | What a demo can show | What it does not prove |
|---|---|---|
Inside the app | Layout and navigation | That the BFF or any service works |
At a BFF endpoint | Screen behavior with realistic responses | That the client service returns this data |
Behind the BFF, per service | BFF mapping and handling of missing data | That the real service behaves the same way |
For a product owner, this table is a way to read a demo correctly. Our practice is to say explicitly which parts of a demo run on real services and which run on mocks. That way, a smooth demo is not mistaken for a finished integration.
Missing data was not a hypothetical concern. Close to launch, some stations still had no price in the data, mostly roaming stations run by partner networks, where tariffs come from a different source than the operator's own chargers. A BFF can handle this explicitly by returning a clear "price unavailable" state instead of an empty field. The app can then show a meaningful message rather than a blank or a zero.
type StationPrice =
| { status: 'available'; perKwh: number; currency: 'EUR' }
| { status: 'unavailable'; reason: 'roaming_tariff_missing' }; The BFF returns an explicit state instead of an empty field, so the app can't show €0.00 by accident.
Decision 3: Escalate journey changes instead of hiding them
A BFF can absorb changes in how data is shaped. It cannot hide a change in what users have to do. When an upstream change affected a user journey, Stormotion brought it to the client's product and design team as a decision rather than patching it quietly.
Registration order
The first registration flow asked users to confirm their email and then set a password. As the backend sequence changed, the agreed flow became: set a password first, then confirm the email address. That change touched screens, BFF calls, and what QA had to check before a build went to external testers.
Account linking
The client had not yet defined how users would link multiple accounts, and version one did not need account switching. Stormotion focused on the primary account, but added storage for multiple accounts in the app. A later release can add linking without a data migration. The add-account flow itself was postponed until the linking model was clear.
Guest pricing
The design showed subscription plan prices to guests who had not signed in, but the available service exposed only charging-station prices. Stormotion flagged the gap in the design files. The upstream services offered nothing that worked without signing in. So the team added public endpoints for locations and plans to the BFF, and guests could see plans before signing in.
Designs ahead of available data
Some designed fields, such as names at registration and a vehicle's state of charge, were not available from the services yet. The design had become the source of truth before backend capabilities were confirmed. Stormotion commented on the designs with what the services could actually provide. For similar projects, we recommend checking service capabilities before designs are finalized. That turns a late surprise into an early design input.
Building an app while your backend is still taking shape? Talk to us about your app-facing contract and release plan.
Contact us
Decision 4: Verify the build, the BFF, and the environment together
In the middle of the project, a breaking change on the backend side broke the development environment just before a client demo. The client's product team asked whether they could simply install the latest build. That would not have helped. The build was fine; the environment it called was not. The build still pointed at the same endpoint URL, but the backend behind that URL had changed.
The fix was a separate test environment that ongoing integration work could not disturb. It took longer to set up than planned. Stormotion set up test, development, and production environments for the BFF on the client's new domain the following month. The client's data API was also deployed to the test environment.
For a product team, the practical unit to verify is not the app build alone. It is the combination of:
- The app build
- The BFF version it calls
- The upstream environment behind that BFF
- A short smoke test of high-dependency flows, such as sign-in, guest pricing, and starting a charge
Recording that combination when asking QA to retest a flow avoids a common situation: a fix exists in the code, but testers are still using an environment without it. To make that check quick, the BFF reports its own version and environment:
// GET /health
{
"bffVersion": "1.4.2",
"environment": "test",
"identity": "ok",
"pricing": "ok"
} A health endpoint shows QA which BFF version and environment a build is calling, so "is the fix there?" becomes a quick check.
What the BFF made possible
The app reached both app stores about six months after the BFF decision, while the client's services were still evolving. Sign-in, registration, guest mode, and pricing all ran through the BFF, which absorbed upstream contract changes without blocking mobile development.
The BFF also stays useful after release. Upstream services keep changing, so it remains the place where new service behavior is adapted for the app. One example is roaming sessions from other networks, which the team identified as needing different handling from the operator's own stations.
When a BFF is worth owning, and when it is not
A BFF is worth the extra component when:
- The backend is built by another team, on a different schedule from the app
- One screen needs data from several services
- You need to show and test the app before every service is ready
- Upstream contracts are expected to change during the project
It may not be worth it when a single stable API already gives the app what it needs. In that case, a BFF adds a service to deploy, monitor, and keep in sync without solving a real problem.
If you do add one, decide who owns it. In this project, the BFF lived with the mobile team, so the people who saw a broken flow could fix it on both sides of the boundary. That ownership also includes ongoing cost: someone has to track upstream contract changes, coordinate deployments, and test the app and BFF together.
Looking for a reliable development partner to build a BFF layer for your evolving app? Fill out the form below, and we'll get in touch to discuss your project 👇


