Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/joaomonteir0/printheritage/llms.txt

Use this file to discover all available pages before exploring further.

Datasets are the core data containers in PrintHeritage. Each project stores an array of datasets in its datasets JSONB column, where every entry represents one physical or virtual sensor feed — a temperature logger, a humidity probe, an accelerometer. Within a dataset, readings arrive as a flat array of timestamped rows, and a metadata object captures how those readings should be displayed in the visualisation dashboard.

Dataset Structure

A single entry in the datasets array has four top-level keys:
KeyTypeDescription
idstring (UUID)Server-assigned unique identifier. Returned by PATCH /projects/{id}/data.
labelstringHuman-readable name for the sensor feed, e.g. "Interior Temperature".
dataarrayOrdered array of reading objects (see Reading structure below).
metadataobjectDisplay and sensor configuration (see Metadata fields below).

Reading Structure

Each element of the data array is a flat JSON object. It must contain a date key with an ISO 8601 timestamp and one or more numeric columns whose names match the keys listed in metadata.selectedColumns:
{ "date": "2024-06-15T14:30:00Z", "temperature_c": 18.4 }
Multiple sensor channels can coexist in a single reading object when a device reports more than one value per timestamp:
{ "date": "2024-06-15T14:30:00Z", "temperature_c": 18.4, "humidity_pct": 61.2 }

Metadata Fields

KeyTypeDescription
unitstringPhysical unit label shown on the chart axis, e.g. "°C", "%RH", "mm/s²".
sensorTypestringSensor category. One of Temperatura, Humidade, or Vibração.
defaultChartTypestringChart type used by default. One of Linha, Área, Barras, or Scatter.
supportedChartTypesarrayList of chart types the user can switch to in the dashboard.
selectedColumnsarrayColumn names from the uploaded file that should be plotted.

Full Dataset Example

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "label": "North Wall Humidity",
  "data": [
    { "date": "2024-06-01T00:00:00Z", "humidity_pct": 58.1 },
    { "date": "2024-06-01T01:00:00Z", "humidity_pct": 59.4 },
    { "date": "2024-06-01T02:00:00Z", "humidity_pct": 60.0 },
    { "date": "2024-06-01T03:00:00Z", "humidity_pct": 59.7 }
  ],
  "metadata": {
    "unit": "%RH",
    "sensorType": "Humidade",
    "defaultChartType": "Área",
    "supportedChartTypes": ["Linha", "Área", "Barras"],
    "selectedColumns": ["humidity_pct"]
  }
}

Supported Sensor Types

PrintHeritage currently recognises three sensor categories. The sensorType value in metadata is used to group sensors in the UI and apply type-specific validation during the configuration wizard.

Temperatura

Measures ambient or surface temperature. Typical unit: °C or °F.

Humidade

Measures relative humidity. Typical unit: %RH.

Vibração

Measures structural vibration or acceleration. Typical unit: mm/s² or g.

Supported Chart Types

ValueRendered asBest for
LinhaLine chartContinuous time-series with clear trends
ÁreaArea chartEmphasising volume or cumulative change
BarrasBar chartDiscrete interval comparisons
ScatterScatter plotCorrelation analysis or sparse readings
The defaultChartType is applied when a dataset is first opened. Users can switch between any type listed in supportedChartTypes without changing the underlying data.

Creating a New Sensor (Configuration Wizard)

The NewSensorModal guides you through a three-step wizard before any data is uploaded. Completing it writes a new entry to the project’s datasets array with an empty data field ready to receive readings.
1

Name and description

Enter a label for the sensor feed (e.g. "East Façade Temperature") and an optional free-text description. The label must be unique within the project — submitting a duplicate label updates the existing dataset instead of creating a new one.
2

Sensor type and unit

Select the sensorType from the three available categories (Temperatura, Humidade, Vibração) and type the physical unit string that will appear on chart axes. The unit is free-form, so you can enter anything appropriate for your instrumentation.
3

Chart types

Choose a defaultChartType and tick which additional chart types should appear in supportedChartTypes. At least one type must be selected. The default must be included in the supported list.

Adding Data to a Dataset

After a sensor is configured, use the AddDataResourceModal to load actual readings. Three source types are supported:

CSV

Upload a .csv file. The file must include a column named date or data as the timestamp column, plus at least one numeric value column. Column headers become available for selection in selectedColumns.

XLSX

Upload a .xlsx spreadsheet with the same column structure as CSV. The first sheet is read. Headers in the first row follow the same date/data naming requirement.

API Endpoint

Provide an external HTTP endpoint URL. PrintHeritage polls the URL on a configurable interval (timeout in seconds). The response must return JSON in the same row-object format as the data array.

CSV and XLSX Format Requirements

Every uploaded file must have a timestamp column named exactly date or data. Files missing this column will be rejected during parsing. All remaining columns must be numeric — text columns other than the timestamp column are ignored.
A valid CSV looks like this:
date,temperature_c,humidity_pct
2024-06-01T00:00:00Z,17.3,54.2
2024-06-01T01:00:00Z,17.1,55.0
2024-06-01T02:00:00Z,16.9,55.8
After upload, you select which of the available numeric columns to plot. The chosen names are stored in metadata.selectedColumns. Only selected columns are rendered in charts — the raw data for unselected columns is still preserved in data and can be surfaced later by updating selectedColumns.
If you have a multi-channel logger that records temperature and humidity simultaneously, you can upload a single file with both columns and create one dataset that tracks both readings. Set selectedColumns to include both column names, and both channels will appear as separate series on the same chart.

Build docs developers (and LLMs) love