# What's StackForms ?

In Cycloid, a project's configuration can be exposed to users within a text editor or within a user-generated interface using StackForms.

StackForms provides a graphical interface to offer much better control over projects' creation or update.

For a stack user, it provides a visual way to configure a stack, displaying all parameters with associated descriptions split into sections and groups. On top of that the variable can benefit from extra then definitions: required/optional, description, values range/input, default value, etc. By doing so it makes it easier for users to understand and provide the appropriate configuration.

StackForms is compatible with Cycloid components, as special widgets allow users to select their own Credentials, Config repositories, etc. And also work with TerraCost to display in live an estimated cost of an infrastructure based on selected parameters!

Once the configuration is saved/updated, it is directly written in your project's config repository.


# How does it work ?

This feature relies on a configuration file (.forms.yaml) present on the stack to configure; which contains the definition of each variable to configure for each use-case. When this file is present, the interface will instead expose everything defined in that file.

You first have to define in StackForms the same use-cases defined in your stack. You can omit some, but then you wouldn't be able to use such interface; only the use-cases having a corresponding one on the StackForms file will be configurable through it.

This use-case configuration will contain a list of sections, groups & variables that you want to expose as well as their respective variables' configuration. Cycloid will expose such variables to the user, who will have the capacity to change them accordingly. Once everything has been fulfilled, the data will be sent back to Cycloid, which will validate the user's input and look for each configured variable through the stack's sample files.

If all the variables are valid they will be set accordingly, and the configuration files will be written onto the Config Repository of the project automatically. If not, the user will be notified that the variables don't respect their configuration and need to be updated before moving forward with the project's creation (or update).

# List of main benefits

Here is a list summarizing the main benefit of using such feature.

  1. Nice visual interface
  2. Support of a wide range of types and widgets
  3. Improved control on which variables to expose
  4. Capacity to make the variable require or not - and/or have default values
  5. Enforce limitations of values (range, list of values)
  6. Basic template capacities for variables (linked to organization, projects, etc)
  7. Easier access to Cycloid's entities (credential, config repositories, etc)
  8. Capacity to run a cost estimation of the project
  9. Centralization of variables definition
  10. Get dynamic values from the Inventory
  11. ...and many more to come!