Azure AKS Invoice Processing Platform

Scalable Azure architecture for AI-powered invoice intake, extraction, fraud checks, and approval workflows. AKS runs pr...

11 views
Viewed 11 times
0

Create a free account to remix this architecture

Sign up freeor sign in

Azure AKS Invoice Processing Platform

Scalable Azure architecture for AI-powered invoice intake, extraction, fraud checks, and approval workflows. AKS runs production services with secure storage, APIs, and identity integration.

Control Plane — Agent Lane
Invoice Lifecycle Orchestrator
claude-opus-4EVENT
4 tools:classify_invoice, extract_fields +2
Orchestrates 5 services
Fraud Detection Agent
claude-haiku-4.5EVENT
3 tools:vision_review, tamper_check +1
Orchestrates 3 services
az aks papy…az pg papyraz redis pa…az st papyr…az sb papyraz aks papy…az st papyr…az pg papyr
AZURE

Tags

#azure
#aks
#invoice-processing
#ai-agents
#microservices

Architecture Description

> "Papyr is an AI-powered invoice processing agent. It connects directly to your email inbox — Gmail, Outlook, or any email provider — and automatically handles the full invoice lifecycle from the moment an invoice lands in your mailbox to the moment it's ready to be paid. > > No manual data entry. No missed invoices. And a built-in fraud detection layer that flags anything suspicious before you sign off." Make an scalable architecture mainly created through Azure and pilote by AKS for production vision ### Infrastructure | Component | Technology | Version | Role | |---|---|---|---| | Container Runtime | Docker + Compose | 28+ | Service orchestration | | Reverse Proxy | nginx | 1.27-alpine | TLS termination, CORS, routing | | TLS (local) | mkcert | 1.4.4 | Self-signed certs — `*.invoice.localtest.me` | | TLS (VM) | Let's Encrypt | — | Real certs — `*.20.118.234.108.nip.io` | ### Application Services | Service | Technology | Version | Role | |---|---|---|---| | API Gateway | FastAPI + uvicorn | 0.115.5 | REST API, async, CORS middleware | | Task Queue | Celery + Redis | 5.4.0 | Async agent pipeline | | Scheduler | celery-redbeat | 2.3.3 | Inbox polling every 2 minutes | | Queue Monitor | Flower | 2.0.1 | Celery visibility | | Frontend | React + Vite | — | Dashboard | ### Data & Storage | Service | Technology | Version | Role | |---|---|---|---| | Main Database | PostgreSQL | 16-alpine | All structured data | | Cache / Broker | Redis | 7-alpine | Celery broker + result backend | | Object Storage | MinIO / Azure Blob | — | PDF and report storage | ### Identity & Security | Service | Technology | Role | |---|---|---| | Identity Provider | Keycloak 26 | User auth, Google & Microsoft OAuth broker | | Token Encryption | Fernet (AES-256) | Email credentials encrypted at rest | | Google OAuth 2.0 | — | Gmail access + refresh tokens | | Microsoft OAuth 2.0 | — | Outlook / Graph API access | ### AI & Processing | Service | Technology | Role | |---|---|---| | Invoice Extraction | Claude Opus 4 | Hybrid: pdfplumber text + PDF vision | | Fraud Detection | Claude Haiku 4.5 | Tamper detection (fast, low cost) | | PDF Classifier | Claude Haiku 4.5 | Pre-filter non-invoice emails | | PDF Generation | WeasyPrint | Approval report PDF | | PDF Text Extract | pdfplumber 0.11 | Text layer extraction for digital PDFs | | Gmail Add-on | Google Apps Script | Gmail sidebar UI | --- ## 4. Docker Compose Services | Container | Image | Ports | Role | |---|---|---|---| | `invoice-nginx` | nginx:1.27-alpine | 80, 443 | Reverse proxy + TLS | | `invoice-postgres` | postgres:16-alpine | 5432 | Main database | | `invoice-redis` | redis:7-alpine | 6379 | Task queue + broker | | `invoice-minio` | minio/minio | 9000, 9001 | Object storage | | `invoice-keycloak` | keycloak:26.0 | 8080 | Identity provider | | `invoice-api` | ghcr.io/…/papyr/api | 8000 | FastAPI backend | | `invoice-worker-extraction` | ghcr.io/…/papyr/api | — | Ingestion + extraction workers | | `invoice-worker-report` | ghcr.io/…/papyr/api | — | Validation + report workers | | `invoice-celery-beat` | ghcr.io/…/papyr/api | — | Scheduled inbox polling | | `invoice-flower` | ghcr.io/…/papyr/api | 5555 | Worker monitoring UI | | `invoice-frontend` | node:20-alpine | 3000 | React + Vite dev server | All application containers share the same Docker image with different `command` overrides. Source is volume-mounted for hot-reload.

Community Discussion

Sign in to join the discussion

Sign in to comment

Be the first to comment

Share your thoughts on this architecture

AI Analysis(1)

AI Review
Tradeoff

17 days ago

I think the biggest production risk is that the control plane for ingestion and processing is still too “compose-shaped” for AKS. Celery + Redis + redbeat polling every 2 minutes is simple, but for invoice intake it creates real scaling and reliability tradeoffs: duplicate fetches, uneven worker backpressure, weak delivery guarantees, and Redis becoming both broker and result store for a business-critical workflow.

MF

Maxwell Famoriyo

@maxwellfamoriyo

View portfolio
Try it in the Playground

Open an interactive version — fork it, generate AI variants, or share it with your team.

What You'll Get

Editable diagram in your workspace
Interactive cost estimates
AI-powered customization
Save and share your version

Start Customizing

Make this template your own

Takes 30 seconds • No credit card required

Share

Statistics

Views
11
Clones
0
Likes
0
Readiness
69/100

Details

Estimated monthly cost

$468.30/month

Published
4/24/2026

Services Used

18 cloud services in this architecture

AzureNATGateway
ApplicationGateway
AzureNSG
AKS
AzureContainerRegistry
AzurePostgreSQL
RedisCache
StorageAccount
AzureKeyVault
AzureAPIManagement
AzureFunction
AzureOpenAIService
AzureAISearch
FrontDoor
SecurityCenter
Sentinel
Az-eg-papyr
Az-sb-papyr

Ready to build this?

Clone this architecture into your workspace and deploy it to your cloud account.

Takes 30 seconds • No credit card required

You Might Also Like

Cloud Architecture for Ad Network with Authentication
382

Cloud Architecture for Ad Network with Authentication

Please create a cloud architecture for an ad network. Features that we need include: user authentication on our…

AWS
AZURE
Global E-Commerce Platform with Multi-Cloud Failover
187

Global E-Commerce Platform with Multi-Cloud Failover

Create a global e-commerce platform with multi-cloud redundancy. Use AWS in us-east-1 for the primary application with…

AWS
AZURE
GCP
Serverless REST API with Global Database
121

Serverless REST API with Global Database

Build a serverless REST API on Azure using Azure Functions, API Management, and Cosmos DB for a globally distributed…

AZURE
Azure AI Agent Awesome List Curator
117

Azure AI Agent Awesome List Curator

Using Azure, Build an AI agent that maintains its own awesome list using the very model it's curating. Here’s how the…

AZURE