← All case studies Case study · Frontend architecture

DataDrivenRenderer: a schema-driven UI engine

Every insurance product line needed its own forms and reports. Instead of building each one by hand, I built one engine that renders them from configuration.

Role
Architect and lead developer
Stack
React, TypeScript, JSON templates, Jest, React Testing Library
Domain
Multi-product insurance platform

The problem

Aviation, marine, construction and property products each have different fields, rules and reports. Hardcoding a UI for every product meant the same kind of work was repeated for each new line.

The approach

DataDrivenRenderer takes a JSON template that describes the fields, layout and rules, and renders the complete form or report in React. Conditional logic, such as showing a field only when another answer matches, is expressed in the template with more than 15 operators.

  1. JSON template
  2. Evaluate conditions (15+ operators)
  3. Map to React components
  4. Form or report

Simplified rendering pipeline.

An illustrative template (not the production schema):

{
  "field": "hazardousCargo",
  "type": "boolean",
  "label": "Carries hazardous cargo?"
},
{
  "field": "hazardClass",
  "type": "select",
  "label": "Hazard class",
  "visibleWhen": { "field": "hazardousCargo", "operator": "equals", "value": true }
}

Keeping it fast and safe

Results

This was client work under NDA. The code sample is illustrative, and no client data or screenshots are shown.