When I started building Contractize.app, my goal was simple: let people create clean, accurate contracts in seconds β without legal friction.
But making that work under the hood? That was the fun part.
In this post, Iβll share how I built the backend with ASP.NET, the frontend with Angular, and integrated external document rendering through .docx templates and Formize API to generate final PDFs β all with automation in mind.
π οΈ Tech Stack Overview
- Frontend: Angular
- Backend: ASP.NET Core
-
Document Templates: Microsoft Word
.docx
files - API Integration: Formize.com (for template filling & PDF generation)
- Output: Publicly accessible PDF contracts
π Why .docx
?
Instead of hardcoding templates or using plain-text, I chose .docx
because:
- It's familiar to end users (Word format = comfort).
- It supports rich formatting (tables, styles, variables).
- It's editable by non-tech staff (lawyers, ops, etc.).
Templates were uploaded to a central storage on Formize.com, where variable placeholders like {{clientName}}
or {{startDate}}
were pre-defined.
π API Flow: Dynamic Contract Generation
Here's the high-level flow of how dynamic contract creation works:
- User fills a form on the frontend (Angular).
- Data is sent to ASP.NET backend.
- Backend compiles a JSON object with the correct variables.
-
A POST request is made to Formize API:
{ "templateId": "nda-template.docx", "data": { "clientName": "Acme Corp", "startDate": "2025-05-27", ... } }
Formize fills the
.docx
template and returns a PDF download link.The backend saves that link, sends it to the frontend, and optionally emails it to the client.
β‘ The result? A professional, filled, legally structured contract in under 5 seconds.
π Lessons Learned
-
Using
.docx
was a game-changer: Legal teams can update templates without touching code. - ASP.NET + Angular combo was seamless, especially for form validation and API integration.
- Formize API saved weeks of work by abstracting template parsing and PDF generation.
- Caching document links (or PDFs themselves) is key for performance if users generate many contracts in a session.
π Next Steps
We're now expanding to:
- Dynamic clause toggles (e.g. include/exclude arbitration).
- Multi-language templates.
- eSignatures (integrating DocuSign or HelloSign).
If you're building anything document-related, or want to automate contracts for your team or startup β feel free to ping me or check out Contractize.app. Happy to share more behind-the-scenes!
π¬ Have you ever built a doc-generation flow? Used .docx
in production? Would love to hear your setup.
Top comments (4)
Great read, Bogdan!
Your work is a significant contribution to the field of document automation, and I look forward to seeing how Contractize.app evolves. Wishing you continued success in your endeavors!
Sounds very interesting
Unusual approach.
Great solution