124
backend for frontend
also BFF
A thin API shaped for one client. The mobile app does not assemble five microservice calls on a flaky radio.
What is backend for frontend?
A BFF is a server owned by one client (web, iOS, Android) that calls internal services and returns the screen’s payload. It is allowed to be ugly and specific. Internal services stay client-agnostic.
Why does backend for frontend matter when vibe coding?
Models either expose every internal service to the phone, or they build one “universal API” that satisfies nobody and over-fetches. Name the BFF when the screen and the services disagree.
How do you do backend for frontend?
One endpoint per screen or action, owned by that client. It fans out server-side. Do not put business rules that a second client will need only in the BFF — those stay downstream.
How do you ask a model for backend for frontend?
Add a BFF endpoint for (screen) that calls (services) server-side and returns one payload. Do not make the client call internal services directly. Do not put shared domain rules only in the BFF.
What goes wrong with backend for frontend?
A BFF that becomes the only place pricing is computed. The next client reimplements it wrong. Shared rules live behind it.