Adding a global application-writable config.json file in frontends/ (Implementor tools)

Current Implementation

Currently, you can save your configurations by clicking the Download button in the implementor tools. which downloads a .json file into your downloads directory. However, these changes only exist in your dev environment.

Desired Behaviour

There is need to introduce a feature that will allow users to save their local configurations to the server using our implementer tools. This means that any changes made in the implementer tools will be applied to all users, instead of only being kept on a personal computer.

Ref: [O3-310] Application-writable config.json file in frontends/ - OpenMRS Issues

Initial suggestion

  1. Create a config.json file that the application is allowed to manage. This should be stored in the application home directory.
  2. Create a REST endpoint PUT /frontend/config in the module-spa that sets the value of the created config.json.
  3. Serve the config.json file along with everything else in the frontend files.
  4. Create a button in the Implementer Tools that sends a PUT request to the /frontend/config endpoint with the updated configuration settings.

Idea evaluation

From yesterday’s coffee-break meeting, there a lot of questions that were raised about the ideal solution for this requirement with regards to the desired location of the config.json because different implementations desire to store there configs in different locations due to different implementations methodologies.

This thread is to ideally ensure that the resolution satisfies all implementations.

cc @grace @vasharma05 @hadijah315 @ibacher @slubwama

cc @dkayiwa :point_up:

Hey @mksrom @ibacher , which is a good place to store the config.json, so that we can update it for the whole server and the changes take place through the server?


Application Data Directory/frontend/config looks like a good place to start as the default. To serve the needs of implementations that use a different directory, you can let them customise the location using something like global properties/system settings.

1 Like