| title | Creator Layer |
|---|---|
| description | Layer A: ObjectStack SDK - Define the World in Your IDE |
"Define the World in Your IDE"
The Creator Layer is where developers work—writing code, defining metadata, and building business logic without leaving their familiar IDE environment. This layer eliminates the need for web-based admin consoles by bringing all configuration and development into TypeScript code.
In the ObjectStack Enterprise Framework, the Creator Layer represents the developer's primary workspace. Instead of clicking through configuration screens, developers use:
- ObjectStack CLI: Command-line tools for rapid scaffolding and project management
- TypeScript SDK: Type-safe APIs for defining objects, logic, and interfaces
- Metadata as Code: Everything from schemas to UI layouts exists as version-controlled code
"No Black Boxes. All business definitions exist in local code, based on TypeScript, clear and transparent."
This layer embodies the principle of transparency:
- All metadata is readable TypeScript code
- All changes are tracked in Git
- All business logic is testable and refactorable with standard IDE tools
ostack init my-enterprise-app
cd my-enterprise-appThis generates a standard project structure with:
- Pre-configured TypeScript setup
- ObjectStack SDK dependencies
- Example objects and workflows
- Testing infrastructure
Define business entities using the SDK:
import { defineObject, Field } from '@objectstack/sdk';
export const Contract = defineObject({
name: 'contract',
label: 'Sales Contract',
fields: {
title: Field.String({
label: 'Title',
required: true
}),
amount: Field.Currency({
label: 'Amount',
precision: 18,
scale: 2
}),
status: Field.Select({
options: ['draft', 'signed', 'cancelled'],
defaultValue: 'draft'
})
}
});Write business logic as TypeScript functions:
export const Contract = defineObject({
// ... fields ...
triggers: {
beforeInsert: async ({ doc }) => {
if (doc.amount < 0) {
throw new Error("Amount cannot be negative");
}
},
afterUpdate: async ({ doc, oldDoc }) => {
if (doc.status === 'signed' && oldDoc.status !== 'signed') {
doc.signedAt = new Date();
}
}
}
});ostack devThis starts a hot-reloading development server where you can:
- Test changes instantly
- Debug with Chrome DevTools
- Iterate rapidly without deploying
The Creator Layer outputs Metadata as Code which flows into the Governance Layer (CI/CD Pipeline) for compilation and deployment.
graph LR
CLI[ObjectStack CLI] --> MetaCode[Metadata as Code]
SDK[TypeScript SDK] --> MetaCode
MetaCode --> Extract[Governance Layer]
style CLI fill:#e1f5ff
style SDK fill:#e1f5ff
style MetaCode fill:#fff4e1
- Full IntelliSense support in VS Code
- Compile-time error detection
- Refactoring with confidence
- All changes are commits
- Code reviews via Pull Requests
- Rollback is just
git revert
- Your code lives in your repository
- Can be read and modified without special tools
- Portable across environments
- SDK Reference: Detailed API documentation for
@objectstack/sdk - CLI Guide: Command reference and usage examples
Next: Governance Layer - Learn how your code gets built and deployed