Skip to content

Core setting admin UI - #787

Open
Mikearaya wants to merge 3 commits into
core-settingfrom
core-setting-admin-ui
Open

Mikearaya wants to merge 3 commits into
core-settingfrom
core-setting-admin-ui

Conversation

@Mikearaya

Copy link
Copy Markdown
Contributor

Summary

  • Adds @unchainedshop/core-settings module — a runtime key-value settings store backed by MongoDB with namespace-scoped Zod schema validation, default values, and public/private visibility
  • Exposes GraphQL queries (shopSettingsSchema, shopSettingsNamespaces, shopInfo.settings) and mutation (updateShopSettings) behind manageShopSettings permission, plus an MCP resource for AI integrations
  • Implements admin UI settings section with a dynamic form renderer (SchemaField) that maps JSON Schema types (string, number, boolean, enum, nested objects) to existing form field components
  • Includes a sample shop settings namespace in the kitchensink example demonstrating real-world configuration (site name, support email, guest checkout, maintenance mode, notification preferences)

How it works

  1. Namespaces are registered at boot via registerSettingsNamespace({ key, schema, public, defaults }) before startPlatform()
  2. Zod schemas are converted to JSON Schema and served via shopSettingsSchema(namespace) for the admin UI to generate forms dynamically
  3. Public namespaces are readable without authentication via shopInfo.settings(namespace) for storefront use
  4. The admin UI lists registered namespaces at /settings and renders an inline detail page with schema-driven form fields when a namespace is selected

Test plan

  • Start kitchensink example and verify the shop namespace appears in admin UI under Settings
  • Click the shop namespace and verify the form renders all fields (text, number, checkbox, nested object)
  • Submit the form and verify values persist across page reloads
  • Verify public namespace settings are accessible without auth via shopInfo { settings(namespace: "shop") }
  • Verify a user without manageShopSettings sees a read-only form

@Mikearaya
Mikearaya added this pull request to stack #788 September 23, 2026 11:21
@Mikearaya
Mikearaya force-pushed the core-setting-admin-ui branch from 66c8385 to 12a8b0c Compare September 23, 2026 11:22
@Mikearaya Mikearaya linked an issue Sep 23, 2026 that may be closed by this pull request
@Mikearaya
Mikearaya force-pushed the core-setting-admin-ui branch from 12a8b0c to fc862cc Compare September 23, 2026 14:22
@Mikearaya
Mikearaya force-pushed the core-setting-admin-ui branch 2 times, most recently from c41e521 to d8a5a0c Compare September 23, 2026 15:34
@Mikearaya
Mikearaya requested a review from pozylon September 23, 2026 15:34
@Mikearaya
Mikearaya force-pushed the core-setting-admin-ui branch from d8a5a0c to b4f6137 Compare September 24, 2026 11:54
@Mikearaya
Mikearaya force-pushed the core-setting-admin-ui branch from b4f6137 to 3a20b62 Compare October 5, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Runtime-editable settings store for merchant-configurable values

1 participant