Modifying raspberry pi wpa_supplicant config file

Just wondering if anyone already done it where there are options if the user wants to add or remove a network that a raspberry pi can connect with. And if the user decided to add a network he/she will be presented with text fields that is required to be inputted but the idea is that these are the ssid, psk and priority (which the raspberry pi will prioritize to connect with) and by pressing confirm these data will be now modified to the actual wpa supplicant config file?

I already know how I can translate the conf file to json file, and can send this to the user phone. But the whole idea is still fairly blurry to me if this is feasible.

You will need to setup an http server running php on your raspberry pi. Then you can create bash scripts to update the wpa_supplicant config by send the data and command via php to run the required bash script.

See HERE for how I used such a method to create a php music player app.