Skip to main content

Runtime Configuration

The registry supports a hybrid code-first + runtime configuration pattern, so administrators can tune labels, permissions, lifecycles, and relationships without a redeploy while keeping schemas, validation, and components strictly in code.

Overview​

Code defines (requires deployment):

  • Database schemas
  • Zod validation
  • React components
  • Table mappings

Runtime overrides (no deployment needed):

  • Labels
  • Permissions
  • Lifecycle states
  • Relationships

Usage​

// Get merged config (runtime overrides code defaults)
const partConfig = ItemTypeRegistry.getType('Part')

// Hot-reload after database changes
await ItemTypeRegistry.reload()

Configuration Storage​

Runtime configurations are stored in the item_type_configs table and can be managed through:

  • Admin API endpoints at /api/admin/item-type-configs
  • Admin UI at /admin/item-types/

Key Files​

FilePurpose
src/lib/db/schema/config.tsitem_type_configs table schema
src/lib/config/ConfigService.tsCRUD operations for runtime configs
src/routes/api/admin/item-type-configs.tsAdmin API endpoints