Case 1
Multi-brand web platform for a US restaurant group
Four restaurant brands on one Next.js codebase, with a typed BFF in front of the backend services.
- Next.js
- React
- TypeScript
- Node.js
- Express.js
- OpenAPI
Context and problem.
A restaurant group ran four brand websites. Instead of four separate applications, all of them were served from one Next.js codebase. Each site still had to look like its own brand, and not every feature was meant for every brand. On top of that, the pages needed data from several backend domain services. Calling each of them from the browser would mean more requests and more data-shaping logic on the client.
Constraints.
One shared codebase for all four sites. Brand differences had to live in configuration, not in copied code.
What I did and why.
- I built the per-brand theming, so the same components picked up each brand’s styles instead of being duplicated per site.
- I implemented the feature flag system used to switch functionality on or off for each brand. A feature could be built once and enabled only where it was needed.
- I wrote a Backend-for-Frontend (BFF) service in Express.js. It received requests from the frontend, called the relevant domain services, and returned one combined response. TypeScript types were generated from the services’ OpenAPI specs, so the contract between the BFF and the services stayed typed and breaking changes showed up at build time rather than in production.
Result.
Four brand sites ran on one codebase, with brand differences handled through theming and flags. The frontend worked with a single, typed API layer instead of several services at once.