ObjectStack

July 15, 2026 · View on GitHub

TypeScript License: Apache 2.0 Version Tests

A metadata protocol and TypeScript toolkit for AI-native business apps. Describe your objects, permissions, workflows, APIs, UI, and AI tools once as typed, version-controlled Zod metadata — and ObjectStack derives the TypeScript types, REST API, client SDK, UI, and MCP tools from that single definition.

ObjectStack (this repo)  →  for builders — the open-source protocol, toolkit, and production runtime
ObjectOS                 →  for end users — the commercial runtime environment (Cloud & Enterprise)

This repo is the framework: the protocol, kernel, SDK, CLI, and production runtime you build — and ship — with. os start or the official Docker image ghcr.io/objectstack-ai/objectstack runs your compiled app in production, Console and governance included, entirely on open source. · Try a live app in ~30s on StackBlitz (no install).

ObjectStack architecture: author typed Zod metadata (objects, flows, views, policies); the microkernel compiles it into a versioned JSON artifact and loads plugins, drivers, and services; it generates a REST API, client SDK, Console and Studio UI, and MCP tools used by developers and AI agents, governed by Auth, RBAC, RLS, FLS, and audit, over PostgreSQL, MySQL, SQLite, or MongoDB
One typed definition → TypeScript types, REST API, client SDK, UI, and MCP tools.

What is ObjectStack?

ObjectStack is an open-source (Apache-2.0) metadata protocol and toolkit for describing business applications — so one typed definition powers your data model, API, UI, and AI tools — plus the production runtime that serves them. AI operates your app under your permissions through the built-in MCP server.

Instead of hiding business logic inside ad-hoc SQL queries, UI state, or JavaScript strings, ObjectStack makes the business system explicit:

  • Business objects are Zod schemas with typed fields, relations, validation, and permissions.
  • Business actions are generated from metadata as REST APIs, SDK calls, and MCP tools.
  • Business logic is represented as analyzable metadata: flows, conditions, policies, and artifacts.
  • Business runtime is a microkernel that loads plugins, drivers, services, and compiled environment artifacts.

The goal is not to be another low-code UI builder. ObjectStack is the structured definition layer for AI-native business software — agent-ready, versioned, and analyzable; permissions and audit are enforced by the runtime.

ObjectStack is built around three layers:

  • ObjectQL (Data Layer) — Objects, fields, queries, relations, validation, and data access.
  • Kernel (Control Layer) — Runtime, permissions, automation, plugins, environments, and artifact loading.
  • ObjectUI (View Layer) — Apps, views, dashboards, actions, and presentation metadata.

All core definitions start with Zod schemas (1,600+ exported schemas across 200 schema files). TypeScript types, JSON Schemas, REST routes, UI metadata, and agent tools are derived from the same source of truth.

See ARCHITECTURE.md for the full microkernel and layer architecture documentation, and content/docs/concepts/north-star.mdx for the product north star (metadata protocols · environment-aware runtime · compiled app artifacts).

Author your app — in code or in Studio

Everything is typed metadata. Define a business object once — fields, a color-coded picklist, validation — all declarative:

import { ObjectSchema, Field } from '@objectstack/spec/data';

export const Task = ObjectSchema.create({
  name: 'todo_task',
  label: 'Task',
  fields: {
    subject: Field.text({ label: 'Subject', required: true, searchable: true }),
    status: Field.select({
      label: 'Status',
      required: true,
      options: [
        { label: 'In Progress', value: 'in_progress', color: '#3B82F6' },
        { label: 'Completed', value: 'completed', color: '#10B981' },
      ],
    }),
    due_date: Field.date({ label: 'Due Date' }),
  },
});

From that single schema, ObjectStack derives the database table, an auto-generated REST API and typed client SDK, UI views (list, board, calendar, Gantt…), and MCP tools for agents — all from one definition.

