Schema Configuration
Use defineConfig() to register one project or multiple projects.
Each project configuration should define a scopes array. At least one scope should be marked with isDefault: true.
Single Project
import { defineConfig } from '@flexkit/studio';
import { products } from './schema/products';
import { categories } from './schema/categories';
export default defineConfig({
title: 'Commerce',
projectId: 'commerce123',
basePath: '/studio',
menuGroups: [
{ title: 'Catalog', name: 'catalog' },
{ title: 'Operations', name: 'operations' },
],
scopes: [
{ name: 'default', label: 'Default', isDefault: true },
{ name: 'es', label: 'Spain' },
{ name: 'fr', label: 'France' },
],
schema: [products, categories],
});Multiple Projects
import { defineConfig } from '@flexkit/studio';
import { crmDeals } from './schema/crm/deals';
import { crmContacts } from './schema/crm/contacts';
import { erpSuppliers } from './schema/erp/suppliers';
export default defineConfig([
{
title: 'CRM',
projectId: 'crm123',
basePath: '/studio',
scopes: [
{ name: 'default', label: 'Global', isDefault: true },
{ name: 'na', label: 'North America' },
{ name: 'emea', label: 'EMEA' },
],
schema: [crmDeals, crmContacts],
},
{
title: 'ERP',
projectId: 'erp123',
basePath: '/studio',
scopes: [
{ name: 'default', label: 'Default', isDefault: true },
{ name: 'warehouse-a', label: 'Warehouse A' },
{ name: 'warehouse-b', label: 'Warehouse B' },
],
schema: [erpSuppliers],
},
]);Defining Scopes
Scopes are configured at the project level, not on individual entities.
- Add a
scopeskey next toprojectId,basePath,plugins, andschema. - Define at least one scope with
isDefault: true. - Use
scope: 'local'on attributes that should store different values per selected scope. - When a local value is missing in the selected scope, the default scope value is used.
Config Fields
title?: stringproject label shown in UI.projectId: stringunique project identifier.basePath?: stringstudio route path.schema: Entity[]list of entities created withdefineEntity.menuGroups?: { title: string; name: string }[]group names used byentity.menu.group.scopes: { name: string; label: string; isDefault?: boolean; sortOrder?: number }[]plugins?: PluginOptions[]plugin system for apps, commands, custom fields, previews, and navbar overrides.
Plugin Extension Points (Summary)
Plugins can contribute:
appsformFields(custominputTypeUI)previewFieldscommandsnavbaroverrides (logo,projectSelector,search)
Use plugins when you need custom form behavior or additional Studio modules beyond schema modeling.
Last updated on