Skip to content

AST Reporting Protocol

The AST Reporting Module is a lightweight C++ library for constructing hierarchical JSON markup representing complex reports with charts and tables.

These JSON documents are rendered dynamically by a ReactJS SPA using Recharts for data visualization.


Key Features

  • Build server-side report structures in C++.
  • Generate JSON markup compatible with React components.
  • Include charts, tables, and text.
  • Serialize efficiently with RapidJSON.

Example Overview

C++ (server-side):

Node report = div({
    h1({ text("Sales Report Q4") }),
    LineChart({
        XAxis({}, props({{"dataKey", "month"}})),
        YAxis(),
        Line({}, props({{"dataKey", "sales"}, {"stroke", "#82ca9d"}}))
    }, props({{"data", "[{\"month\":\"Jan\",\"sales\":100},{\"month\":\"Feb\",\"sales\":120}]"} }))
});
std::cout << stringify(report);

Resulting JSON:

{ "type": "div", "children": [ ... ] }