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

**URL:** <https://talk.openmrs.org/t/adding-a-global-application-writable-config-json-file-in-frontends-implementor-tools/38663>\
**Category:** Development\
**Tags:** configuration, implementers, o3\
**Created:** [February 22, 2023, 6:56am UTC](https://talk.openmrs.org/t/adding-a-global-application-writable-config-json-file-in-frontends-implementor-tools/38663 "2023-02-22T06:56:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnsereko](https://talk.openmrs.org/user_avatar/talk.openmrs.org/jnsereko/32/14978_2.png) [@jnsereko](https://talk.openmrs.org/u/jnsereko)\
**Post date:** [February 22, 2023, 6:56am UTC](https://talk.openmrs.org/t/adding-a-global-application-writable-config-json-file-in-frontends-implementor-tools/38663/1 "2023-02-22T06:56:36Z")

</div>

> **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] - OpenMRS Issues](https://issues.openmrs.org/browse/O3-310)

> **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

---

<div class="post-metadata">

**Author:** ![hadijah315](https://talk.openmrs.org/user_avatar/talk.openmrs.org/hadijah315/32/7421_2.png) [@hadijah315](https://talk.openmrs.org/u/hadijah315)\
**Post date:** [February 22, 2023, 11:45am UTC](https://talk.openmrs.org/t/adding-a-global-application-writable-config-json-file-in-frontends-implementor-tools/38663/2 "2023-02-22T11:45:10Z")

</div>

cc @dkayiwa ☝

---

<div class="post-metadata">

**Author:** ![vasharma05](https://talk.openmrs.org/user_avatar/talk.openmrs.org/vasharma05/32/14182_2.png) [@vasharma05](https://talk.openmrs.org/u/vasharma05)\
**Post date:** [February 22, 2023, 11:46am UTC](https://talk.openmrs.org/t/adding-a-global-application-writable-config-json-file-in-frontends-implementor-tools/38663/3 "2023-02-22T11:46:25Z")

</div>

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?

Thanks!

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [February 22, 2023, 12:06pm UTC](https://talk.openmrs.org/t/adding-a-global-application-writable-config-json-file-in-frontends-implementor-tools/38663/4 "2023-02-22T12:06:34Z")

</div>

> [@jnsereko](#):
>
> 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.

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.
