Example setup for a React MFE and Nodejs BFF.
Supports the hosting of multiple related MFEs from the same application as well as providing a demo / testing facility for local MFE development. It does this by allowing different apps to be boot-strapped according to the location hash (fragment identifier). Different location hash values identify different MFEs and enable use of the relevant iframe-app. If there is no match on the location hash, then it falls back to the default demo app.
Also see backend and frontend docs.
docker compose up -d
- http://localhost:3000
docker compose down
npm run dev
npm run dev
- http://localhost:3001
cd frontend
npm i
npm run build
cd ../backend
npm i
npm run build
cp -R ../frontend/build build/frontend
npm start
- Frontend uses React 16 because
@salesforce/design-system-react
does not currently support React 17. - In
dev
mode the frontend uses3001
and the backend3000
(by default). In this way you can develop both the front and back simultaneously with communication between them. - When in
dev
mode you can openfrontend/test/example-iframe.html
to see things working in a iframe. Compare this to the full page example at http://localhost:3001. The iframes use wrapper applications leveraging the same underlying containers.