Prefer clicking? Author the same metadata visually in Studio — objects, relations, validation, and flows — and it compiles to the exact same artifacts:

Studio object designer showing the Opportunity object's typed fields, lookups, and layout sections Studio flow designer showing a visual DAG that enrolls leads into a campaign

Model objects as typed metadata  ·  Automate with visual flows — both produce the same analyzable metadata.

Want to see it running? os dev serves the live Console locally, and os start (or the official Docker image) ships the same Console to production — dashboards, boards, calendars, records, and AI working your data under your permissions.

Key Features

  • AI-native, not retrofitted — Objects, permissions, flows, APIs, and UI are declarative typed metadata, small enough for an agent to load end-to-end. That metadata generates an automatic tool surface — REST APIs, client SDKs, UI views, and an MCP server — so agents inspect and act through the same contracts you defined.
  • Protocol-first runtime — Every definition starts as a Zod schema (z.infer<> types), compiles into versioned, self-describing JSON artifacts, and runs on a microkernel plugin system (DI container, EventBus, init → start → destroy lifecycle).
  • Data & framework reach — In-memory, PostgreSQL, MySQL, SQLite, and MongoDB drivers; 7 framework adapters (Express, Fastify, Hono, NestJS, Next.js, Nuxt, SvelteKit); a client SDK with React hooks (useQuery / useMutation / usePagination).
  • Governance & built-ins — better-auth, RBAC / RLS / FLS, a DAG-based automation engine, an MCP server that exposes the app to your own AI (BYO-AI), the ObjectUI Console, and a full CLI (os init / dev / compile / validate / …).

Why AI-native?

Most internal-tool and low-code platforms were designed for humans clicking screens. AI support is usually added later as a chat box that can call a few predefined queries. ObjectStack starts from a different assumption: AI agents need a structured, bounded, and auditable business backend before they can safely perform real work — and the entire business system has to be small enough to fit in an agent's context window.

A typical enterprise application is tens of thousands of lines of CRUD, forms, queries, permissions, and API glue spread across dozens of files. ObjectStack collapses the same surface into a few hundred lines of typed metadata — roughly two orders of magnitude less code for a developer (or an AI agent) to read, write, and maintain.

The point isn't lines of code. The point is fit in an agent's context window. When the entire business system is small, typed, and declarative, an AI agent can load it end-to-end, reason about every dependency, and safely refactor across data, API, UI, and permissions in a single change. That turns AI from an autocomplete tool into a real co-maintainer of production business software.

DimensionRetool / Appsmith-style toolsObjectStack
Business modelImplicit in pages, queries, and scriptsExplicit Zod ObjectSchema metadata
Code footprintThousands of lines of queries, JS, and UI state per app~100× less — declarative metadata replaces CRUD, forms, validation, and API glue
Business logicJavaScript snippets and query glueFlows, policies, conditions, and typed metadata
External contractApp-specific UI stateSelf-describing JSON Environment Artifact
Agent toolsManually defined one by oneGenerated from metadata and permissions
Agent reasoningCalls predefined queriesReads the full schema, composes safe actions, respects boundaries
AI maintainabilityAgents must crawl sprawling app codeWhole app fits in an agent's context window
GovernanceApp-level conventionsAuth, RBAC, RLS, FLS, audit, and versioned artifacts

Described in ObjectStack and served by its runtime, this is the substrate for AI-native business apps — CRM, support, operations, and workflow agents acting on real business data without bypassing permissions or audit.

Quick Start

For Application Developers

# Create a new project
npx create-objectstack my-app
cd my-app

# Start dev server (REST API + console UI)
pnpm dev
# → API:    http://localhost:3000/api/v1/
# → Console: http://localhost:3000/_console/

Alternatively, with the CLI installed: os init my-app && cd my-app && os dev.

For Framework Contributors

# 1. Clone and install
git clone https://github.com/objectstack-ai/framework.git
cd framework
pnpm install

# 2. Build all packages
pnpm build

