MinMaxHub
Documentation
  • Introduction
  • Architecture
  • Frontend
Domains
  • Nodes
  • Entities
  • Consensus
  • Suggestions
Resources
  • API Reference

Copyright 2026 MinMaxHub

  • Documentation
  • Domains
  • API Reference
NodesEntitiesSuggestionsVotesConsensusUsersRulesMedia
powered by Zudoku
Domains

Rules

The Rules domain is the schema registry of MinMaxHub. It enables a data-driven architecture where the shape of content (e.g., a "Spell", "Hero Card", or "Class Feature") is defined as JSON Schema documents, not hardcoded interfaces.

Schema as Data

Instead of hardcoding content types, MinMaxHub stores content schemas as JSON documents:

  • Dynamic: Admin users can create new content types (e.g., "Vehicle", "Potion") without a code deployment.
  • Universal: The same JSON Schema is used by the frontend (to generate form inputs) and the backend (to validate suggestions).

Rule Document Structure

Code
{ "componentKey": "Spell", "schema": { "...JSON Schema Draft 2020-12..." }, "uiHints": { "component": "Spell", "label": "Spell Card", "showStars": true }, "deprecated": false, "createdAt": "2024-01-15T10:30:00Z", "createdBy": { "userId": "...", "username": "admin", "photoUrl": "..." }, "updatedAt": "2024-01-16T14:20:00Z", "updatedBy": { "userId": "...", "username": "editor", "photoUrl": "..." } }
FieldDescription
componentKeyUnique identifier within the folder. Acts as the type discriminator.
schemaJSON Schema Draft 2020-12. Used for validation on the backend and form generation on the frontend.
uiHintsOptional display configuration: component (React component name), label (display name), plus arbitrary UI settings.
deprecatedLifecycle flag. Deprecated rules still function but are flagged in the admin UI.
createdBy / updatedByWho created/last modified the rule.

Optimistic Concurrency

To prevent conflicting edits, rules use optimistic locking. When you fetch a rule, you receive an ETag header. When saving changes, include the ETag in the If-Match header. If the rule was modified by someone else since you last fetched it, the save is rejected with a 412 Precondition Failed response.

Cross-Domain Usage

Rules are consumed by other domains:

  • Nodes validate that referenced rules exist before saving layout templates.
  • Suggestions validate submitted values against the rule's JSON Schema before storage.

API Endpoints

MethodEndpointPurposeAuth
GET/rules/{folder}List all rules in a folderRequired
GET/rules/{folder}/{componentKey}Get a single rule (includes ETag header)Required
POST/rules/{folder}/{componentKey}Create a new rule (409 if exists, unless ?overwrite=true)Required
PUT/rules/{folder}/{componentKey}Update an existing rule (404 if missing)Required

All endpoints require authentication. Both POST and PUT support If-Match for optimistic concurrency.

Folder Listing Response

Each rule in a folder listing includes:

FieldDescription
folderThe folder path
componentKeyRule identifier
deprecatedBoolean
labelDisplay name (from uiHints.label, defaults to componentKey)
createdAt / createdByCreation metadata
updatedAt / updatedByLast update metadata
Last modified on April 2, 2026
UsersMedia
On this page
  • Schema as Data
  • Rule Document Structure
  • Optimistic Concurrency
  • Cross-Domain Usage
  • API Endpoints
    • Folder Listing Response
JSON