| title | Developer Guide |
|---|---|
| description | Learn to build enterprise applications with the ObjectStack Protocol |
This guide teaches you how to build real applications using the ObjectStack Protocol. Each section is hands-on, with code examples derived from the HotCRM reference app.
**New to ObjectStack?** Start with the [Example Apps](/docs/getting-started/examples) to see working code, or read the [Introduction](/docs/getting-started) for the architecture overview.npx @objectstack/cli init my-app
cd my-appInstall the ObjectStack skill bundle so your AI assistant (Claude Code, Copilot, Cursor, …) knows the protocol's schemas and conventions:
npx skills add objectstack-ai/framework --allRe-run the same command any time to update — the bundle is versioned as one unit. See the AI Skills Reference for the full catalog.
Scaffolding with `npm create objectstack@latest` runs this step automatically.The scaffolded project includes a sample object. Open src/objects/my_app.ts:
import { ObjectSchema, Field } from '@objectstack/spec/data';
const myApp = ObjectSchema.create({
name: 'my_app',
label: 'My App',
ownership: 'own',
fields: {
name: Field.text({ label: 'Name', required: true }),
description: Field.textarea({ label: 'Description' }),
status: Field.select({
label: 'Status',
options: [
{ label: 'Draft', value: 'draft' },
{ label: 'Active', value: 'active' },
{ label: 'Archived', value: 'archived' },
],
defaultValue: 'draft',
}),
},
});
export default myApp;os studioOpen http://localhost:3000/_studio/ to browse your objects, test the REST API, and inspect metadata. The server automatically provides:
- ObjectQL Engine — Query layer with CRUD operations
- InMemory Driver — Zero-config data storage for development
- Hono HTTP Server — REST API at
/api/v1/{object} - Console UI — Admin interface at
/_studio/
os g object customer # Generate a new object
os g action approve # Generate an action
os g flow onboarding # Generate an automation flowos validate # Check schema correctness
os compile # Generate production artifact → dist/objectstack.json
os start # Boot from the compiled artifact (no config file needed)The compiled dist/objectstack.json is a portable, self-describing deployment unit — see
CLI → Source vs Artifact for details.
Follow these guides in order for the best experience:
A typical ObjectStack application (generated by os init):
my-app/
├── objectstack.config.ts # App manifest + metadata wiring
├── package.json
├── tsconfig.json
├── src/
│ ├── objects/ # Data models (required)
│ │ ├── index.ts # Barrel export
│ │ └── my_app.ts # Object definition
│ ├── actions/ # Buttons, batch operations
│ ├── flows/ # Automation logic
│ ├── apps/ # Navigation definitions
│ ├── dashboards/ # Analytics dashboards
│ ├── agents/ # AI agents
│ └── rag/ # RAG pipelines
└── test/ # Tests
File naming conventions:
- Object files:
{name}.object.tsor{name}.ts(one object per file) - Action files:
{name}.actions.ts - Flow files:
{name}.flow.ts - Barrel exports: Each directory has an
index.tsthat re-exports everything
| Concept | Protocol | You Define | ObjectStack Provides |
|---|---|---|---|
| Data Model | ObjectQL | Objects, Fields, Validation | CRUD APIs, database schema, type safety |
| User Interface | ObjectUI | Views, Apps, Dashboards | React components, navigation, responsive layout |
| Business Logic | Automation | Flows, Workflows, Triggers | Event handlers, approval chains, scheduled jobs |
| Access Control | Security | Profiles, Permissions, Sharing | Middleware, RLS policies, field masking |
| Intelligence | AI | Agents, RAG, Models | Chat interfaces, search indexes, predictions |
- Example Apps — Run the Todo, CRM, and BI examples
- Data Modeling Guide — Deep dive into objects and fields
- CLI Reference — All available commands
- Protocol Reference — Complete schema documentation