# 4. Start ObjectStack Showcase
pnpm dev

Monorepo Scripts

ScriptDescription
pnpm buildBuild all packages (excludes docs)
pnpm devRun the showcase kitchen-sink example (@objectstack/example-showcase) — REST + Studio; exercises every metadata type, view, automation, AI & security chain
pnpm dev:showcaseSame as pnpm dev (explicit alias)
pnpm dev:crmRun the minimal CRM example (@objectstack/example-crm)
pnpm dev:todoRun the Todo example (@objectstack/example-todo)
pnpm objectui:refreshPull the sibling ../objectui build into packages/console/
pnpm testRun all tests (Turborepo)
pnpm setupInstall dependencies and build the spec package
pnpm docs:devStart the documentation site locally
pnpm docs:buildBuild documentation for production

CLI Commands

The CLI binary ships as both os and objectstack.

os init [name]    # Scaffold a new project
os create         # Interactive project / object scaffolder
os dev            # Start dev server with hot-reload (REST + console)
os start          # Start the production server
os serve          # Serve a compiled artifact
os compile        # Build a deployable JSON Environment Artifact
os validate       # Validate metadata against the protocol
os lint           # Lint metadata for best-practice violations
os info           # Display project metadata summary
os generate       # Scaffold objects, views, flows, agents, migrations
os doctor         # Check environment health
os explain        # Explain protocol concepts on the command line

Cloud, package registry, and environment management subcommands (os package publish, os package install, os login, os whoami, os environments, os cloud …) are available when targeting an ObjectStack Cloud control plane.

Use the generated API

Every object ships a REST API automatically — no controllers to write:

# CRUD endpoints for the `todo_task` object you defined above
curl http://localhost:3000/api/v1/todo_task

For the browser, the typed client SDK and React hooks (useQuery / useMutation / usePagination) live in @objectstack/client-react. Need a new capability? Write a plugin, driver, or service against the same kernel APIs — every built-in is one (see below).

Package Directory

72 published packages across core, engine, drivers, client, plugins, services, adapters, tools, and examples — click to expand.

Core

PackageDescription
@objectstack/specProtocol definitions — Zod schemas, TypeScript types, JSON Schemas, constants
@objectstack/coreMicrokernel runtime — Plugin system, DI container, EventBus, Logger
@objectstack/typesShared TypeScript type utilities
@objectstack/formulaCanonical expression engine — CEL (cel-js) + ObjectStack stdlib for formula fields, predicates, conditions, dynamic defaults
@objectstack/platform-objectsBuilt-in platform object schemas — identity, security, audit, notification, package, and environment

Engine

PackageDescription
@objectstack/objectqlObjectQL query engine and schema registry
@objectstack/runtimeRuntime bootstrap — DriverPlugin, AppPlugin
@objectstack/metadataMetadata loading and persistence
@objectstack/restAuto-generated REST API layer

Drivers

PackageDescription
@objectstack/driver-memoryIn-memory driver (development and testing)
@objectstack/driver-sqlSQL driver — PostgreSQL, MySQL, SQLite (production)
@objectstack/driver-mongodbMongoDB driver (native document database)

Turso / libSQL driver (@objectstack/driver-turso) and the libSQL-backed vector knowledge plugin (@objectstack/knowledge-turso) live in the ObjectStack Cloud monorepo as of this release.

Client

PackageDescription
@objectstack/clientClient SDK — CRUD, batch API, error handling
@objectstack/client-reactReact hooks — useQuery, useMutation, usePagination

Plugins

