Tagixo Docs

Developer Documentation for Laravel, SDK integrations, and extensibility

Core Integration

Storage Model and Data Shape

Use the canonical payload shape and define persistence conventions that scale in production.

Storage Model and Data Shape

Canonical payload shape

Tagixo works with this structure:

{
  "body": {
    "background": { "color": "#ffffff" },
    "spacing": {
      "padding": { "top": "0", "right": "0", "bottom": "0", "left": "0" }
    }
  },
  "components": [
    {
      "id": "sec_1",
      "type": "section",
      "parent_id": null,
      "order": 0,
      "props": {}
    }
  ]
}

Important details:

  • body is a props object for the page canvas.
  • Tree is stored in flat form (parent_id, order).
  • Nested render tree is reconstructed as needed.
  • props is the only style/content payload per node.

Node contract

Each component node should contain:

  • id
  • type
  • parent_id
  • order
  • props

Your validators should reject malformed nodes early.

Example hierarchy in flat storage

[
  { "id": "sec_1", "type": "section", "parent_id": null, "order": 0, "props": {} },
  { "id": "row_1", "type": "row", "parent_id": "sec_1", "order": 0, "props": {} },
  { "id": "col_1", "type": "column", "parent_id": "row_1", "order": 0, "props": {} },
  { "id": "mod_1", "type": "heading", "parent_id": "col_1", "order": 0, "props": { "content": { "text": "Hello" } } }
]

This is the safest format to persist because sorting and parent relationships are explicit.

Suggested DB columns

For a content table (for example pages):

  • content JSON
  • rendered_html LONGTEXT nullable
  • css LONGTEXT nullable
  • status (draft, published)
  • published_at timestamp nullable

If you support rollback, add a related versions table rather than overloading the main record.

Save strategy

When content is saved:

  1. Validate JSON shape.
  2. Persist raw JSON.
  3. Re-render HTML/CSS.
  4. Save rendered artifacts.

This makes runtime page delivery fast and deterministic.

Validation rules you should enforce

At minimum:

  • body must be an array
  • components must be an array
  • every node must have a stable string id
  • every node must have a known string type
  • props must be an array
  • parent_id must be either null or a known node id
  • sibling order values should be deterministic

Do not rely on the renderer to clean bad editor data for you.

Versioning and templates

If your team needs rollback:

  • Store versions on each save.
  • Keep snapshots linked to entity ID and editor ID.
  • Reuse Tagixo template/library APIs where appropriate.

Good persistence conventions

  • Keep one canonical JSON payload per entity revision.
  • Never mutate production JSON with silent migration logic during request-time rendering.
  • If you need content migrations, write explicit migration scripts.
  • Cache render artifacts, not edited state.
  • Keep publishing state separate from editing state if your product has approvals.

Common mistakes

  • Saving only rendered HTML and losing the underlying JSON.
  • Saving nested children arrays directly while other code expects flat nodes.
  • Changing module type ids after content already exists.
  • Reordering nodes without updating parent_id and order coherently.