High-performance document generation platform that transforms templates into production-ready PDFs at scale. Design templates via a visual canvas editor, then generate documents by filling forms, feeding datasets, or authoring rich HTML — all rendered into pixel-perfect PDFs in milliseconds with a Rust-powered rendering engine.
DocSpawn is a high-performance document generation platform that transforms templates into production-ready PDFs at scale. Users design templates via a visual Fabric.js canvas editor, then generate documents through three distinct modes: form-based single generation, dataset-driven batch generation, or rich HTML authoring. A dedicated Rust microservice (Axum + Tokio + lopdf) handles the CPU-intensive rendering pipeline, achieving sub-second per-document performance while NestJS orchestrates auth, permissions, and business logic.
A dedicated Axum microservice handles CPU-bound rendering: loading background PDFs, scaling coordinate systems, drawing text with embedded TTF font subsets, placing images, creating hyperlink annotations, and uploading to S3. Sub-second per-document performance using Tokio's async runtime with semaphore-controlled parallelism.
Templates have structured metadata (names, permissions, quotas) in PostgreSQL and large nested JSON blobs (canvas definitions, field arrays, versioned snapshots) in DynamoDB. A Rust aggregation layer joins both sources transparently for the API consumer.
The frontend canvas works in pixel coordinates while PDFs use point-based units. An in-place scaling system modifies the PDF's MediaBox directly, renders at canvas coordinates, then restores original dimensions, eliminating costly serialize/deserialize cycles.
Document generation triggers async events via BullMQ for thumbnail creation, full-text indexing, audit logging, and email delivery, keeping the hot rendering path fast while ensuring all side effects complete reliably.
TableToDoc uses Tokio semaphore-controlled parallelism so one bad row never blocks the batch. Per-document timing metrics are collected for observability, and partial failures release unused quota reservations automatically.
Fabric.js canvas with drag-and-drop fields, multi-page templates, watermarks, and per-field styling
Sub-second PDF generation with embedded TTF fonts, images, hyperlinks via lopdf + Axum
Dataset-driven concurrent generation with semaphore control and per-document failure isolation
Tiptap-based rich text editor with variable placeholders rendered to PDF via headless Chrome
CSV upload or manual tabular datasets with versioned schemas and column-to-field mapping
Secure, expiring SHA-256 hashed tokens for external document generation without accounts
























