4.2.5.2 Configuring Metabase Dashboards
OpenCRVS includes a self-hosted, pre-configured Dashboards service, built on Metabase. In deployed environments, these dashboards can be found in the metabase.<your domain>
address.
The recommended way of customising OpenCRVS dashboards is in a local development environment, during the development phase of the project. It is also possible to customise the dashboards through the Metabase UI once the environment has been deployed but to keep environments consistent and all configuration in version control, we do not recommend this. All changes to production OpenCRVS environments should always be implemented by a developer, committed to version control, thoroughly tested, and only then deployed.
To begin customising the dashboards, first initiate your local dashboards instance by navigating to packages/dashboards
and executing yarn start
. In development environments, the dashboard service is not automatically started because it consumes significant memory and is not essential for most local development tasks.
After running the command, the dashboards can be accessed using the URL http://localhost:4444/
.
![](https://documentation.opencrvs.org/~gitbook/image?url=https%3A%2F%2F2365243258-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FCCxReqNLi05GgVKnwb07%252Fuploads%252FwWaVXxNi0awSJa2UVJ8D%252Fimage.png%3Falt%3Dmedia%26token%3D0fe65cb6-b349-40a7-a175-7721305a9feb&width=768&dpr=4&quality=100&sign=7049073d&sv=1)
If this is your first time logging into Metabase, you may use the following default credentials:
Username: user@opencrvs.org
Password: m3tabase
We strongly recommend changing these default credentials as your first customisation task!
Updating the map used in geographical visualisations
Several dashboard visualisations rely on regional maps. The country configuration starter project (opencrvs-countryconfig
) provides an example map located at src/api/dashboards/file/farajaland-map.geojson
.
![](https://documentation.opencrvs.org/~gitbook/image?url=https%3A%2F%2F2365243258-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FCCxReqNLi05GgVKnwb07%252Fuploads%252FnPLWatAlrp1NYTF1mcBz%252Fimage.png%3Falt%3Dmedia%26token%3Dde85d068-6a21-4dc5-8d7c-aeeffa9cf441&width=768&dpr=4&quality=100&sign=84208ebe&sv=1)
The simplest method to customise this map is by modifying the GeoJSON file's content. The map should automatically update upon your next deployment. Should you wish to rename the file or alter the API path from which it is served, proceed to the Admin Settings by clicking the cog-icon at the top right corner of Metabase, and then navigate to "Maps". In this section, you can set up the source for the map visualisation that Metabase utilises.
![](https://documentation.opencrvs.org/~gitbook/image?url=https%3A%2F%2F2365243258-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FCCxReqNLi05GgVKnwb07%252Fuploads%252FGNVsduPVi2Xmfu6KIyao%252Fimage.png%3Falt%3Dmedia%26token%3Da66a4457-be8b-4bb4-877e-88ff38ed5101&width=768&dpr=4&quality=100&sign=9dd51281&sv=1)
More information about customising dashboards and creating visualisations can be found from the Metabase documentation.
After customising the dashboards to suit your country's requirements, return to the terminal window where yarn start
was executed. Press Ctrl + C
to indicate that you are ready to save the configuration changes you've made. Following this action, you should observe a modification in the file dashboards/metabase.init.db.sql
.
This file should then be placed in the path infrastructure/metabase/metabase.init.db.sql
within your country configuration repository. It is important not to commit these file changes to opencrvs-core! You should see your updated dashboards after you deploy the changed file.
Next, update the map name and URL environment variables in infrastructure/docker-compose.deploy.yml along with whatever region key you use for the mouse interaction and data disaggregation. Usually the key will always be "State" and the name can be customised to suit your country.:
Dashboards not updating after deployment
Note that the file we just generated is only for initialising an empty Metabase instance. If your environment already had OpenCRVS running before your deployment, Metabase has been initialised with the previous init file. To re-initialise your dashboards, please follow the next steps.
Before you do this, make sure there are no configurations that were done manually through the Metabase UI. These changes will be overwritten with your new init file and all changes to Metabase will be lost permanently.
SSH into the manager node of your server fleet
Run
docker service scale opencrvs_dashboards=0
to stop the dashboards servicesudo rm /data/metabase/*
Run
docker service scale opencrvs_dashboards=1
to start the dashboards again
After this you should see your changes just as they are in version control.
Last updated