26d0c412036cc73acc7807b9c63808b4db5c3d17
Rewrite OcrService to match the actual inference API response format (nested status/result structure with PascalCase/snake_case field names). Register IOcrService in DI with typed HttpClient and Polly v8 resilience (retry, timeout, circuit breaker via AddStandardResilienceHandler). Key changes: - Fix response model to match real API (InferenceApiResponse) - Map correct field names (InvoiceNumber, InvoiceDueDate, OCR, Amount, etc.) - Add extract_line_items=true for VAT summary extraction - Copy stream before sending to avoid disposal conflicts with retries - Add JsonException handling for malformed responses - Remove sensitive data from error logs - Add 35 unit tests covering field mapping, VAT parsing, error handling, decimal/date formats, and content type detection
Invoice Master
Multi-accounting system invoice processing platform supporting Fortnox, Visma, Hogia, and more.
Tech Stack
- Backend: .NET 8 + ASP.NET Core + EF Core + PostgreSQL
- Frontend: React 18 + TypeScript + Vite + TailwindCSS
- Infrastructure: Docker + Azure
Quick Start
Prerequisites
- .NET 8 SDK
- Node.js 18+
- Docker & Docker Compose
Development
# Clone the repository
git clone <repo-url>
cd invoice-master
# Start infrastructure services
docker-compose up -d postgres redis
# Run backend
cd backend
dotnet restore
dotnet run --project src/InvoiceMaster.API
# Run frontend (in another terminal)
cd frontend
npm install
npm run dev
Docker Compose (Full Stack)
docker-compose up -d
Services:
- Backend API: http://localhost:5000
- Frontend: http://localhost:5173
- Swagger UI: http://localhost:5000/swagger
Project Structure
├── backend/ # .NET Backend
│ ├── src/
│ │ ├── InvoiceMaster.API/ # Web API
│ │ ├── InvoiceMaster.Core/ # Domain layer
│ │ ├── InvoiceMaster.Application/ # Application layer
│ │ ├── InvoiceMaster.Infrastructure/# Infrastructure layer
│ │ └── InvoiceMaster.Integrations/ # Accounting providers
│ └── tests/
├── frontend/ # React Frontend
│ └── src/
├── docs/ # Documentation
└── docker-compose.yml # Local development
Documentation
License
MIT
Description
Languages
C#
84.7%
TypeScript
10.5%
Shell
4%
JavaScript
0.3%
Dockerfile
0.2%
Other
0.2%