Introduction
StemJSON is a declarative domain-specific language (DSL) expressed in plain JSON that allows developers and AI systems to describe screens, UI trees, reactive state, and interaction flows in a structured, schema-driven way. It powers Backend-Driven UI (BDUI / SDUI): entire screens and flows can be delivered from a backend or generated at runtime without a new release.
A StemJSON payload is validated, parsed into a component render tree, and executed through a predictable unidirectional data flow.
Primary goal: Developers, including automated tooling, can reliably author, lint, validate, and generate StemJSON because it is a strict, documented JSON schema.
1.1 Design Goals
Section titled “1.1 Design Goals”| Goal | Description |
|---|---|
| Runtime UI composition | Load or replace screens from a backend without a new app release. |
| Deterministic rendering | UI is always a pure function of state + context. No hidden side effects. |
| Reusability | Component and action dependencies eliminate JSON duplication across screens. |
| AI-friendly authoring | Strict JSON schema is parseable, lintable, and generatable by automated tooling. |
| Separation of concerns | Components, styles, events, actions, and data access are modeled as distinct, composable layers. |
| Cross-platform semantics | Designed for cross-platform authoring. The same JSON payload targets multiple runtime implementations. |
1.2 How to Read This Document
Section titled “1.2 How to Read This Document”This specification uses RFC 2119 normative language. MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, and MAY carry their standard meanings. Code examples are JSON unless otherwise stated.