Read this in other languages: Español
AI-powered invoice processing system that automatically extracts data from PDF invoices and creates accounting entries in ContPAQi accounting software.
ContPAQi AI Bridge eliminates manual data entry for Mexican accountants and bookkeepers by combining:
- Advanced AI/ML for invoice OCR and table detection (TATR + LayoutLMv3)
- Windows integration with ContPAQi's COM SDK
- User-friendly desktop application for review and validation
- Hardware-locked licensing for software protection
- Professional Windows installer with silent installation support
PDF Invoice → AI Extraction → Human Review → ContPAQi Entry
- Upload PDF invoices through the desktop application
- AI models extract invoice data (RFC, amounts, line items)
- Review and validate extracted data with confidence highlighting
- Auto-post validated entries to ContPAQi accounting
- OCR Engine: Tesseract with Spanish language support
- Table Detection: TATR (Table Transformer) model for line item extraction
- Field Extraction: LayoutLMv3 for semantic understanding of invoice fields
- Confidence Scoring: Visual indicators for extraction confidence levels
- RFC Validation: Full Mexican tax ID format validation (13-character persons, 12-character companies)
- CFDI Compliance: Support for Mexican electronic invoice standards
- IVA Calculation: Automatic 16% tax calculation and validation
- Math Verification: Real-time subtotal + IVA = total validation
- Split-Screen Layout: PDF viewer alongside data form
- Confidence Highlighting:
- Green (≥90%): High confidence, auto-accept
- Orange (70-89%): Needs review
- Red (<70%): Requires attention
- Math Error Highlighting: Red indicators for calculation mismatches
- Keyboard Shortcuts: Efficient navigation and editing
- Batch Processing: Process multiple invoices in queue
- Electron + React: Modern, responsive UI with Tailwind CSS
- Docker Management: Automatic container lifecycle management
- Health Monitoring: Real-time status indicators
- Startup Wizard: First-run configuration experience
- Hardware-Locked Licensing: Machine fingerprint-based activation
- Code Obfuscation: .NET Reactor protection for Windows Bridge
- Localhost-Only API: Windows Bridge restricted to local connections
- Non-Root Containers: Docker containers run without elevated privileges
- Inno Setup 6.x: Professional Windows installer
- Prerequisites Check: Docker Desktop and .NET runtime validation
- Service Installation: Windows service with automatic startup
- Silent Installation: Support for automated deployments
- Code Signing: Digitally signed installer and executables
- English: Default language
- Spanish: Full translation for Mexican users
- Language Selection: Choose during installation or in-app
┌─────────────────────────────────────────────────────────────────┐
│ Windows Desktop │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────────────┐ ┌────────────────────────────┐ │
│ │ Electron App │ │ Docker Container │ │
│ │ (React + TS) │◄───────►│ (Python + AI) │ │
│ │ Tailwind CSS │ HTTP │ Port 8000 │ │
│ └─────────┬──────────┘ └────────────────────────────┘ │
│ │ │
│ │ localhost:5000 │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ C# Windows Bridge (ASP.NET Core) │ │
│ │ ContPAQi SDK Integration (COM) │ │
│ │ Hardware-Locked Licensing │ │
│ └──────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ ContPAQi Accounting Software │ │
│ └──────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
| Component | Technology |
|---|---|
| AI Container | Python 3.9, FastAPI, PyTorch, Transformers, Tesseract OCR |
| Windows Bridge | C# .NET 6.0, ASP.NET Core, ContPAQi SDK (COM) |
| Desktop App | Electron 27, React 18, TypeScript, Tailwind CSS |
| Data Generation | Python, Faker, WeasyPrint, Jinja2 |
| ML Models | TATR (table detection), LayoutLMv3 (token classification) |
| Installer | Inno Setup 6.x, PowerShell |
| Testing | pytest, xUnit, Jest |
| Security | .NET Reactor, Code Signing, Hardware Fingerprinting |
- OS: Windows 10 (Build 19041+) or Windows 11
- CPU: Intel Core i5 or AMD Ryzen 5 (4 cores)
- RAM: 8 GB
- Storage: 10 GB free space (SSD recommended)
- Display: 1280x720 resolution
- OS: Windows 11 22H2
- CPU: Intel Core i7 or AMD Ryzen 7 (8 cores)
- RAM: 16 GB
- Storage: 20 GB SSD
- Display: 1920x1080 resolution
- GPU: NVIDIA GPU with 4GB+ VRAM (for faster AI inference)
- Docker Desktop 4.0+ (with WSL 2 backend)
- .NET 6.0 Runtime (installed automatically)
- ContPAQi Accounting (for posting entries)
-
Download the installer
- Download
ContPAQi-AI-Bridge-Setup.exefrom the releases page
- Download
-
Run the installer
- Double-click the installer
- Select your preferred language (English/Spanish)
- Follow the installation wizard
-
Prerequisites check
- The installer will verify Docker Desktop is installed
- If not found, you'll be prompted to install it
-
Complete installation
- Choose installation directory (default:
C:\Program Files\ContPAQi AI Bridge) - Select additional options:
- Create desktop shortcut
- Create Start Menu shortcuts
- Install as Windows service
- Click Install
- Choose installation directory (default:
-
First-run wizard
- After installation, the first-run wizard will:
- Verify system requirements
- Load the Docker image
- Start the service
- Open the application
- After installation, the first-run wizard will:
For automated deployments:
# Silent install with default options
ContPAQi-AI-Bridge-Setup.exe /VERYSILENT /SUPPRESSMSGBOXES
# Silent install with custom path
ContPAQi-AI-Bridge-Setup.exe /VERYSILENT /DIR="D:\ContPAQi AI Bridge"
# Silent install without service
ContPAQi-AI-Bridge-Setup.exe /VERYSILENT /TASKS="!installservice"For developers who want to run from source:
git clone https://github.com/danribes/contpaqi.git
cd contpaqicd mcp-container
docker-compose up -dcd desktop-app
npm install
npm run devcd windows-bridge
dotnet restore
dotnet build
dotnet run- Double-click "ContPAQi AI Bridge" on your desktop
- Open Start Menu → ContPAQi AI Bridge → ContPAQi AI Bridge
The application runs as a Windows service that starts automatically:
# Check service status
Get-Service ContPAQiBridge
# Start service manually
Start-Service ContPAQiBridge
# Stop service
Stop-Service ContPAQiBridge-
Open the application
- Wait for the status indicator to show "Ready" (green)
-
Upload PDF invoices
- Click "Upload" or drag-and-drop PDF files
- Multiple files can be processed in batch
-
Review extracted data
- The split-screen shows PDF on the left, form on the right
- Fields are highlighted by confidence level:
- Green: High confidence (≥90%) - usually correct
- Orange: Medium confidence (70-89%) - verify
- Red: Low confidence (<70%) - likely needs correction
-
Correct any errors
- Click on a field to edit
- Math errors (highlighted in red) must be corrected
- RFC validation errors block submission
-
Submit to ContPAQi
- Click "Submit" when all validations pass
- Entry is created in ContPAQi accounting
| Shortcut | Action |
|---|---|
Ctrl + O |
Open file |
Ctrl + S |
Submit current invoice |
Ctrl + → |
Next invoice (batch mode) |
Ctrl + ← |
Previous invoice (batch mode) |
Tab |
Next field |
Shift + Tab |
Previous field |
Ctrl + + |
Zoom in PDF |
Ctrl + - |
Zoom out PDF |
Ctrl + 0 |
Reset zoom |
F5 |
Refresh/retry extraction |
| Status | Color | Description |
|---|---|---|
| Starting | Yellow (pulsing) | Application is initializing |
| Ready | Green | Ready to process invoices |
| Processing | Blue | Currently processing an invoice |
| Error | Red | An error occurred |
| Offline | Gray | Docker or service not running |
Configuration file location: C:\Program Files\ContPAQi AI Bridge\config\appsettings.json
{
"Application": {
"Language": "en",
"Theme": "light",
"AutoStart": true
},
"Processing": {
"ConfidenceThreshold": 0.70,
"AutoAcceptThreshold": 0.95,
"MaxBatchSize": 50
},
"ContPAQi": {
"CompanyDatabase": "",
"AutoPost": false
},
"Docker": {
"ImageName": "contpaqi-mcp",
"Port": 8000,
"HealthCheckInterval": 5000
}
}| Variable | Description | Default |
|---|---|---|
CONTPAQI_BRIDGE_PORT |
Windows Bridge API port | 5000 |
CONTPAQI_DOCKER_PORT |
Docker container port | 8000 |
CONTPAQI_LOG_LEVEL |
Logging level (Debug/Info/Warning/Error) | Info |
-
First Launch
- On first launch, you'll be prompted to enter your license key
- Enter the key provided with your purchase
-
Hardware Lock
- The license is locked to your machine's hardware
- Components used for fingerprint: CPU ID, Motherboard Serial, Disk ID
-
License Transfer
- Contact support to transfer license to a new machine
- Deactivation on old machine is required
# Check license status
& "C:\Program Files\ContPAQi AI Bridge\scripts\check-license.ps1"Docker not starting:
# Check Docker Desktop status
docker info
# Restart Docker service
Restart-Service *docker*Container not running:
# Check container status
docker ps -a
# Restart container
docker restart contpaqi-mcpService won't start:
# Check service status
Get-Service ContPAQiBridge | Format-List *
# View service logs
Get-EventLog -LogName Application -Source ContPAQiBridge -Newest 10Application shows "Offline" status:
- Ensure Docker Desktop is running
- Check that the container is healthy
- Verify the Windows service is running
Extraction quality is poor:
- Ensure PDF is not scanned at low resolution
- Check that PDF is not password-protected
- Try with a cleaner copy of the invoice
Log files are located at:
- Application logs:
C:\Program Files\ContPAQi AI Bridge\logs\ - Docker logs:
docker logs contpaqi-mcp - Windows service logs: Event Viewer → Applications
- Open Control Panel → Programs → Uninstall a program
- Find "ContPAQi AI Bridge"
- Click Uninstall
# Silent uninstall
& "C:\Program Files\ContPAQi AI Bridge\unins000.exe" /VERYSILENT
# Uninstall keeping data
& "C:\Program Files\ContPAQi AI Bridge\scripts\uninstall.ps1" -KeepDataIf needed, remove:
- Installation folder:
C:\Program Files\ContPAQi AI Bridge - User data:
%APPDATA%\ContPAQi AI Bridge - Docker image:
docker rmi contpaqi-mcp
contpaqi/
├── mcp-container/ # Python AI container (FastAPI + ML models)
│ ├── Dockerfile
│ ├── docker-compose.yml
│ └── src/
│ ├── ocr/ # Tesseract OCR integration
│ ├── models/ # TATR + LayoutLM models
│ ├── inference/ # Processing pipeline
│ └── api/ # FastAPI endpoints
├── windows-bridge/ # C# bridge to ContPAQi SDK
│ └── src/ContpaqiBridge/
│ ├── Controllers/ # API endpoints
│ ├── Services/ # Business logic
│ ├── Licensing/ # Hardware-locked licensing
│ └── Security/ # API authentication
├── desktop-app/ # Electron + React desktop application
│ ├── src/
│ │ ├── components/ # React UI components
│ │ └── i18n/ # Internationalization
│ └── electron/
│ ├── main.ts # Electron main process
│ └── docker-manager.ts # Docker management
├── installer/ # Inno Setup installer files
│ ├── contpaqi-bridge.iss # Main installer script
│ ├── scripts/ # PowerShell helper scripts
│ │ ├── check-docker.ps1
│ │ ├── install-service.ps1
│ │ ├── first-run-wizard.ps1
│ │ └── code-sign.ps1
│ └── assets/
│ ├── license.txt
│ └── readme.txt
├── scripts/ # Data generation & preparation
│ ├── generate_invoices.py
│ ├── prepare_datasets.py
│ └── templates/ # 20 invoice HTML templates
├── data/ # Training datasets
│ ├── synthetic/ # Generated invoice PDFs + labels
│ ├── train/
│ ├── validation/
│ └── test/
├── tests/ # Test suites
│ ├── test_*.py # Python tests
│ └── *.test.ts # TypeScript tests
└── specs/ # Project specifications
All core features have been implemented:
| Phase | Tasks | Status |
|---|---|---|
| Phase 1: Setup & Data | Tasks 1-3 | ✅ Complete |
| Phase 2: MCP Container | Tasks 4-9 | ✅ Complete |
| Phase 3: Windows Bridge | Tasks 10-12 | ✅ Complete |
| Phase 4: Licensing & Protection | Tasks 15-16 | ✅ Complete |
| Phase 5: Desktop App | Tasks 13-14 | ✅ Complete |
| Phase 6: Deployment | Task 17 | ✅ Complete |
| Phase 7: Localization | Task 18 | 🔄 Planned |
Total Progress: 117/127 subtasks completed (92%)
# Python tests (AI container)
cd mcp-container
pytest tests/ -v
# .NET tests (Windows Bridge)
cd windows-bridge
dotnet test
# Desktop app tests
cd desktop-app
npm test
# Installer script tests
pytest tests/test_task017*.py -vRun the installation validation script on a clean Windows machine:
& "C:\Program Files\ContPAQi AI Bridge\scripts\test-installation.ps1" -Verbose- Full documentation:
/docsfolder - API reference:
/specs/api-reference.md - Troubleshooting guide: See Troubleshooting section above
- Technical support: support@contpaqi-ai-bridge.com
- Bug reports: GitHub Issues
Proprietary - All rights reserved.
This software is licensed, not sold. See LICENSE.txt for full terms.
- TATR - Table detection model
- LayoutLMv3 - Document understanding model
- Tesseract OCR - Open source OCR engine
- Electron - Desktop application framework
- Inno Setup - Windows installer creator