A high-performance .NET API that compares two DOCX documents and returns a redlined document with tracked changes. Built with FastEndpoints for minimal overhead and maximum throughput.
- Compare two Word documents and generate a redlined version with tracked changes
- Automatic cleanup of comparison artifacts for Word compatibility
- Converts complex move operations to simple del/ins for maximum compatibility
- JWT Bearer authentication support (configurable)
- Docker-ready deployment
- .NET 10 - Latest LTS runtime
- FastEndpoints - High-performance minimal API framework
- Docxodus (WmlComparer) - Document comparison engine
- DocumentFormat.OpenXml - OOXML manipulation
- .NET 10 SDK
- Docker (optional, for containerized deployment)
dotnet runThe API will start on http://localhost:5003 by default.
curl -X POST http://localhost:5003/api/compare \
-F "Original=@original.docx" \
-F "Modified=@modified.docx" \
-F "Author=Your Name" \
--output redlined.docx| Parameter | Type | Required | Description |
|---|---|---|---|
Original |
File | Yes | The original document |
Modified |
File | Yes | The modified document |
Author |
String | No | Author name for tracked changes (default: "User") |
Returns the redlined DOCX file with tracked changes showing all differences between the two documents.
docker build -t redline-api .docker run -p 8080:8080 redline-apidocker run -p 8080:8080 -e Jwt__Secret="your-secret-key-min-32-chars" redline-api| Variable | Description | Default |
|---|---|---|
ASPNETCORE_URLS |
Server binding URLs | http://+:8080 |
ASPNETCORE_ENVIRONMENT |
Environment (Development/Production) | Production |
Jwt__Secret |
JWT signing secret (min 32 chars) | - |
- Set the
Jwt__Secretenvironment variable - Remove
AllowAnonymous()fromCompareDocumentsEndpoint.cs - Include
Authorization: Bearer <token>header in requests
├── Program.cs # Application entry point
├── Endpoints/Compare/
│ └── CompareDocumentsEndpoint.cs # Document comparison endpoint
├── appsettings.json # Configuration
├── Dockerfile # Container definition
├── original.docx # Sample original document
└── modified.docx # Sample modified document
MIT