Prefer SPA: Internal app Behind a login Flakey internet Heavily interactive...


Prefer SPA:
Internal app
Behind a login
Flakey internet
Heavily interactive
Favor faster subsequent page loads
Have BFF/GraphQL/dedicated APIs

Prefer SSR:
Public app
SEO is critical
Solid internet
Simple interactions
Favor faster initial page load
Orchestrating microservices
Oh, and you might wonder "What's a BFF"?

BFF = Backend for the frontend. It's a fancy way of saying this:

"What if we created a dedicated backed for our UI? Then our UI can receive exactly the JSON it needs. And it doesn't have to orchestrate calling a bunch of services."

My favorite way to implement a BFF for React apps? @nextjs.

Next has a built-in BFF, because it has a built-in Node backend. With a BFF, it doesn't matter if my backend is complicated and requires calling my endpoints. The BFF owns that complexity.

My UI remains simple.

View original on X