@bloomreach/navigation-application v2.12.3
Bloomreach Navigation Application
Introduction
This project contains the code for the navigation application, nav-app. The nav-app is the container application of micro-frontends in BRX. Through configuration it allows the loading of isolated apps inside iframes hosted on any domain.
These client apps can then use the @bloomreach/navigation-communication library to communicate with the nav-app API to execute tasks.
Structure
This is an Angular workspace generated by the Angular CLI. The src folder contains the nav-app application.
Installation
To install the dependencies, run:
pnpm iNote: this will install all dependencies of the project, i.e. for every package in the monorepo.
Development
For a development setup:
pnpm startNavigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
Note: the development setup for the nav-app expects the ./apps/example-iframe-application to be running on http://localhost:4300/. Please follow the instructions in the ./apps/example-iframe-application README to start the example app, or run pnpm start from the root of the project.
Loading Mechanisms
The way the navigation application loads differs between our two products, "Discovery" and "Content". The primary differences lie in how the initial settings are loaded and how the dist folder is organized.
Discovery
For the Discovery product:
- The application is built with
pnpm run build:iamorng build --configuration production-iam. - The application is deployed in a Docker container.
- The application loads the initial settings from
/iam/nav-settingsas is defined in./src/environments/environment.iam.ts. - The
distfolder is organized such that theindex.htmlfile is located directly underdist/and all other files are located underdist/navapp-bundle.- This simplifies the routing/proxying configuration in the virtual service that serves the application.
/navapp/should load theindex.htmlfile./navapp/navapp-bundle/should load the rest of the files./navapp/foo/barshould load theindex.htmlfile again.
The
index.htmlfile contains a<base>element that sets the base URL to/navapp/navapp-bundle/.- This ensures that all relative URLs are resolved correctly, irrespective of the current URL.
Content
For the Content product:
- The application is built with
pnpm run buildorng build --configuration production. - The application is deployed on NPM and served via Wicket.
- The application loads the initial settings from
../../ws/navigation-settingsas is defined in./src/environments/environment.content.ts.- The path is relative to the location of the application on the server; the navapp is served from
<application-root>/angular/navapp
- The path is relative to the location of the application on the server; the navapp is served from
- The
distfolder is organized in a simpler structure, with all necessary files located directly underdist.
These differences ensure that each product can be tailored to its specific deployment and operational requirements.
Custom Log Level
To define a custom log-level using the local-storage API of the browser, follow these steps:
- Open the browser's developer tools (usually by pressing
F12orCtrl+Shift+I). - Navigate to the "Console" tab.
- Set the desired log level by executing the following command in the console:
localStorage.setItem('br_nav_log_level', 'DEBUG'); - Refresh the page to apply the new log level.
The available log levels are defined in the ngx-logger library, which is used by the nav-app. The available log levels are: TRACE, DEBUG, INFO, LOG, WARN, ERROR, FATAL, and OFF.
To reset the log level to the default value, execute the following command in the console:
localStorage.removeItem('br_nav_log_level');Build
To produce a production build:
pnpm buildThe build artifacts will be stored in the dist/ directory.
Running unit tests
To run the unit tests:
pnpm testLinting
To run the linter:
pnpm lintThis will lint both the TypeScript and the SCSS files.
Documentation
To generate the documentation:
pnpm docsDeployments
The @bloomreach/navigation-application package is released on multiple channels:
- A Docker container is built and pushed to the
discovery.prod.br-engops.io/discovery-imagesrepository. - This container is built specifically for the
Discoveryenvironment. - Alongside the container, a Helm chart is published to the
https://maven.bloomreach.com/repository/discovery-chartsrepository. - An NPM package is published to the
@bloomreach/navigation-applicationpackage on NPM. - This package is built specifically for the
Contentenvironment. - A copy of the
distfolder is deployed on S3, one for every realm. - This is done for the legacy IAM-based deployments.
8 months ago
7 months ago
12 months ago
12 months ago
9 months ago
6 months ago
7 months ago
6 months ago
9 months ago
5 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
5 months ago
9 months ago
9 months ago
5 months ago
9 months ago
5 months ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago