A kubernetes implementation of this microfronts example: https://github.com/richgo/micro-frontend-basic. Using NextJs zones and federated Apollo GraphQL
The application we are building is comprised of a Nexts Js app, 2x Next Js zone apps, an Apollo Gateway and 4x Apollo servers (federated). It looks like this:
The principles of this architecture are to be decoupled both horizontally and vertically, enabling teams to align around product areas whilst maintaining consistency.
- K8s running under Docker desktop https://www.docker.com/products/docker-desktop
- Helm 3 https://helm.sh/docs/intro/install/
- Ingress https://kubernetes.github.io/ingress-nginx/deploy/
- Google Skaffold ( > 1.18 for module support) https://skaffold.dev/docs/install/
- DNS (dnsmasq or hosts file will work) 127.0.0.1 w.fakefurniture.local graph.fakefurniture.local p.fakefurniture.local a.fakefurtniture.local
- Node https://nodejs.org/en/download/
skaffold dev
That's it! Docker Builkit will now build 8 containers, Helm will deploy them and Skaffold will watch for file changes and give you hot-reloading (build/deploy) whenever you change code.
You should now see a rather rubbish looking website here:
and graph QL playground here:
http://graph.fakefurniture.local
individual next zone apps can be found here: