Backend for Frontend (BFF) Course with Node and Fastify
Learn to build a Backend for Frontend in TypeScript with Node and Fastify 5, the pattern RFC 10017 recommends first for securing browser-based apps. You start with what a BFF is, when it pays off and how it differs from an API gateway, then build one that serves a React app and proxies its API calls. The security phase covers why tokens belong on the server, secure session cookies with HttpOnly, Secure, SameSite and the __Host-Http- prefix, OpenID Connect sign-in with PKCE using openid-client, Redis sessions with encrypted tokens, token refresh and logout, and a tested CSRF defense. Later lessons cover aggregating services with timeouts and partial failure, retries, circuit breakers and caching, testing with inject and mocked services, tracing, and running a BFF in production. Every example was run against a real OpenID Connect provider and browser.