Ecommerce demo of micro-frontends architecture using Astro as a shell
Find a file
2024-01-21 20:00:22 +01:00
app-cart initial commit 2024-01-21 20:00:22 +01:00
app-heading initial commit 2024-01-21 20:00:22 +01:00
app-products initial commit 2024-01-21 20:00:22 +01:00
app-shell initial commit 2024-01-21 20:00:22 +01:00
utils initial commit 2024-01-21 20:00:22 +01:00
.gitignore initial commit 2024-01-21 20:00:22 +01:00
LICENSE initial commit 2024-01-21 20:00:22 +01:00
package-lock.json initial commit 2024-01-21 20:00:22 +01:00
package.json initial commit 2024-01-21 20:00:22 +01:00
README.md initial commit 2024-01-21 20:00:22 +01:00

astro-microfrontends

This demo takes advantage of EcmaScript Modules (ESM) and url-imports to do client-side composition of microfrontends. Express is used for serving assets, but ideally one would have a dedicated CDN hosting them.

Features

  • Client-side composition of microfrontends
  • 📦 Multiframeworks with Astro Islands
  • 🚀 SSG/SSR supported by Astro

Usage

Micro frontends

  • Build each micro frontend with npm run build
  • Start each micro frontend with npm run preview

For production you would start the node server in the server folder, after building.

Shell

  • Build the shell with npm run build
  • Start the shell with npm run preview

Shared dependencies

Dependencies such as react and react-dom are shared across applications. They are fetched from esm.sh and gets cached in the browser, reducing the bundle size. Each app can share other dependencies as well through url imports.