Dynamic Configuration Service
A full-stack configuration system that allows internal teams to manage dynamic product forms and workflow rules without shipping frontend changes every time.
Context
Product workflows often need configuration changes — form fields, validation rules, conditional visibility. Hardcoding every variation in frontend creates slow releases, duplicate logic, and operational risk.
Problem
Every workflow variation required a frontend code change and release cycle. Operations teams could not safely update product behavior without engineering involvement.
Ownership
- Admin configuration UI with schema-driven form rendering
- NestJS config API with validation layer
- Database-backed configuration storage model
- Runtime config read path for product UI
- Caching strategy for read-heavy access patterns
- Publishing workflow with audit support
Architecture
Admin users write configuration through an admin UI → NestJS Config API → validation → database. Product UI reads validated configuration through a runtime API with cache layer for low-latency access.
flowchart LR Ops[Internal Admin / Ops] --> AdminUI[Config Admin UI] AdminUI --> ConfigAPI[NestJS Config API] ConfigAPI --> Validation[Schema Validation] Validation --> DB[(Config Database)] DB --> Cache[(Cache Layer)] ProductUI[Product UI] --> RuntimeAPI[Runtime Config API] RuntimeAPI --> Cache Cache --> ProductUI
Schema Example
export type DynamicField = {
id: string;
label: string;
type: 'text' | 'select' | 'multiSelect' | 'date' | 'checkbox';
required?: boolean;
options?: Array<{ label: string; value: string }>;
visibleWhen?: {
fieldId: string;
operator: 'equals' | 'notEquals' | 'includes';
value: string | boolean;
};
};Key Technical Decisions
| Decision | Why | Trade-off | Result |
|---|---|---|---|
| Schema-driven configuration | Avoid repeated hardcoded frontend changes | More upfront schema design | Easier runtime updates without code releases |
| Separated admin write / runtime read paths | Different access patterns and security requirements | Two API surfaces to maintain | Safer, more performant product behavior |
| Cached config read path | Configuration is read-heavy across user sessions | Requires invalidation/version strategy | Faster runtime access with controlled freshness |
Implementation
- Designed DynamicField schema with conditional visibility rules
- Built admin UI for schema editing, validation preview, and publishing
- Implemented NestJS service with input validation and error contracts
- Created database model with versioning and audit trail support
- Added cache layer with invalidation on configuration publish
Results
- Shifted selected workflow changes from code releases to controlled configuration updates
- Improved operational flexibility for internal teams
- Reduced repetitive frontend changes for configuration-heavy workflows
Reflection
- The most important decision was separating write and read paths — not the UI design.
- Schema validation upfront prevented many runtime errors.
- Next: stronger backward compatibility tooling for schema migrations.