Skip to content
Saad Sultan

Dynamic Report Template System

Legal-tech report generation with draft/publish, version history, conditional rules, and a WYSIWYG editor so law firms can customise contract review output without code.

Overview

I contributed to a legal-tech platform’s dynamic report template system, the main differentiator that lets firms control how contract review results are presented. The system supports draft/publish workflows, version history, per-state template configuration, conditional rule evaluation, and report calculation consolidation. The editor is built on Tiptap with custom Node extensions for conditional blocks, dynamic merge tags, visibility condition builders, and preview modes.

Tech Stack

TypeScriptNode.jsVue.jsTiptapPostgreSQL

Impact & Scale

  • Law firms customise contract review reports per jurisdiction and matter type without developer changes
  • Draft/publish and version history let teams iterate on templates safely before going live
  • Conditional content and merge tags drive personalised report output from contract data

Key Challenges & Solutions

Keeping template logic and report calculation in sync

Templates reference merge tags and conditions that must align with the backend calculation pipeline. We consolidated scattered calculation logic into a canonical service using a builder pattern so the main controller stayed simple and the same rules could drive both the editor preview and the final report generation.

Draft vs published state and versioning

Firms need to edit templates without affecting live reports. We implemented draft/publish with version history so changes are only applied when published, and previous versions can be restored or compared.

Per-state and conditional content

Australian property rules vary by state. We supported per-state template configuration and conditional content blocks so a single template could branch on jurisdiction, contract type, or computed values without turning the editor into a full scripting environment.

Technical Highlights

  • WYSIWYG report template editor on Tiptap with custom Node extensions for conditional content and merge tags
  • Draft/publish workflow and version history for safe template iteration
  • Backend-driven report calculation service with builder pattern; consolidation improved testability
  • Per-state template configuration and conditional rule evaluation for jurisdiction-specific output
  • Visibility condition builders and editor preview modes so authors see how content will appear

Role and scope

I worked on the report template system across backend (calculation consolidation, rule evaluation, versioning) and frontend (editor behaviour, preview, and configuration). The goal was to let conveyancers and admins define and maintain report structure and logic without code deploys.

Architecture

Templates are stored in the database with their draft and published versions. The calculation service reads template configuration and contract data, evaluates conditions and merge tags, and produces the final report. The Tiptap-based editor persists to the same schema and supports custom nodes for conditionals and dynamic fields so authors get a visual editing experience that maps directly to runtime behaviour.

Lessons learned

  • One canonical calculation path. Moving from scattered logic to a single builder-based service made it easier to reason about report output and to keep the editor preview aligned with production.
  • Draft/publish and versions are worth the extra model. They reduced risk and support requests when firms needed to roll back or compare changes.
  • Custom editor extensions pay off when they match the domain. Conditionals and merge tags as first-class nodes kept the UX understandable instead of forcing authors into raw expressions.

Interested in discussing this project or working together? Get in touch.