To run the dashboard and test it out use this command:
> docker run -p 3000:3000 -it scriptedalchemy/mf-dashboard:latest
This will create temporary database inside the docker container in its /data directory. This command
> mkdir dashboard-data
> docker run -p 3000:3000 \
--mount type=bind,source="$(pwd)"/dashboard-data,target=/data \
-t scriptedalchemy/mf-dashboard:latest
This will create a sub-directory called dashboard-data and then store the Dashboards data in that directory.
You should then be able to connect to the dashboard at http://localhost:3000.
Bring the plugin into the project.
> yarn add @module-federation/dashboard-plugin -D
Add this to the top of the Webpack configuration file.
const DashboardPlugin = require("@module-federation/dashboard-plugin");
Add the DashboardPlugin to the plugins array.
plugins: [
...
new DashboardPlugin({
dashboardURL: "http://localhost:3000/api/update",
}),
];
More information on the plugin is available on NPM.
There are two endpoints. The primary GraphQL endpoint is on /api/graphql. And the upload endpoint for the plugin is in /api/update.
The Module Federation Dashboard is a NextJS application that runs it's own GraphQL endpoint to serve data to the frontend code.
Install the dependencies.
yarn
Start up the development server.
yarn dev
Build the production server and start it.
yarn build
yarn start
Content type
Image
Digest
Size
154.3 MB
Last updated
over 5 years ago
docker pull scriptedalchemy/mf-dashboard