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.

A project is the central organizing unit in PrintHeritage. Every monitoring campaign — whether it tracks temperature fluctuations in a medieval chapel or vibration readings from a stone bridge — lives inside a project. Projects hold your sensor datasets, define who has access, and serve as the shared workspace your team collaborates within. You can create as many projects as needed, each fully isolated with its own members and data.

The Project Model

Each project is stored as a PostgreSQL row with a JSONB datasets column that holds all sensor readings. The table below describes every field on the Project model.
FieldTypeDescription
idUUIDAuto-generated unique identifier for the project.
nameStringHuman-readable project name. Required. Used for full-text search.
descriptionStringOptional free-text description of the monitoring site or campaign.
datasetsJSONBArray of dataset objects (see Dataset structure). Defaults to [].
owner_idUUID (FK → users.id)The user who created the project.
created_atDateTimeUTC timestamp set automatically at creation.
A legacy sensor_data field (also JSONB) is still present on the Project model and is surfaced in API responses via ProjectResponse.sensor_data. It predates the structured datasets array and should be treated as read-only. All new data ingestion targets the datasets field exclusively.

Project Ownership

When you call POST /projects, the API automatically creates a ProjectPermission record linking you to the new project with:
  • status set to ACCEPTED (no invitation flow required for the owner)
  • access_level copied from your current global_role
This means the project creator has immediate, full access at whatever privilege level their account holds. The owner_id field on the project is also set to your user ID, and the project owner cannot be removed from the member list — attempting to do so returns HTTP 400.

The Datasets Field

The datasets column is a JSONB array where each element represents one named sensor feed. The structure of a single dataset object is:
{
  "id": "3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
  "label": "Interior Temperature",
  "data": [
    { "date": "2024-03-01T08:00:00Z", "temperature_c": 14.2 },
    { "date": "2024-03-01T09:00:00Z", "temperature_c": 14.8 }
  ],
  "metadata": {
    "unit": "°C",
    "sensorType": "Temperatura",
    "defaultChartType": "Linha",
    "supportedChartTypes": ["Linha", "Área", "Barras"],
    "selectedColumns": ["temperature_c"]
  }
}
When you PATCH /projects/{project_id}/data with a payload that matches an existing dataset by id or label, the existing entry is updated in place. If no match is found, a new dataset entry is appended and a fresh UUID is assigned by the server.

Project Lifecycle

1

Create the project

Call POST /projects with a name and optional description. The project is created and you are automatically added as its first member.
2

Invite team members

Use POST /projects/{project_id}/invite to send invitations by email, assigning each invitee an access_level. Invitees see the invitation in their inbox and can accept or reject it.
3

Ingest sensor data

Upload CSV or XLSX files, or configure a polling API endpoint, through the data resource modal. Each source becomes a named dataset within the project’s datasets array.
4

Visualize and monitor

Open the project dashboard to view time-series charts for every dataset. Each dataset renders using its configured defaultChartType and only shows the selectedColumns you chose during setup.

Favorites

Any team member with an ACCEPTED ProjectPermission can mark a project as a favorite by calling PATCH /projects/{project_id}/favorite. This toggles the is_favorite boolean on their ProjectPermission row — it is a per-user preference and does not affect other members’ views. Favorited projects are sorted to the top of the GET /projects listing, before all non-favorited projects within the same recency order.

Searching Projects

Pass a ?q= query parameter to GET /projects to filter results by project name using a case-insensitive ILIKE match:
GET /projects?q=chapel
The search runs only on the name field. SUPER_ADMIN and GENERAL_ADMIN users see all matching projects platform-wide; all other roles see only projects they have an ACCEPTED permission for.

Build docs developers (and LLMs) love