Skip to content

Roles · BFF

Ops dashboard

An ops team had outgrown a shared spreadsheet: conflicting edits, no audit trail, everyone could see everything, and numbers were refreshed by hand from billing, ops, and logs. Rebuilt as a Next.js app. Roles come from the server session. A backend-for-frontend is the only thing that talks to those three systems.

BROWSER, SESSION, THREE SYSTEMS

01Principles

  • Server for the pages they read. Filtering and live tables are the client parts.
  • The role comes from the session. Hiding a nav item in the browser is not access control.
  • The browser never calls billing, ops, or logs. The BFF holds those credentials and normalizes pagination and auth once.
  • Client state is server data. React Query. Not a global store a two- or three-person team would have to keep alive.
  • Components for this dashboard only. Not a general design system.

02System map

SYSTEM MAP

Rendering diagram…

03What the spreadsheet could not do

Two people editing the same sheet overwrote each other. The app writes through the BFF, and the audit row is part of that write, so a change has an author.

Everyone with the file could see every tab. A page here is rendered from the role on the session. A user who is not in that role does not get the data by opening a URL.

Refreshing three systems by hand is gone. The BFF is the only caller, so a pagination or auth quirk in one system is fixed in one place.