Server & Deployment
Server Integration
Server Integration
ObjectQL is designed to be framework-agnostic. The modern integration pattern uses the ObjectStack Kernel — a micro-kernel that composes your application from declarative configs, drivers, and plugins.
The Kernel Pattern
Instead of a monolithic server package, ObjectQL uses a plugin architecture where protocol support (JSON-RPC, GraphQL, OData) is provided via separate protocol plugins.
Installation
pnpm add @objectstack/runtime @objectstack/plugin-hono-server
pnpm add @objectql/core @objectql/protocol-json-rpcGetting Started
Basic Setup
import { ObjectStackKernel } from '@objectstack/runtime';
import { HonoServerPlugin } from '@objectstack/plugin-hono-server';
import { ObjectQLPlugin } from '@objectql/core';
import { MemoryDriver } from '@objectql/driver-memory';
const appConfig = {
name: 'my-app',
objects: {
User: {
name: 'User',
fields: {
name: { type: 'text', required: true },
email: { type: 'text', required: true }
}
}
}
};
const kernel = new ObjectStackKernel([
appConfig,
new MemoryDriver(),
new ObjectQLPlugin(),
new HonoServerPlugin({ port: 3000 })
]);
await kernel.start();Multi-Protocol Server
Expose your data through multiple protocols simultaneously:
import { ObjectStackKernel } from '@objectstack/runtime';
import { HonoServerPlugin } from '@objectstack/plugin-hono-server';
import { ObjectQLPlugin } from '@objectql/core';
import { JSONRPCPlugin } from '@objectql/protocol-json-rpc';
import { GraphQLPlugin } from '@objectql/protocol-graphql';
import { SqlDriver } from '@objectql/driver-sql';
const kernel = new ObjectStackKernel([
appConfig,
new SqlDriver({ client: 'postgresql', connection: process.env.DATABASE_URL }),
new ObjectQLPlugin(),
new JSONRPCPlugin(),
new GraphQLPlugin(),
new HonoServerPlugin({ port: 3000 })
]);
await kernel.start();The Protocol
The JSON-RPC protocol plugin exposes operations through a standard JSON-RPC 2.0 endpoint:
interface ObjectQLRequest {
op: 'find' | 'findOne' | 'create' | 'update' | 'delete' | 'count' | 'action';
object: string;
args: Record<string, unknown>;
user?: Record<string, unknown>;
}Dev Server
For rapid prototyping, @objectstack/cli provides a built-in dev server:
# Serves the current directory schema on port 3000
objectstack serve --devSee CLI Documentation for more details.