# FiscalFlow - Multi-Accounting System Invoice Processing Platform Invoice OCR platform integrating with accounting systems (Fortnox, Visma, Hogia). Scans invoices, matches suppliers, generates vouchers, and imports into connected accounting software. ## Tech Stack - **Backend**: .NET 10 (C# 14), ASP.NET Core Web API, EF Core, PostgreSQL, Redis - **Frontend**: React 18 + TypeScript + Vite + TailwindCSS + Zustand - **Patterns**: DDD Lite, CQRS (MediatR), Repository + Unit of Work, Domain Events - **Libraries**: FluentValidation, AutoMapper, Serilog, Polly, JWT Bearer ## Solution Structure ``` backend/FiscalFlow.sln src/FiscalFlow.Api/ -- Controllers, middleware, Swagger src/FiscalFlow.Application/ -- CQRS commands/queries, DTOs, validators src/FiscalFlow.Core/ -- Domain entities, value objects, events, interfaces src/FiscalFlow.Infrastructure/ -- EF Core repos, event store, blob storage, OCR client src/FiscalFlow.Integrations/ -- IAccountingSystem providers (Fortnox, Visma...) tests/FiscalFlow.UnitTests/ -- xUnit + Moq + FluentAssertions tests/FiscalFlow.IntegrationTests/ frontend/ -- React SPA (Vite dev server :5173) docs/ -- Architecture, API, DB schema docs (Chinese) ``` ## Commands ```bash # Backend cd backend && dotnet restore && dotnet build dotnet run --project src/FiscalFlow.Api dotnet test dotnet test tests/FiscalFlow.UnitTests # Frontend cd frontend && npm install npm run dev npm run build npm run lint ``` ## Architecture - **Provider Pattern**: `IAccountingSystem` interface in `FiscalFlow.Integrations/Accounting/`. New providers implement this interface and register via DI. Factory: `IAccountingSystemFactory.Create("fortnox")` - **CQRS**: Commands/queries dispatched by MediatR with pipeline behaviors for validation and logging - **Domain Events**: Raised by aggregates, dispatched by EF Core interceptor, stored in `DomainEvents` table (JSONB payload) for audit trail - **Invoice Lifecycle**: Upload -> OCR -> SupplierMatch -> VoucherGenerate -> Import ## dotnet-skills Routing - Code quality: modern-csharp-coding-standards, api-design, type-design-performance - Data access: efcore-patterns, database-performance - DI / config: dependency-injection-patterns, microsoft-extensions-configuration - Quality gates: dotnet-slopwatch (after new/refactored code), crap-analysis (after test changes)