Bakery Resources

A “Bakery resource” is a definition written in JSON or YAML that describes a desired Brezel module, entity, workflow, style or any other configurable Brezel resource.

The Bakery Planner scans the systems directory for Bakery resources and computes a difference between the state in the Brezel database and the desired configuration in the resources. When differences are found, the Planner applies the desired changes and updates the state.

Bakery resources are used to seed the module structure and keep it up to date (i.e. module tables and their columns), to define module entities (i.e. data rows in the module tables), and even workflows.

Bakery resources are defined in .bake.json or .bake.yml files. One such file can contain multiple resources:

[
  {
    "resource_module": "clients",
    "resource": {
      "identifier": "client",
      "type": "clients",
      "title": "title",
      "icon": "setting",
      "fields": [
        {
          "identifier": "title",
          "type": "text"
        }
      ]
    }
  },
  {
    "resource_user": "main_client",
    "resource": {
      "module": "clients",
      "fields": {
        "title": "Default client"
      }
    }
  }
  {
    "resource_module": "users",
    "resource": {
      "identifier": "users",
      "type": "users",
      "title": "number",
      "icon": "user",
      "fields": [
        {
          "identifier": "email",
          "type": "email"
        },
        {
          "identifier": "password",
          "type": "password"
        },
        {
          "identifier": "name",
          "type": "text"
        }
      ]
    }
  },
  {
    "resource_user": "admin_user",
    "depends_on": "resource_client.main_client",
    "resource": {
      "module": "users",
      "fields": {
        "email": "admin@brezel.io",
        "password": "${env('ADMIN_PASSWORD')}"
      }
    }
  }
]