A full-featured, extensible platform for designing, managing, and generating Microsoft Word (.docx) documents using XSD‑defined data structures, rich token expressions, dynamic repeaters, and Word Content Controls (SDTs), including true w14:repeatingSection support.
- XSD → interactive data tree (drag & drop)
 - Control types: TextBox, TextArea, CheckBox, RadioGroup, Grid, Repeater
 - Real Word content controls (SDTs) + true 
w14:repeatingSectionsupport - Expressions: formatting filters, array indexing, relative paths
 - Conditional logic: 
if /path ... elseif ... else ... end - Repeaters with loop metadata: 
index,first,last,odd,even,count - StyleJson → Word Run/Paragraph styling (font size, bold, alignment, colors)
 - HTML token → dynamic control conversion (auto‑generate DOCX)
 - Batch job queue for large-scale document generation
 - JWT auth, HTML sanitization, input size limits
 
sqlcmd -S . -i database/schema.sql
sqlcmd -S . -i database/seed-data.sql
dotnet run --project backend/src/WordTemplating.Apicd frontend
npm install
npm run devGenerate a JWT (HS256) with claim sub and future exp, sign with Jwt:Key from appsettings.json, send:
Authorization: Bearer <token>
- Upload XSD: POST /api/xsd
 - Build template in UI (drag data → creates controls)
 - (Optional) Insert tokens like 
{{ /Customer/Name }} - Save template: POST /api/templates
 - (Optional) Convert tokens → dynamic SDTs: POST /api/templates/{id}/convert-html-to-dynamic
 - Generate:
- Single: POST /api/generate
 - Batch: POST /api/BatchGeneration/enqueue
 
 
{{ /Order/Date | date:yyyy-MM-dd }}
{{ /Order/Total | number:#,##0.00 }}
{{ /Customer/IsPremium | bool:Yes:No }}
{{ /Orders/Order[0]/OrderNumber }}
{{ repeat /Orders/Order }}
  {{ index }}: {{ OrderNumber }} (First? {{ first }})
{{ endrepeat }}
{{ if /Status/Open }}Open
{{ elseif /Status/Closed }}Closed
{{ else }}Unknown
{{ end }}
| Action | Endpoint | 
|---|---|
| Upload XSD | POST /api/xsd | 
| Get XSD Tree | GET /api/xsd/{id} | 
| Save Template | POST /api/templates | 
| Export Dynamic DOCX | GET /api/templates/{id}/export | 
| Convert HTML → Controls | POST /api/templates/{id}/convert | 
| Generate Single | POST /api/templates/{id}/generate | 
| Enqueue Batch | POST /api/batch/generation/enqueue | 
| Poll Batch | GET /api/batch/generation/correlation/{cid} | 
| Download Result | GET /api/batch/generation/{jobId}/result | 
Template
  ├─ Controls[]
  │    ├─ ControlType (TextBox|Grid|Repeater...)
  │    ├─ DataPath (/Root/Sub/Field or /Collection)
  │    ├─ Bindings[] (columns for Grid/Repeater)
  │    └─ StyleJson
{
  "fontSize": "11pt",
  "bold": true,
  "color": "#2E74B5",
  "alignment": "center"
}POST /api/BatchGeneration/enqueue
{
  "templateId": "GUID",
  "dataArray": [{ "Customer": {"Name":"Alice"} }, { "Customer": {"Name":"Bob"} }],
  "BatchGroup": "Run1"
}- Fork → branch → implement feature + tests
 - Follow existing service & repository patterns
 - Submit PR with clear description
 
- Additional filters (math/string)
 - Reverse DOCX → JSON extraction
 - Partial/Include support
 - PDF export
 - Multi-tenant + RBAC
 
Add a LICENSE (e.g., MIT) before distribution.
Happy templating!