# scanix/gaeld architecture

> Architecture diagram of the GitHub repository scanix/gaeld, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/scanix/gaeld
- Repository: https://github.com/scanix/gaeld

## Overview

Gäld is a self-hosted accounting product for Swiss freelancers and small businesses. Its principal workflow is to manage organization-scoped contacts, invoices and expenses, reconcile imported bank activity, and maintain double-entry books that support financial and VAT reporting. The README documents the REST API and plugin system as additional capabilities. Relationships below are limited to README statements and SOURCE INDEX references; unsampled domain internals are represented without inferred call chains.

Main entry points: [`app/Domains/Api/Controllers/JournalEntryApiController.php`](https://github.com/scanix/gaeld/blob/develop/app/Domains/Api/Controllers/JournalEntryApiController.php) (REST API), [`app/Domains/Contacts/Models/Contact.php`](https://github.com/scanix/gaeld/blob/develop/app/Domains/Contacts/Models/Contact.php) (Contacts), [`app/Domains/Expenses/Models/Expense.php`](https://github.com/scanix/gaeld/blob/develop/app/Domains/Expenses/Models/Expense.php) (Expenses & receipts), [`app/Domains/Accounting/Services/LedgerQueryService.php`](https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Services/LedgerQueryService.php) (Ledger queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_org["Organization &amp; contacts"]
  node_organization[("Organization<br/>[Organization.php]")]
  node_contacts[("Contacts<br/>[Contact.php]")]
end

subgraph group_sales["Invoices &amp; expenses"]
  node_invoice[("Invoices &amp; QR-Bill<br/>[Invoice.php]")]
  node_expense[("Expenses &amp; receipts<br/>[Expense.php]")]
  node_expense_category[("Expense categories")]
end

subgraph group_bank["Banking"]
  node_bank_import["Bank imports"]
  node_bank_transaction[("Bank transactions")]
  node_reconciliation["Reconciliation"]
end

subgraph group_books["Accounting &amp; reporting"]
  node_journal[("Journal entries<br/>[JournalEntry.php]")]
  node_lines[("Transaction lines")]
  node_accounts[("Chart of accounts<br/>[Account.php]")]
  node_budgets[("Budgets<br/>[Budget.php]")]
  node_ledger["Ledger operations<br/>[LedgerService.php]"]
  node_ledger_queries["Ledger queries"]
  node_fiscal["Fiscal years &amp; VAT"]
  node_reports["Financial reports"]
end

subgraph group_extend["Integrations"]
  node_webhook[("Webhooks<br/>[Webhook.php]")]
  node_api["REST API"]
  node_plugin["Plugin system"]
end

node_operator(("Business user"))
node_external_bank(("Bank"))
node_external_app(("External application"))

node_operator -->|"manages"| node_organization
node_operator -->|"maintains"| node_contacts
node_operator -->|"creates"| node_invoice
node_operator -->|"records"| node_expense
node_operator -->|"imports statements"| node_bank_import
node_external_bank -->|"provides CAMT"| node_bank_import
node_bank_import -.->|"imports"| node_bank_transaction
node_operator -->|"matches transactions"| node_reconciliation
node_reconciliation -->|"matches against"| node_invoice
node_reconciliation -->|"matches against"| node_expense
node_operator -->|"posts entries"| node_journal
node_journal -->|"has lines"| node_lines
node_lines -->|"references"| node_accounts
node_ledger_queries -->|"queries"| node_journal
node_ledger_queries -->|"queries"| node_lines
node_ledger_queries -->|"queries"| node_accounts
node_operator -.->|"sets targets"| node_budgets
node_operator -->|"manages VAT"| node_fiscal
node_ledger_queries -.->|"projects balances"| node_reports
node_operator -->|"integrates through"| node_api
node_external_app -->|"sends requests"| node_api
node_api -->|"supports entries"| node_journal
node_api -->|"supports contacts"| node_contacts
node_api -->|"supports invoices"| node_invoice
node_api -->|"supports expenses"| node_expense
node_operator -->|"extends product"| node_plugin
node_contacts -->|"customer relation"| node_invoice
node_contacts -->|"supplier relation"| node_expense
node_organization -->|"owns"| node_accounts
node_organization -->|"owns"| node_contacts
node_organization -.->|"owns"| node_bank_transaction
node_expense -->|"references"| node_expense_category

click node_organization "https://github.com/scanix/gaeld/blob/develop/app/Domains/Organizations/Models/Organization.php"
click node_contacts "https://github.com/scanix/gaeld/blob/develop/app/Domains/Contacts/Models/Contact.php"
click node_invoice "https://github.com/scanix/gaeld/blob/develop/app/Domains/Invoicing/Models/Invoice.php"
click node_expense "https://github.com/scanix/gaeld/blob/develop/app/Domains/Expenses/Models/Expense.php"
click node_expense_category "https://github.com/scanix/gaeld/blob/develop/app/Domains/Expenses/Models/ExpenseCategory.php"
click node_bank_import "https://github.com/scanix/gaeld/blob/develop/app/Domains/Banking/Services/BankImportService.php"
click node_bank_transaction "https://github.com/scanix/gaeld/blob/develop/app/Domains/Banking/Models/BankTransaction.php"
click node_reconciliation "https://github.com/scanix/gaeld/blob/develop/app/Domains/Banking/Services/ReconciliationService.php"
click node_journal "https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Models/JournalEntry.php"
click node_lines "https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Models/TransactionLine.php"
click node_accounts "https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Models/Account.php"
click node_budgets "https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Models/Budget.php"
click node_ledger "https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Services/LedgerService.php"
click node_ledger_queries "https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Services/LedgerQueryService.php"
click node_fiscal "https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Services/FiscalYearService.php"
click node_reports "https://github.com/scanix/gaeld/blob/develop/app/Domains/Reporting/Controllers/ReportController.php"
click node_webhook "https://github.com/scanix/gaeld/blob/develop/app/Domains/Api/Models/Webhook.php"
click node_api "https://github.com/scanix/gaeld/blob/develop/app/Domains/Api/Controllers/JournalEntryApiController.php"
click node_plugin "https://github.com/scanix/gaeld/blob/develop/app/Providers/PluginServiceProvider.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_organization,node_contacts,node_operator toneBlue
class node_invoice,node_expense,node_expense_category toneAmber
class node_bank_import,node_bank_transaction,node_reconciliation toneMint
class node_journal,node_lines,node_accounts,node_budgets,node_ledger,node_ledger_queries,node_fiscal,node_reports toneRose
class node_webhook,node_api,node_plugin,node_external_bank,node_external_app toneIndigo
```

## Components

### Organization & contacts

- [Organization](https://github.com/scanix/gaeld/blob/develop/app/Domains/Organizations/Models/Organization.php): `app/Domains/Organizations/Models/Organization.php`
- [Contacts](https://github.com/scanix/gaeld/blob/develop/app/Domains/Contacts/Models/Contact.php): `app/Domains/Contacts/Models/Contact.php`

### Invoices & expenses

- [Invoices & QR-Bill](https://github.com/scanix/gaeld/blob/develop/app/Domains/Invoicing/Models/Invoice.php): `app/Domains/Invoicing/Models/Invoice.php`
- [Expenses & receipts](https://github.com/scanix/gaeld/blob/develop/app/Domains/Expenses/Models/Expense.php): `app/Domains/Expenses/Models/Expense.php`
- [Expense categories](https://github.com/scanix/gaeld/blob/develop/app/Domains/Expenses/Models/ExpenseCategory.php): `app/Domains/Expenses/Models/ExpenseCategory.php`

### Banking

- [Bank imports](https://github.com/scanix/gaeld/blob/develop/app/Domains/Banking/Services/BankImportService.php): `app/Domains/Banking/Services/BankImportService.php`
- [Bank transactions](https://github.com/scanix/gaeld/blob/develop/app/Domains/Banking/Models/BankTransaction.php): `app/Domains/Banking/Models/BankTransaction.php`
- [Reconciliation](https://github.com/scanix/gaeld/blob/develop/app/Domains/Banking/Services/ReconciliationService.php): `app/Domains/Banking/Services/ReconciliationService.php`

### Accounting & reporting

- [Journal entries](https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Models/JournalEntry.php): `app/Domains/Accounting/Models/JournalEntry.php`
- [Transaction lines](https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Models/TransactionLine.php): `app/Domains/Accounting/Models/TransactionLine.php`
- [Chart of accounts](https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Models/Account.php): `app/Domains/Accounting/Models/Account.php`
- [Budgets](https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Models/Budget.php): `app/Domains/Accounting/Models/Budget.php`
- [Ledger operations](https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Services/LedgerService.php): `app/Domains/Accounting/Services/LedgerService.php`
- [Ledger queries](https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Services/LedgerQueryService.php): `app/Domains/Accounting/Services/LedgerQueryService.php`
- [Fiscal years & VAT](https://github.com/scanix/gaeld/blob/develop/app/Domains/Accounting/Services/FiscalYearService.php): `app/Domains/Accounting/Services/FiscalYearService.php`
- [Financial reports](https://github.com/scanix/gaeld/blob/develop/app/Domains/Reporting/Controllers/ReportController.php): `app/Domains/Reporting/Controllers/ReportController.php`

### Integrations

- [Webhooks](https://github.com/scanix/gaeld/blob/develop/app/Domains/Api/Models/Webhook.php): `app/Domains/Api/Models/Webhook.php`
- [REST API](https://github.com/scanix/gaeld/blob/develop/app/Domains/Api/Controllers/JournalEntryApiController.php): `app/Domains/Api/Controllers/JournalEntryApiController.php`
- [Plugin system](https://github.com/scanix/gaeld/blob/develop/app/Providers/PluginServiceProvider.php): `app/Providers/PluginServiceProvider.php`

### Other components

- **Business user**
- **Bank**
- **External application**

## Connections

- Business user → Organization: manages (evidence: `README.md`)
- Business user → Contacts: maintains (evidence: `README.md`)
- Business user → Invoices & QR-Bill: creates (evidence: `README.md`)
- Business user → Expenses & receipts: records (evidence: `README.md`)
- Business user → Bank imports: imports statements (evidence: `README.md`)
- Bank → Bank imports: provides CAMT (evidence: `README.md`)
- Bank imports → Bank transactions: imports
- Business user → Reconciliation: matches transactions (evidence: `README.md`)
- Reconciliation → Invoices & QR-Bill: matches against (evidence: `README.md`)
- Reconciliation → Expenses & receipts: matches against (evidence: `README.md`)
- Business user → Journal entries: posts entries (evidence: `README.md`)
- Journal entries → Transaction lines: has lines (evidence: `app/Domains/Accounting/Models/JournalEntry.php`)
- Transaction lines → Chart of accounts: references (evidence: `app/Domains/Accounting/Models/TransactionLine.php`)
- Ledger queries → Journal entries: queries (evidence: `app/Domains/Accounting/Services/LedgerQueryService.php`)
- Ledger queries → Transaction lines: queries (evidence: `app/Domains/Accounting/Services/LedgerQueryService.php`)
- Ledger queries → Chart of accounts: queries (evidence: `app/Domains/Accounting/Services/LedgerQueryService.php`)
- Business user → Budgets: sets targets
- Business user → Fiscal years & VAT: manages VAT (evidence: `README.md`)
- Ledger queries → Financial reports: projects balances
- Business user → REST API: integrates through (evidence: `README.md`)
- External application → REST API: sends requests (evidence: `README.md`)
- REST API → Journal entries: supports entries (evidence: `README.md`)
- REST API → Contacts: supports contacts (evidence: `README.md`)
- REST API → Invoices & QR-Bill: supports invoices (evidence: `README.md`)
- REST API → Expenses & receipts: supports expenses (evidence: `README.md`)
- Business user → Plugin system: extends product (evidence: `README.md`)
- Contacts → Invoices & QR-Bill: customer relation (evidence: `app/Domains/Contacts/Models/Contact.php`)
- Contacts → Expenses & receipts: supplier relation (evidence: `app/Domains/Contacts/Models/Contact.php`)
- Organization → Chart of accounts: owns (evidence: `app/Domains/Organizations/Models/Organization.php`)
- Organization → Contacts: owns (evidence: `app/Domains/Organizations/Models/Organization.php`)
- Organization → Bank transactions: owns
- Expenses & receipts → Expense categories: references (evidence: `app/Domains/Expenses/Models/Expense.php`)