PackageDescription
@objectstack/plugin-hono-serverHono-based HTTP server plugin
@objectstack/mcpModel Context Protocol server — exposes ObjectStack to AI agents
@objectstack/plugin-authAuthentication plugin (better-auth)
@objectstack/plugin-securityRBAC, Row-Level Security, Field-Level Security
@objectstack/plugin-sharingRecord-level sharing — sys_record_share + enforcement middleware
@objectstack/plugin-approvalsApproval as a flow node — approver resolution, record lock & status mirror over sys_approval_request + sys_approval_action
@objectstack/plugin-auditAudit logging plugin
@objectstack/plugin-emailPluggable outbound email transport
@objectstack/plugin-webhooksOutbound webhook delivery — fan-out data.record.* events
@objectstack/plugin-reportsSaved reports + scheduled email digests
@objectstack/plugin-devDeveloper mode — in-memory stubs for all services

Services

PackageDescription
@objectstack/service-analyticsAnalytics — aggregations, time series, funnels, dashboards
@objectstack/service-automationAutomation engine — flows, triggers, and workflow state machines
@objectstack/service-cacheCache — in-memory, Redis, multi-tier
@objectstack/service-feedActivity feed / chatter
@objectstack/service-i18nInternationalization service
@objectstack/service-jobCron & interval job scheduler
@objectstack/service-packagePackage registry — publish, version, retrieve metadata packages
@objectstack/service-queueBackground job queue (in-memory, BullMQ)
@objectstack/service-realtimeReal-time events and subscriptions
@objectstack/service-settingsSettings — manifest registry + K/V resolver (Env > Tenant > User)
@objectstack/service-storageFile storage (local, S3, R2, GCS)

Framework Adapters

PackageDescription
@objectstack/honoHono adapter (Node.js, Bun, Deno, Cloudflare Workers) — the supported HTTP adapter

Tools & Apps

Package / AppDescription
@objectstack/cliCLI binary (os / objectstack) — init, dev, start, serve, compile, publish, validate, generate, lint, doctor
create-objectstackProject scaffolder (npx create-objectstack)
objectstack-vscodeVS Code extension — autocomplete, validation, diagnostics
@object-ui/consoleFork-ready runtime console SPA (lives in objectstack-ai/objectui, served via @object-ui/console on npm)
@objectstack/accountAccount & identity portal — sign in, organizations, connected apps
@objectstack/docsDocumentation site (Fumadocs + Next.js)

Examples

ExampleDescriptionLevel
@objectstack/example-todoTask management app — objects, views, dashboards, flowsBeginner
@objectstack/example-crmMinimal CRM smoke-test workspace — validates the metadata loading pipelineIntermediate
HotCRMFull-featured enterprise CRM reference app (separate repo)Advanced

Architecture

ObjectStack uses a microkernel architecture where the kernel provides only the essential infrastructure (DI, EventBus, lifecycle), and all capabilities are delivered as plugins. The three layers sit above the microkernel:

ObjectStack layered architecture: the ObjectQL data layer, the kernel control layer, and the ObjectUI view layer sit on a microkernel (plugin lifecycle, service registry / DI, event bus); every capability — drivers, server, auth, security, automation, AI — is a plugin

See ARCHITECTURE.md for the complete design documentation including the plugin lifecycle state machine, dependency graph, and design decisions.

Roadmap

See ROADMAP.md for the current documentation and architecture cleanup priorities.

Contributing

We welcome contributions. Please read CONTRIBUTING.md for the development workflow, coding standards, testing requirements, and documentation guidelines.

Key standards:

  • Zod-first — all schemas start with Zod; TypeScript types are derived via z.infer<>
  • camelCase for configuration keys (e.g., maxLength, defaultValue)
  • snake_case for machine names / data values (e.g., project_task, first_name)

Documentation

Full documentation: https://docs.objectstack.ai

Upgrading from 10.x? See Upgrading to ObjectStack 11.

Run locally: pnpm docs:dev

Community

  • Star this repo if ObjectStack is useful — it helps others find it.
  • 🐛 Questions, bugs, or feature requests → open an issue.
  • 🤝 Want to contribute? See CONTRIBUTING.md.

License

Apache-2.0. Enterprise editions, official cloud services, and marketplace commercial terms live outside this repository.