Skip to main content
This page lives in the Developers section and is also referenced from Deployment. If you arrived from there, your sidebar has switched to Developers.

Data Model

CDT's domain types are defined in @collabdt/core/types/dbTypes.ts and shared across hooks, API adapters, and components. Every entity maps directly to a Prisma model on the backend.

Entities

Building

The primary asset type. Tracks address, geometry, occupancy, energy, funding, assessments, and unit breakdown.

Key fields:

FieldTypeDescription
idnumberPrimary key
buildingNamestring?Display name
buildingLatitude / buildingLongitudenumber?Map coordinates
buildingTypestring[]One or more building use categories
buildingOccupantTypeBuildingOccupantType[]Resident demographics
buildingProjectPhaseBuildingProjectPhase?Lifecycle phase
buildingProjectTypeBuildingProjectType?Modification, renovation, new build, etc.
buildingGeometryStyleBuildingGeometryStyle?Complex, Simple, or Apartment
featureIdstring?External GIS feature identifier
buildingParentSiteIdnumber?Site this building belongs to

Site

A geographic area that may contain multiple buildings. Tracks land use, ownership, energy, funding, and project phases.

Key fields:

FieldTypeDescription
idnumberPrimary key
siteNamestring?Display name
siteLatitude / siteLongitudenumber?Map coordinates
siteLandUseSiteLandUse?Residential, Industrial, Park, etc.
siteProjectPhaseSiteProjectPhase?Lifecycle phase
siteOrganizationIdnumberOwning organization

Infrastructure

Civil infrastructure assets with IFC and CityGML attribute support. Covers roads, railways, bridges, utilities, and survey data.

Key fields:

FieldTypeDescription
idnumberPrimary key
infrastructureTypeInfrastructureType?LandFeature, Road, Railway, Bridge, etc.
infrastructureStateInfrastructureState?Existing, Proposed, UnderConstruction, etc.
ifcDomainIfcInfrastructureDomain?IFC domain (IfcRoad, IfcRailway, IfcBridge, etc.)
cityGmlLodCityGmlLod?LOD0–LOD4
organizationIdnumberOwning organization

See IFC Infrastructure Types for the full enum reference.

Sensor

IoT sensor placed in the 3D world. Can be attached to a building or positioned freely by coordinates.

Key fields:

FieldTypeDescription
idnumberPrimary key
namestringDisplay name
typeIdnumber?References SensorType
viewerViewerNamesWhich viewer context this sensor appears in
visiblebooleanVisibility toggle
datastringRaw sensor data payload
dataFormatSensorDataFormatCsv or Json
updateFrequencynumberPolling interval in seconds
maxThreshold / minThresholdnumber?Alert thresholds
tagsstring[]Grouping tags

SensorType

Defines the appearance and value range for a category of sensors.

FieldTypeDescription
idnumberPrimary key
nameSensorTypesTemperature, Humidity, Air Quality, etc.
iconstringLucide icon name
minValue / maxValuenumberValue scale
minColour / midColour / maxColourstringColour gradient for visualisation

DbFile

Files attached to buildings, sites, or users. Supports IFC models, point clouds, images, and generic documents.

Key fields:

FieldTypeDescription
idnumberPrimary key
assetIdstringMinIO object key
typestringMIME category
lazFileKey / potreeFolderKeystring?Point cloud asset references
pointCloudUploaded / pointCloudPotreeConvertedboolean?Processing status

User

FieldTypeDescription
idnumberPrimary key
emailstringLogin credential
roleIdnumberReferences Role
organizationIdnumber?Owning organization

Organization

Tenant record. Controls branding, map defaults, feature flags, and language support.

FieldTypeDescription
idnumberPrimary key
namestringURL slug / identifier
appContentViewerNames[]Enabled viewers for this org
languagesLanguage[]Supported locales
bboxnumber[]Map bounding box [w, s, e, n]
mapStylesunknown[]Custom MapLibre style definitions

OpenDataPortal

External open data source registered to the platform.

FieldTypeDescription
idnumberPrimary key
namestringDisplay name
groupDatasetGroupOrganizational, Municipal, National, Provincial
dataManagementSystemDataManagementSystem?Ckan, Arcgis, Opendatasoft, Socrata, Other
portalUrl / apiUrlstring?Web and API endpoints

Comment

Geospatial annotation pinned to a viewer, building, or 3D position.

FieldTypeDescription
idnumberPrimary key
viewerViewerNamesWhich viewer the comment belongs to
visiblebooleanVisibility toggle
replyToIdnumber?Thread parent
buildingIdnumber?Optional building attachment

Key Enumerations

ViewerNames

Controls which sections of the app are available to an organization and routes state to the correct viewer.

enum ViewerNames {
auth, map, bim, pointcloud, buildings,
sites, files, land, infrastructure,
extensions, settings, users
}

Language

enum Language { En = 'En', Fr = 'Fr', Es = 'Es' }

InfrastructureType

enum InfrastructureType {
LandFeature, Facility, Project, Alignment,
Road, Railway, Survey, LandDivision, Condominium, Other
}

SensorTypes

enum SensorTypes {
Temperature, Light, Humidity, Energy_Consumption,
Movement, Air_Quality, Atmospheric_Pressure,
Irradiance, Flow, State, Noise_Level
}

BuildingProjectPhase / SiteProjectPhase

Both share the same phase vocabulary: Inception_Phase → Conceptualization_Phase → Criteria_Definition_Phase → Design_Phase → Coordination_Phase → Implementation_Phase → Handover_Phase → Operations_Phase

Key Files

FileRole
@collabdt/core/types/dbTypes.tsAll domain interfaces and enums
@collabdt/core/types/datasetTypes.tsDataset and tile layer types
@collabdt/core/types/global.tsShared utility types (Position, etc.)