This guide outlines the steps to create and onboard a new modular architecture module into the ODH Dashboard.
- Node.js and npm installed.
- Access to the ODH Dashboard repository.
Open your terminal and navigate to the packages folder within the repository:
cd packagesStart a new modular architecture project using the installer. Replace <your-module-name> with the desired name for your module.
npx mod-arch-installer -n <your-module-name>Each module needs a unique local dev port so that multiple federated modules can run simultaneously. To see which ports are already in use, run the validation script:
npm run validate:portsThis prints a complete list of all current port assignments, sourced directly from the workspace package.json files and federation-configmap.yaml.
Convention: Frontend federation ports use the 9100–9399 range. BFF ports use the 4000–4099 range. Pick the next available number in the appropriate range.
Pick an unused port and update both Makefile and package.json:
-
Update
Makefile: Openpackages/<your-module-name>/Makefileand find thedev-frontend-federatedtarget. Update thePORTvariable:dev-frontend-federated: cd frontend && AUTH_METHOD=user_token DEPLOYMENT_MODE=federated STYLE_THEME=patternfly PORT=<your-port> npm run start:dev
-
Update
package.json: Openpackages/<your-module-name>/package.jsonand update themodule-federationconfiguration:"module-federation": { "local": { "port": <your-port> } }
-
Validate uniqueness: Run the port validation script to confirm there are no conflicts:
node scripts/validate-module-ports.js
This check also runs automatically in CI and the pre-commit hook.
To enable your module in the main dashboard, you need to add a feature flag.
-
Open
frontend/src/concepts/areas/const.tsin the root of the repository. -
Search for existing flags (e.g., search for
disableortechPreviewFlags). -
Add your new feature flag to the appropriate group (e.g.,
techPreviewFlags):export const techPreviewFlags = { // ... existing flags // yourModuleName: true, // Set to true to enable by default in tech preview, or false otherwise } satisfies Partial<DashboardCommonConfig>;
Now that your project is configured, you can run the entire stack (backend, frontend, and your new module).
From the root of the repository, run:
npm run dev:frontendAnd in other terminal
npm run dev:backendAnd once you have that in another terminal run
cd packages/<your-module>
make dev-start-federatedThis command will start:
- The Dashboard Backend
- The Dashboard Frontend (Shell)
- Your new Modular Architecture Module (Federated)
Access the dashboard in your browser (usually at http://localhost:4000 or the port configured for the shell) and verify that your module is loaded.