TorbatYar/docs/architecture/integration-architecture.md
Mortezakoohjani 12c8615615 Ship enterprise Accounting FE/API with CRUD parity and production wiring.
Adds accounting-service PATCH/archive, fiscal helpers, COA templates and setup status, plus SuperApp Accounting UI (DS, scoreboard, masters, vouchers, ledger, ops modules) with session refresh and HTTPS public API URLs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 15:26:43 +03:30

1.4 KiB

Integration Architecture

Inter-Service Channels

Only these channels are allowed (ADR-001):

  1. Versioned REST API
  2. Webhook
  3. Async Event (message bus / outbox worker)
  4. Outbox/Inbox pattern

Internal Auth

Services authenticate with Internal Service Tokens (hashed in internal_service_tokens, scoped).

External Providers

External systems (SMS, payment, storage, tax) integrate through provider adapters registered in provider-registry.md. Modules must not hardcode vendor SDKs into domain services without a provider boundary.

Current known providers

Provider Use
Payamak SMS OTP
Keycloak IdP / SSO
Let's Encrypt + Certbot TLS certificates
S3-compatible (planned) File storage

BFF Pattern

Identity & Access acts as BFF for OIDC token exchange and Keycloak theme handoff so browser secrets stay constrained.

Frontend Integration

Frontend uses typed API clients (lib/api.ts primary; lib/api-client.ts may exist for narrower helpers). Never call databases from the browser.