Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A POC for microfrontend architecture using Webpack Module Federation. Includes a React container app and microfrontends built with React and Vue, demonstrating independent deployment and framework interoperability.

Notifications You must be signed in to change notification settings

Asega1996/mfe-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MFE Project – Vue + React MFEs

Table of Contents


Overview

This is a PoC project demonstrating a Micro Frontend architecture where Vue and React apps coexist in a single host using Webpack Module Federation.

  • Host: Integrates multiple micro frontends (MFEs).
  • MFEs:
    • React: Navbar component with links and a counter state.
    • Vue: Interactive dashboard with buttons and state-driven actions.

Project Structure

root/
├─ host/
│ ├─ src/
│ │ ├─ bootstrap.ts
│ │ ├─ store/
│ │ └─ index.html
│ ├─ package.json
│ └─ webpack.config.js
│
├─ mfe-navbar/
│ ├─ src/
│ │ ├─ bootstrap.tsx
│ │ ├─ components/
│ │ └─ index.html
│ ├─ package.json
│ └─ webpack.config.js
│
├─ mfe-dashboard/
│ ├─ src/
│ │ ├─ main.ts
│ │ ├─ app/
│ │ │ ├─ App.vue
│ │ │ └─ components/
│ │ └─ assets/
│ ├─ package.json
│ └─ webpack.config.js

Setup Instructions

  1. Clone the repository:
git clone https://github.com/Asega1996/mfe-poc.git
  1. Install dependencies for each project:
cd host
npm install

cd ../mfe-navbar
npm install

cd ../mfe-dashboard
npm install
  1. Make sure all MFEs and host use compatible versions of React, ReactDOM, Vue, Redux Toolkit, and React Redux.

To do this, it may be necessary to review the package.json files for each project.


Running the App

You should run each sequence on a different terminal.

  1. Start the Navbar MFE:
cd mfe-navbar
npm start
  1. Start the Dashboard MFE:
cd mfe-dashboard
npm start
  1. Start the Host application:
cd host
npm start
  1. Open your browser at http://localhost:3000 (default port), you can change the ports checking de /config directory on each project.

State Management

  • The host contains the Redux main store, defined on host/store/*
  • For the use of components in standalone mode (simulating different development equipment), a copy of the state defined for the host has been included in each MFE.

Micro Frontend Communication

  • Global state management is configured with Redux.
  • Shared state is maintained via Redux Toolkit.
  • The host injects the store into each MFE in the mount function usage.

Useful Links

About

A POC for microfrontend architecture using Webpack Module Federation. Includes a React container app and microfrontends built with React and Vue, demonstrating independent deployment and framework interoperability.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published