Configuration
The configuration of the data portal is done through json files.
The directory apps/portal/config contains different configuration presets.
Each of them has a set of a configuration files:
api.config.json
must match types defined in packages/core/src/context/config/APIConfig.tsui.config.json
must match types defined in packages/core/src/context/config/UIConfig.tstechniques.config.json
must match types defined in packages/core/src/context/config/TechniquesConfig.tsremotes.config.json
must defines urls for all the micro-frontendsinvestigation.viewer.config.json
must match types defined in apps/portal/src/components/viewers/InvestigationViewer.tsxdataset.viewer.config.json
must match types defined in apps/portal/src/components/viewers/DatasetViewer.tsxsample.viewer.config.json
must match types defined in apps/portal/src/components/viewers/SampleViewer.tsx
Please refer to the types and examples for more information on how to use them.
The app will be using the config present in public/config
which is not version controlled. You can copy any of the presets there and modify it to suit your needs.
cp apps/portal/config/local/* apps/portal/public/config/
One of the configuration presets will be copied at install time if none is present. To choose which one, you can set the DRAC_DEFAULT_CONFIG
env variable (default is local
). This is useful when building the docker image for example:
docker build --build-arg APP="portal" --build-arg DRAC_DEFAULT_CONFIG="esrf" -f docker/apps/Dockerfile -t portal .
You can also mount the configuration directory as volume to change it when running the container:
docker run -v /path/to/your/config:/usr/share/nginx/html/config -p 80:80 portal
Micro-frontends configuration
You need to configure the deployment URL for each of the micro-frontend apps. See architecture for more details on why this is required.
The remotes.config.json
file must contain the URLs for each of the micro-frontends. The key must match the name of the micro-frontend and the value must be the URL where it is deployed.
The files investigation.viewer.config.json
, dataset.viewer.config.json
and sample.viewer.config.json
contain the configuration for the viewers. They are used to define the components that will be used to display investigations, datasets and samples based on the data itself. They can use remote components (micro-frontends) or a generic local component. See the examples and types definitions for more information.