A methodology for analytics

Dashboards as Code (DAC)

Dashboards as Code (DAC) is a data visualization methodology in which configuration files serve as the primary interface for defining dashboards. Their contents are interpreted by a common engine to collect, integrate, analyze, and visualize organizational data. In the StrataBI Platform, each dashboard is a declarative JSON document, checked against the published JSON Schema, kept in version control, and run on Athena and Lambda in your own AWS account.

On this page: What it means · Advantages and limitations · Compared with traditional BI · Formats and schemas · Version control and CI/CD · Agentic development · StrataBI · Questions

What it means

A dashboard is one JSON document.

The configuration file defines where visuals reside on a twelve-column grid, how data is collected, and how it renders. The runtime owns the rest: query execution, dependency ordering, status, results and rendering. There is no UI code in a dashboard, so changes are programmatically traceable.

Trade-offs

Advantages and limitations.

Advantages

  • Reviewable. Every change is a diff someone can read before it ships.
  • Reproducible. The same file gives the same dashboard in every environment.
  • Recoverable. History and rollback come from version control.
  • Consistent. A schema and a shared renderer keep dashboards uniform, and conventions can be checked automatically.
  • Automatable. Files can be generated, templated, validated and promoted by scripts and pipelines.
  • Agent-friendly. A model can write a small, checkable document (below).

Limitations

  • A learning curve. People used to drag-and-drop editors have to read and write a configuration format.
  • It needs a schema and a renderer. The files are only as useful as the engine that interprets them, and they are tied to its contract.
  • Layout is tuned in text. Positions and widths are numbers, so arranging a page takes previews and a few iterations.
  • It needs review discipline. Version control helps only if changes go through it; edits made directly in the running system drift from the repository.
  • Some things are hard to declare. Highly custom interactions, bespoke styling and one-off exploration fit poorly and usually need an escape hatch, such as custom code.
  • Contracts change. When the schema evolves, existing files may need migrating.
Compared with traditional BI

How it differs from GUI-authored dashboards.

In traditional BI development a dashboard is built in a visual designer and stored in the BI tool’s own database. Many tools also offer export formats and APIs; the real difference is which artifact is the source of truth.

GUI-authored dashboardsDashboards as Code
Source of truthThe tool’s databaseA file in a repository
AuthoringDrag and drop in a designerAn editor, a generator, or a builder that writes the same file
ReviewBy looking at the result; changes are hard to diffA line-by-line diff in a pull request
Promotion between environmentsExport and import, or rebuilt by handThe same file deployed to each environment
History and rollbackWhatever versioning the tool keepsVersion control: redeploy an earlier commit
AutomationThrough the tool’s API, where there is oneScripts, templates and CI on plain files
Formats and schemas

Configuration formats and schema validation.

Formats

  • JSON: strict and universal, easy for programs to read and write; no comments.
  • YAML: easier to write by hand and allows comments; indentation is significant.
  • Others: TOML, HCL, or a general-purpose language that generates the configuration.

Whatever the format, the engine reads it into the same data structure, so one schema can describe it.

JSON Schema

  • Describes the allowed shape of a document: required fields, types, allowed values, ranges, patterns, and whether unknown fields are accepted.
  • Validators exist for most languages, and editors use a schema for completion and inline errors.
  • Validate before saving: in the editor, in a pre-commit hook, in CI, and again when the engine accepts the file.

What a schema catches

  • Missing required fields and wrong types
  • Misspelled or invented properties, when unknown fields are refused
  • Values outside an allowed list or range
  • Malformed structure

What it does not

  • Whether a query is correct or returns any data
  • Whether a table, column or function it names exists
  • Whether a chart is readable or the numbers are right
  • Permissions and performance

Those need a preview, a run against real data and a reviewer.

Version control and CI/CD

Dashboards in the same workflow as code.

In StrataBI, keeping dashboard files in your own repository works in both editions; registering dashboards from Git and stratactl dashboards are Enterprise Edition features (below).

Agentic development

Why it suits AI agents.

A valid file can still be wrong, so an agent’s dashboards need the same preview and review as anyone else’s. What we measured when models built StrataBI dashboards is on the benchmarks page.

StrataBI

How StrataBI implements it.

  • One JSON document per dashboard, checked against the published schema; most objects refuse unknown fields
  • Each tile gets data from Athena SQL, a cached S3 object or a module Lambda (execution types) and renders as a Plotly chart, a table, markdown, an image or an input (blocks)
  • Inputs bind into SQL as named parameters; SQL can be an array of lines, so a diff reads line by line
  • Runs on Athena and Lambda in your own AWS account
  • The builder edits a dashboard’s JSON in the browser and previews it
  • StrataChat, Guildmaster in StrataForge, StrataMCP and agents of your own write against the same schema (agent integration)

Review your LLM providers, including Amazon Bedrock, for data flight and sufficient isolation for your organization’s needs when implementing AI. Learn more: Data protection in Amazon Bedrock

revenue-by-region.json
{
  "name": "Revenue by Region",
  "layout": [
    { "id": "note",
      "position": { "row": 0, "order": 0, "width": 12 },
      "block": { "type": "markdown",
        "config": { "content": "Revenue by region." } } },
    { "id": "revenue",
      "title": "Revenue by region",
      "position": { "row": 1, "order": 0, "width": 12 },
      "exec": { "type": "athena" },
      "query": { "sql": [
        "SELECT region, SUM(revenue) AS revenue",
        "FROM sales",
        "GROUP BY region" ] },
      "block": { "type": "table",
        "config": { "page_size": 25 } } }
  ]
}

Both editions

  • Dashboards as declarative JSON, checked against the published schema
  • The builder, and dashboard files kept in your own repository
  • In the free Developer Edition, stratabi dashboards push validates a file and uploads it to your system bucket

Developer Edition →

Enterprise Edition adds

  • Git-registered dashboards: Git is the source of truth and S3 the copy StrataBI serves; a git button registers a dashboard
  • A git-registered dashboard saves in place, keeping one stable S3 object
  • stratactl dashboards pull, list, diff and push; a push validates each file and refuses to overwrite a dashboard that changed in S3 since your last pull
  • Taking a pinned dashboard out of version control is an administrator’s action

Git registry reference → · Enterprise Edition →

terminal
# Developer Edition: validate, then upload to analyst/dashboards/ in your system bucket
stratabi dashboards push revenue-by-region.json

# Enterprise Edition: the git-registered set, between S3 and your repository
stratactl dashboards pull     # registered dashboards into ./dashboards, with a manifest
stratactl dashboards diff     # which local files differ from S3
stratactl dashboards push     # validate each file, then overwrite it in place
Questions

Dashboards as Code, briefly.

Is Dashboards as Code the same as BI as code?

It is part of it. “BI as code” usually covers the whole analytics layer kept as code: transformations, metric definitions, semantic models, permissions and dashboards. Dashboards as Code is the dashboard part.

Does every dashboard have to live in Git?

No. Exploratory dashboards made in a builder or by an AI assistant can stay disposable. Version control is for the dashboards people rely on.

Does it replace visual editors?

Not necessarily. A builder that reads and writes the same file works alongside it: people can edit visually, and the result is still a file that can be diffed and reviewed.