https://github.com/arthrod/redline-endpoint
HTTP service that produces redlined DOCX diffs between two documents.
https://github.com/arthrod/redline-endpoint
diff document-processing docx http-api legal-tech redline
Last synced: 4 days ago
JSON representation
HTTP service that produces redlined DOCX diffs between two documents.
- Host: GitHub
- URL: https://github.com/arthrod/redline-endpoint
- Owner: arthrod
- Created: 2026-01-15T21:33:21.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-06-04T20:12:54.000Z (11 days ago)
- Last Synced: 2026-06-04T22:07:24.563Z (11 days ago)
- Topics: diff, document-processing, docx, http-api, legal-tech, redline
- Language: Python
- Size: 2.83 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Redline API
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.
## Features
- 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
## Tech Stack
- **.NET 10** - Latest LTS runtime
- **FastEndpoints** - High-performance minimal API framework
- **Docxodus (WmlComparer)** - Document comparison engine
- **DocumentFormat.OpenXml** - OOXML manipulation
## Quick Start
### Prerequisites
- [.NET 10 SDK](https://dotnet.microsoft.com/download)
- Docker (optional, for containerized deployment)
### Run Locally
```bash
dotnet run
```
The API will start on `http://localhost:9898` by default.
### API Usage
```bash
curl -X POST http://localhost:9898/api/compare \
-F "Original=@original.docx" \
-F "Modified=@modified.docx" \
-F "Author=Your Name" \
--output redlined.docx
```
#### Parameters
| 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") |
#### Response
Returns the redlined DOCX file with tracked changes showing all differences between the two documents.
## Docker Deployment
### Build
```bash
docker build -t redline-api .
```
### Run
```bash
docker run -p 9898:9898 redline-api
```
### With Authentication
```bash
docker run -p 9898:9898 -e Jwt__Secret="your-secret-key-min-32-chars" redline-api
```
## Configuration
### Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| `ASPNETCORE_URLS` | Server binding URLs | `http://+:9898` |
| `ASPNETCORE_ENVIRONMENT` | Environment (Development/Production) | `Production` |
| `Jwt__Secret` | JWT signing secret (min 32 chars) | - |
### Enable Authentication
1. Set the `Jwt__Secret` environment variable
2. Remove `AllowAnonymous()` from `CompareDocumentsEndpoint.cs`
3. Include `Authorization: Bearer ` header in requests
## Project Structure
```
├── 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
```
## License
MIT