📜 ⬆️ ⬇️

Settings panel without programming

Hello,

This is a small service designed to solve the configuration problem of anything. More specifically, the configuration of something connected to the Internet, which can be represented as a fairly branched object, delivered in the form of JSON.

Problem


Programs need to store and use a variety of data, known as “settings,” or “configuration.” What is this data?
')


What can we think of for this, and why is it not suitable?




Actually, the service.
image


Simple logic of work:

Register, choose a free name for the scheme (this is called "seed"). Names are common to all, as they will be subdomains. We fill the circuit with contents in the form designer:

image

For each value, select the type, the field name, and what will be on the screen in the edit form.

Automatically obtain one instance of this scheme (each one is a “tree”) called main. You can do several, for example, for tests or development environment. We assign a password for each tree.

The data of each hypostasis is available to a person, for editing, at https: // <schema name> .config.ly


Since you are too lazy to create your own scheme (I would be), and you want to see the interface, you can go to the finished one:

Data is also available for reading to a soulless bot via HTTPS GET api.config.ly with Basic Authentication:


And again, you can immediately try:

curl -k -u primer:yV7mkhNRs00tM2nTdKuEWV2a api.config.ly

Total


What have we got? Just storage of JSON objects to which the minimal convenient editing interface is attached. Perhaps this will save you from writing the next admin panel.

Feedback and constructive criticism are accepted with gratitude.

Source: https://habr.com/ru/post/251097/


All Articles