mafralp@blueprint-engine:~$
Blueprint Engine
A TypeScript library for server-defined forms and validated commands, designed for configurable B2B and multi-tenant product flows.
I am building Blueprint Engine to prevent product variations — fields, constraints, options, and nested configurations — from becoming customer-specific conditionals scattered across controllers, pages, and persistence. The input contract is declared once in the backend, turned into a JSON schema for any client to render, and reused to validate submitted payloads.
What I built
- A decorator-based API:
@Fielddeclares primitive inputs, rendering hints and intrinsic rules;@Nestedcomposes reusable contracts. schemaFor()converts a TypeScript DTO into a deterministic, JSON-friendly, versioned Blueprint Schema.parse()validates server-side payloads, rejects unknown properties, enforces types, bounds and allowed options, and hydrates a DTO instance on success.- A stable error contract with paths such as
topping.flavour, allowing front ends to associate validation failures with the correct fields. - Examples across Cake Shop and Supplier Onboarding, plus a Gallery that switches catalogs and profiles using the same renderer.
Product capabilities
Declarative form contracts
A DTO describes text, number, boolean, select and upload fields, along with nested objects. The same contract drives input UX and backend validation.
Reusable schemas
The engine produces schemas with schemaVersion, properties, labels, required fields, numeric bounds and enums. Clients do not need prior knowledge of each product’s configuration.
Defensive validation
The parser rejects unknown keys at every level, incorrect types, invalid selections and out-of-range numbers. Empty optional values remain unset; false remains a valid boolean value.
Domain composition
Cake topping configuration and supplier business addresses are different nested contracts using the same core. Adding a product flow means creating a DTO and registering it in the host catalog.
Clear responsibility boundaries
The package does not implement UI, databases, authentication, authorization, binary uploads or tenancy. The host application resolves identity, context and allowed blueprints; the engine owns only contract and validation.
Technical decisions worth exploring
- TypeScript decorators keep the contract close to the domain DTO instead of duplicating it across schema definitions, forms and validation code.
- Blueprint Schema is a small, versioned contract of its own — not a partial JSON Schema implementation — making it predictable for client renderers.
- Server-side validation remains authoritative; client-side schema rendering improves UX but never replaces validation or authorization.
- The core has no runtime dependencies, avoiding coupling to React, Vue, an ORM, a design system or authentication infrastructure.
- Context policy stays outside the core: an authorized host catalog selects the DTO before
schemaFor()orparse(). A client-selected key must never decide access.
Architecture
[ Host application ]
authentication · tenant/context policy · product catalog
│
├── authorized DTO ──> schemaFor() ──> [ Web / Mobile / Native renderer ]
│ │
└────────────────── parse(DTO, input) <─────┘
│
validated command or structured errors
Stack
Core
TypeScript, ES modules, decorators, Node.js 18+, and a versioned JSON schema contract.
Quality
Native node:test tests, contract fixtures, supported-component coverage, schema validation, and end-to-end tests for the example servers.
Demonstrations
Node.js HTTP server, framework-free JavaScript web renderer, Cake Shop, Supplier Onboarding and Blueprint Gallery.
Status
@blueprint-engine/core is currently at version 0.2.0 and remains experimental until 1.0. Breaking changes are still possible during 0.x and should be documented through the changelog.
Type cd .. to return home.