Dynamic CAMI Backend Service Layer
A zero-to-one backend service layer for dynamic CAMI forms, with HLD/LLD collaboration, database design, and service-layer implementation for flexible form-driven enterprise workflows.
Context
Enterprise form workflows often need flexible field definitions, validation, and conditional behavior. Hardcoding every variation creates slow releases and operational risk.
Problem
Form-driven product workflows needed a backend foundation that could evolve without shipping hardcoded frontend changes for every variation.
Ownership
- Participated in HLD and LLD for dynamic form workflows
- Contributed to database design for form configuration and runtime reads
- Helped implement NestJS/Node service-layer logic for flexible form-driven workflows
- Collaborated across Product, Design, Backend, and Engineering leadership
Architecture
Internal operators and product teams define form schemas → NestJS form service validates and persists configuration → product UI reads runtime form definitions through a service layer. Exact storage engine and internal schema names are intentionally omitted.
flowchart LR Stakeholders[Product / Ops] --> Design[HLD / LLD] Design --> FormAPI[NestJS Form Service] FormAPI --> Validation[Schema Validation] Validation --> DB[(Form Config Store)] ProductUI[Product UI] --> RuntimeAPI[Runtime Form API] RuntimeAPI --> FormAPI FormAPI --> 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.