
Open source domain specific language to describe prefab construction elements.
API Documentation • npm • FastAPI Server • Issues • mod.construction
mod-dlm is an open-source domain-specific language (DSL) for describing prefab elements in the Architecture, Engineering, and Construction (AEC) industry. This project provides tools for defining entity models and automatically generating CRUD APIs, enabling suppliers to create and manage catalogs of their products easily.
You can always find the most up-to-date API documentation here: https://mod-construction.github.io/mod-dlm/
- Domain-Specific Language: Define prefab elements with a custom DSL tailored for the AEC industry.
- Automatic CRUD API Generation: Generate RESTful APIs for managing prefab elements.
- Multi-language Support: Define entities once and generate code in multiple languages including TypeScript, Python, Java, and Go.
- 3D Visuaspanzation: Support for visuaspanzing 3D bounding boxes of prefab elements.
- Comprehensive Metadata: Include critical attributes such as material composition, dimensions, weight, thermal properties, and more.
- Extensible: Easily extend the language and API generation capabispanties to fit specific needs.
erDiagram
PrefabElement {
string id
string name
string description
BoundingBox boundingBox
string[] images
string buildingSystem
string productCategory
Material material
Dimensional dimensional
StructuralProperties structuralProperties
Performance performance
Sustainability sustainability
DocumentationAndCompliance documentationAndCompliance
InstallationAndConnectivity installationAndConnectivity
LifecycleAndMaintenance lifecycleAndMaintenance
AestheticAndCustomizationOptions aestheticAndCustomizationOptions
EconomicFactors economicFactors
}
BoundingBox {
number width
number height
number depth
}
Material {
string finishMaterial
string structuralMaterial
}
Dimensional {
Range width
Range height
Range length
}
Range {
number min
number max
}
StructuralProperties {
LoadBearingCapacity loadBearingCapacity
string seismicResistance
string windLoadResistance
}
LoadBearingCapacity {
number maximumLoad
string unit
string loadDistribution
}
Performance {
string resistanceToFireClassification
number thermalTransmittance
AcousticProperties acousticProperties
}
AcousticProperties {
string soundInsulationRating
string acousticPerformance
}
Sustainability {
string countryOfManufacturing
string classification
string VOCEmissions
string recyclability
string energyEfficiency
}
DocumentationAndCompliance {
string technicalSpecifications
Certifications certifications
}
Certifications {
string[] certificationTypes
string[] regulatoryApprovals
}
InstallationAndConnectivity {
string connectionType
string installationTime
string compatibility
}
LifecycleAndMaintenance {
string expectedLifespan
string maintenanceRequirements
string warranty
}
AestheticAndCustomizationOptions {
string[] colorOptions
string texture
string modularAdaptability
}
EconomicFactors {
number costPerUnit
string manufacturingLeadTime
}
PrefabElement ||--o{ BoundingBox : has
PrefabElement ||--o{ Material : has
PrefabElement ||--o{ Dimensional : has
PrefabElement ||--o{ StructuralProperties : has
StructuralProperties ||--o{ LoadBearingCapacity : contains
PrefabElement ||--o{ Performance : has
Performance ||--o{ AcousticProperties : contains
PrefabElement ||--o{ Sustainability : has
PrefabElement ||--o{ DocumentationAndCompliance : has
DocumentationAndCompliance ||--o{ Certifications : contains
PrefabElement ||--o{ InstallationAndConnectivity : has
PrefabElement ||--o{ LifecycleAndMaintenance : has
PrefabElement ||--o{ AestheticAndCustomizationOptions : has
PrefabElement ||--o{ EconomicFactors : has
Dimensional ||--o{ Range : contains
For a complete starter guide, see Hello Prefab Project
Make sure you have the following installed:
- Node.js (version 16 or later)
- npm (comes with Node.js)
npm install @mod-construction/mod-dlm@latest -D
You can use mod-dlm in different scenarios.
import { PrefabElement, PrefabElementSchema } from "@mod-construction/mod-dlm";
const examplePrefabElement: PrefabElement = {
id: '8be9e7b3-de6c-4621-8751-3a1b12d71f94',
name: 'Insulated Concrete Wall Panel',
description: 'A high-performance insulated concrete wall panel suitable for residential and commercial buildings.',
boundingBox: {
width: 3000, // in millimeters
height: 6000, // in millimeters
depth: 200 // in millimeters
},
images: [
'https://example.com/images/panel-front.jpg',
'https://example.com/images/panel-back.jpg'
],
buildingSystem: 'Wall',
productCategory: 'Insulated Concrete Panels',
material: {
finishMaterial: 'Concrete',
structuralMaterial: 'Concrete'
},
dimensional: {
width: {
min: 1000,
max: 4000
},
height: {
min: 2000,
max: 8000
},
length: {
min: 100,
max: 300
}
},
structuralProperties: {
loadBearingCapacity: {
maximumLoad: 5000,
unit: 'kN',
loadDistribution: 'Uniform'
},
seismicResistance: 'Zone 3',
windLoadResistance: 'Class C'
},
performance: {
resistanceToFireClassification: 'A2',
thermalTransmittance: 0.25,
acousticProperties: {
soundInsulationRating: 'Rw 55 dB',
acousticPerformance: 'High'
}
},
sustainability: {
countryOfManufacturing: 'Germany',
classification: 'A',
VOCEmissions: 'Low',
recyclability: '75%',
energyEfficiency: 'LEED Gold'
},
documentationAndCompliance: {
technicalSpecifications: 'https://example.com/specifications/panel-001.pdf',
certifications: {
certificationTypes: ['ISO 9001', 'CE Marking'],
regulatoryApprovals: ['EN 14992', 'DIN 4102']
}
},
installationAndConnectivity: {
connectionType: 'Bolt-on',
installationTime: '2 hours per panel',
compatibility: 'Concrete Structure'
},
lifecycleAndMaintenance: {
expectedLifespan: '50 years',
maintenanceRequirements: 'Periodic inspection every 5 years',
warranty: '10-year manufacturer warranty'
},
aestheticAndCustomizationOptions: {
colorOptions: ['Gray', 'White', 'Beige'],
texture: 'Smooth',
modularAdaptability: 'Compatible with modular building systems'
},
economicFactors: {
costPerUnit: 1500, // in euros
manufacturingLeadTime: '4 weeks'
}
};
// You can use this object to interact with other parts of your application or library
console.log('New element defined:', examplePrefabElement);
import { PrefabElement, PrefabElementSchema } from "@mod-construction/mod-dlm";
const examplePrefabElement: PrefabElement = {
id: '8be9e7b3-de6c-4621-8751-3a1b12d71f94',
name: 'Insulated Concrete Wall Panel',
description: 'A high-performance insulated concrete wall panel suitable for residential and commercial buildings.',
boundingBox: {
width: 3000, // in millimeters
height: 6000, // in millimeters
depth: 200 // in millimeters
},
images: [
'https://example.com/images/panel-front.jpg',
'https://example.com/images/panel-back.jpg'
],
buildingSystem: 'Wall',
productCategory: 'Insulated Concrete Panels',
material: {
finishMaterial: 'Concrete',
structuralMaterial: 'Concrete'
},
dimensional: {
width: {
min: 1000,
max: 4000
},
height: {
min: 2000,
max: 8000
},
length: {
min: 100,
max: 300
}
},
structuralProperties: {
loadBearingCapacity: {
maximumLoad: 5000,
unit: 'kN',
loadDistribution: 'Uniform'
},
seismicResistance: 'Zone 3',
windLoadResistance: 'Class C'
},
performance: {
resistanceToFireClassification: 'A2',
thermalTransmittance: 0.25,
acousticProperties: {
soundInsulationRating: 'Rw 55 dB',
acousticPerformance: 'High'
}
},
sustainability: {
countryOfManufacturing: 'Germany',
classification: 'A',
VOCEmissions: 'Low',
recyclability: '75%',
energyEfficiency: 'LEED Gold'
},
documentationAndCompliance: {
technicalSpecifications: 'https://example.com/specifications/panel-001.pdf',
certifications: {
certificationTypes: ['ISO 9001', 'CE Marking'],
regulatoryApprovals: ['EN 14992', 'DIN 4102']
}
},
installationAndConnectivity: {
connectionType: 'Bolt-on',
installationTime: '2 hours per panel',
compatibility: 'Concrete Structure'
},
lifecycleAndMaintenance: {
expectedLifespan: '50 years',
maintenanceRequirements: 'Periodic inspection every 5 years',
warranty: '10-year manufacturer warranty'
},
aestheticAndCustomizationOptions: {
colorOptions: ['Gray', 'White', 'Beige'],
texture: 'Smooth',
modularAdaptability: 'Compatible with modular building systems'
},
economicFactors: {
costPerUnit: 1500, // in euros
manufacturingLeadTime: '4 weeks'
}
};
// Validate the element using the PrefabElementSchema
const validation = PrefabElementSchema.safeParse(examplePrefabElement);
if (validation.success) {
console.log('Element is valid:', validation.data);
} else {
console.error('Element validation failed:', validation.error);
}
This is a short guide to get you up and running in no time, even if you are not familiar with setting up a typescript project.
Make sure you have the following installed:
- Node.js (version 16 or later)
- npm (comes with Node.js)
-
Open your terminal and create a new directory for your project:
mkdir mod-dlm-project cd mod-dlm-project
-
Initialize a new Node.js project:
npm init -y
- Install TypeScript and the required types.
npm install typescript @types/node --save-dev
- Initialize a
TypeScript
configuration file.npx tsc --init
- To auto-restart your project when you make changes, install
nodemon
.npm install nodemon --save-dev
- Install
mod-dlm
.npm install @mod-construction/mod-dlm@latest -D
Update the scripts section in your package.json:
"scripts": {
"start": "tsc && node index.js",
"dev": "nodemon --watch src --ext ts --exec \"ts-node index.ts\""
},
- Create an
index.ts
file in the root and paste the following code in it:
import { PrefabElement, PrefabElementSchema } from "@mod-construction/mod-dlm";
const examplePrefabElement: PrefabElement = {
id: '8be9e7b3-de6c-4621-8751-3a1b12d71f94',
name: 'Insulated Concrete Wall Panel',
description: 'A high-performance insulated concrete wall panel suitable for residential and commercial buildings.',
boundingBox: {
width: 3000, // in millimeters
height: 6000, // in millimeters
depth: 200 // in millimeters
},
images: [
'https://example.com/images/panel-front.jpg',
'https://example.com/images/panel-back.jpg'
],
buildingSystem: 'Wall',
productCategory: 'Insulated Concrete Panels',
material: {
finishMaterial: 'Concrete',
structuralMaterial: 'Concrete'
},
dimensional: {
width: {
min: 1000,
max: 4000
},
height: {
min: 2000,
max: 8000
},
length: {
min: 100,
max: 300
}
},
structuralProperties: {
loadBearingCapacity: {
maximumLoad: 5000,
unit: 'kN',
loadDistribution: 'Uniform'
},
seismicResistance: 'Zone 3',
windLoadResistance: 'Class C'
},
performance: {
resistanceToFireClassification: 'A2',
thermalTransmittance: 0.25,
acousticProperties: {
soundInsulationRating: 'Rw 55 dB',
acousticPerformance: 'High'
}
},
sustainability: {
countryOfManufacturing: 'Germany',
classification: 'A',
VOCEmissions: 'Low',
recyclability: '75%',
energyEfficiency: 'LEED Gold'
},
documentationAndCompliance: {
technicalSpecifications: 'https://example.com/specifications/panel-001.pdf',
certifications: {
certificationTypes: ['ISO 9001', 'CE Marking'],
regulatoryApprovals: ['EN 14992', 'DIN 4102']
}
},
installationAndConnectivity: {
connectionType: 'Bolt-on',
installationTime: '2 hours per panel',
compatibility: 'Concrete Structure'
},
lifecycleAndMaintenance: {
expectedLifespan: '50 years',
maintenanceRequirements: 'Periodic inspection every 5 years',
warranty: '10-year manufacturer warranty'
},
aestheticAndCustomizationOptions: {
colorOptions: ['Gray', 'White', 'Beige'],
texture: 'Smooth',
modularAdaptability: 'Compatible with modular building systems'
},
economicFactors: {
costPerUnit: 1500, // in euros
manufacturingLeadTime: '4 weeks'
}
};
// You can use this object to interact with other parts of your application or library
console.log('New element defined:', examplePrefabElement);
To tun your code, simply run the following command in your terminal:
npm run dev
We appreciate feedback and contribution to this project! Before you get started, please see the following:
A huge thank you to all the amazing contributors who have helped make this project better. You can find the full list of contributors here.