Skip to content

A lightweight REST API wrapper around the Mustang-Project CLI for validating ZuGFeRD, Factur-X and UBL documents. Fast, reliable, and easy to integrate.

License

Notifications You must be signed in to change notification settings

Docentric/docentric-e-invoice-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docentric e-Invoice Validator

Build Status Docker Hub License: MIT

A REST API and web-based validation tool for ZuGFeRD and Factur-X e-invoices, built with ASP.NET Core and React.

Overview

This project provides a simple, user-friendly interface for validating ZuGFeRD and Factur-X e-invoices (both PDF and XML formats). It wraps the Mustang Project validation engine in a modern web application with both API and UI access.

Purpose: This tool is primarily used for unit testing and quality assurance in the development of Docentric AX, our document generation and distribution solution. It helps ensure that e-invoices generated by Docentric AX comply with ZuGFeRD and Factur-X standards.

Features

  • Web UI: Modern React-based interface for uploading and validating invoices
  • REST API: Programmatic access for automated testing and integration
  • Multiple Formats: Supports both PDF (hybrid) and XML e-invoice formats
  • Standards Compliance: Validates ZuGFeRD and Factur-X invoices using Mustang Project
  • Docker Ready: Pre-built Docker images available on Docker Hub
  • CI/CD: Automated builds and testing with GitHub Actions

Technology Stack

  • Backend: ASP.NET Core 10 (minimal API)
  • Frontend: React + Vite + TypeScript
  • UI Components: shadcn/ui with Tailwind CSS
  • Validation Engine: Mustang Project CLI (Java-based)
  • Runtime: .NET 10 + OpenJDK

Quick Start

Using Docker (Recommended)

The easiest way to run the validator is using Docker:

docker pull docentric/e-invoice-validator:latest
docker run -p 18889:8080 docentric/e-invoice-validator:latest

Then open your browser to http://localhost:18889

Installation & Usage

Prerequisites

For local development, you need:

  • .NET 10 SDK
  • Node.js 20.x or later
  • Java Runtime Environment (JRE) 11 or later
  • Docker (for containerized deployment)
  • Visual Studio 2022 or JetBrains Rider (recommended IDEs)
  • Git

Building from Source

  1. Clone the repository:

    git clone https://github.com/Docentric/docentric-e-invoice-validator.git
    cd docentric-e-invoice-validator
  2. Restore dependencies:

    dotnet restore src/Docentric.EInvoice.Validator.slnx
    cd src/WebUI
    npm install
    cd ../..
  3. Build the solution:

    dotnet build src/Docentric.EInvoice.Validator.slnx --configuration Release
  4. Run the application:

    dotnet run --project src/Server/RestServer.csproj

The application will be available at https://localhost:57456 or http://localhost:53365.

Note: When running locally (not via Docker), ensure you have Java Runtime Environment (JRE) 11 or later installed, as it's required for the Mustang Project validation engine.

Building Docker Image Locally

To build the Docker image yourself:

# Windows
cd src
.\docker-build.ps1

Then run it:

# Windows
.\docker-run.ps1

The application will be available at http://localhost:18889.

API Usage

For detailed API documentation and interactive testing, visit the Swagger UI at:

http://localhost:18889/api/docs/swagger/index.html

The API provides endpoints for validating ZuGFeRD and Factur-X e-invoices in both PDF and XML formats.

Architecture

The solution consists of two main components:

Backend (src/Server)

ASP.NET Core REST API that:

  • Accepts file uploads (PDF or XML)
  • Invokes Mustang Project CLI for validation
  • Parses validation results
  • Returns structured JSON responses

Frontend (src/WebUI)

React SPA that:

  • Provides a user-friendly upload interface
  • Displays validation results
  • Calls the REST API
  • Built into static assets served from Server/wwwroot in production

Docker Image

The Docker image bundles:

  • .NET 10 runtime
  • OpenJDK (for Mustang CLI)
  • Mustang-CLI.jar in /opt/Mustang-CLI.jar
  • Published ASP.NET Core application
  • Built React SPA

Project Structure

docentric-e-invoice-validator/
├── .github/
│   └── workflows/
│       └── build.yml           # GitHub Actions CI/CD pipeline
├── samples/                    # Sample e-invoice files for testing
│   ├── ZuGFeRD e-Invoice.pdf
│   ├── factur-x e-invoice.pdf
│   └── *.xml
├── scripts/                    # Development scripts
├── src/
│   ├── Directory.Build.props   # Shared project properties
│   ├── Docentric.EInvoice.Validator.slnx
│   ├── Dockerfile              # Multi-stage Docker build
│   ├── docker-compose.yml
│   ├── Server/                 # ASP.NET Core REST API
│   │   ├── RestServer.csproj
│   │   ├── Program.cs
│   │   ├── ApiHandlers.cs
│   │   └── Models/
│   └── WebUI/                  # React + Vite frontend
│       ├── package.json
│       ├── vite.config.ts
│       ├── src/
│       └── ...
├── LICENSE
└── README.md

Docker Hub

Pre-built Docker images are automatically published to Docker Hub:

Repository: docentric/e-invoice-validator

Available Tags:

  • latest - Latest stable release from the main branch
  • 2015.1.0 - Specific version tags
  • main - Latest build from main branch
  • develop - Latest development build

Pull Image:

docker pull docentric/e-invoice-validator:latest
docker pull docentric/e-invoice-validator:latest

Development

Running in Development Mode

  1. Start the backend:
    cd src/Server
    dotnet run

The frontend dev server runs on http://localhost:53365 with hot reload enabled.

Running Tests

dotnet test src/Docentric.EInvoice.Validator.slnx

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License
Copyright (c) 2026 Docentric d.o.o.

Acknowledgments

This project builds upon the excellent work of several open-source projects:

  • Mustang Project - The ZuGFeRD and Factur-X validation engine that powers this tool
  • ASP.NET Core - Microsoft's cross-platform web framework
  • React - Facebook's UI library
  • Vite - Next-generation frontend build tool
  • shadcn/ui - Beautifully designed UI components
  • Tailwind CSS - Utility-first CSS framework

Special thanks to the Mustang Project team for creating and maintaining the comprehensive ZuGFeRD/Factur-X validation library.

About Docentric

Docentric contributes to the Dynamics 365 and Power Platform community through free apps, knowledge platforms, and by organizing events that bring professionals together on both local and international levels – proving ourselves as community-first and community-driven Microsoft ISV Partner.

Questions & Feedback

Reach out to us at support@docentric.com if you have any questions or feedback.