# speicherstadt/haben architecture

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

- Interactive diagram: https://gitdiagram.com/speicherstadt/haben
- Repository: https://github.com/speicherstadt/haben

## Overview

Haben is self-hosted German bookkeeping, invoicing, and tax-filing software. The main user journey runs from creating invoices and capturing receipts through bank reconciliation and bookkeeping to reviewing VAT figures and submitting them to ELSTER. Other major branches cover annual returns, GmbH balance sheets, payroll, asset depreciation, reporting, and migration from other accounting products. The graph combines README-described capabilities with sampled module relationships; unsampled implementation details and connections are omitted where the available evidence does not establish them.

Main entry points: [`apps/web/src/routes/_app.tsx`](https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app.tsx) (Haben web app), [`packages/elster/src/process-client.ts`](https://github.com/speicherstadt/haben/blob/main/packages/elster/src/process-client.ts) (ELSTER integration), [`packages/core/src/lohnabrechnung/index.ts`](https://github.com/speicherstadt/haben/blob/main/packages/core/src/lohnabrechnung/index.ts) (Payroll), [`packages/core/src/sozialversicherung/index.ts`](https://github.com/speicherstadt/haben/blob/main/packages/core/src/sozialversicherung/index.ts) (Social contributions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_records["Invoices and records"]
  node_invoice["Invoices and quotes<br/>[neu.tsx]"]
  node_receipts["Receipts and documents<br/>[index.ts]"]
  node_contacts["Contacts<br/>[index.tsx]"]
end

subgraph group_accounting["Accounting and reporting"]
  node_bank["Bank reconciliation<br/>[bank.tsx]"]
  node_ledger["Bookkeeping<br/>[index.tsx]"]
  node_reports["Reports and exports<br/>[auswertungen.tsx]"]
  node_archive["Year archive<br/>[ArchiveFiles.tsx]"]
  node_assets["Assets and depreciation<br/>[index.tsx]"]
end

subgraph group_tax["Tax and payroll"]
  node_vat["VAT returns<br/>[index.tsx]"]
  node_annual["Annual returns<br/>[index.tsx]"]
  node_balance["Balance and E-Bilanz<br/>[Ebilanz.tsx]"]
  node_payroll["Payroll<br/>[index.ts]"]
  node_contributions["Social contributions<br/>[index.ts]"]
  node_contributionform["Contribution notices"]
end

subgraph group_platform["Application platform"]
  node_webapp["Haben web app<br/>[_app.tsx]"]
  node_storage[("Document storage<br/>[storage.ts]")]
  node_db[("Application database<br/>[schema.ts]")]
end

subgraph group_integrations["External integrations"]
  node_elster["ELSTER integration<br/>[process-client.ts]"]
  node_elsterxml["ELSTER XML<br/>[xml.ts]"]
  node_imports["Accounting imports<br/>[client.ts]"]
  node_einvoice["E-invoice rendering<br/>[typst-compiler.ts]"]
  node_bankservice["Banking services"]
  node_elsterservice["German tax authority"]
  node_legacy["Legacy accounting products"]
end

node_user(("Business user"))

node_user -->|"uses"| node_webapp
node_webapp -->|"creates"| node_invoice
node_webapp -->|"captures"| node_receipts
node_webapp -->|"manages"| node_contacts
node_webapp -->|"reconciles"| node_bank
node_webapp -->|"records"| node_ledger
node_webapp -->|"produces"| node_reports
node_webapp -->|"archives"| node_archive
node_webapp -->|"tracks"| node_assets
node_webapp -->|"prepares"| node_vat
node_webapp -->|"prepares"| node_annual
node_webapp -->|"prepares"| node_balance
node_webapp -->|"calculates"| node_payroll
node_payroll -->|"calculates"| node_contributions
node_contributions -->|"informs"| node_contributionform
node_webapp -->|"submits returns"| node_elster
node_elster -->|"validates XML"| node_elsterxml
node_elster -->|"sends filings"| node_elsterservice
node_webapp -->|"stores documents"| node_storage
node_webapp -.->|"stores records"| node_db
node_webapp -->|"imports transactions"| node_bankservice
node_webapp -->|"renders e-invoices"| node_einvoice
node_webapp -->|"imports records"| node_imports
node_imports -.->|"reads data"| node_legacy

click node_webapp "https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app.tsx"
click node_invoice "https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/rechnungen/neu.tsx"
click node_receipts "https://github.com/speicherstadt/haben/blob/main/apps/web/src/server/modules/belege/index.ts"
click node_contacts "https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/kontakte/index.tsx"
click node_bank "https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/bank.tsx"
click node_ledger "https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/buchungen/index.tsx"
click node_reports "https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/auswertungen.tsx"
click node_archive "https://github.com/speicherstadt/haben/blob/main/apps/web/src/components/archiv/ArchiveFiles.tsx"
click node_assets "https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/anlagen/index.tsx"
click node_vat "https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/umsatzsteuer/index.tsx"
click node_annual "https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/jahreserklaerung/index.tsx"
click node_balance "https://github.com/speicherstadt/haben/blob/main/apps/web/src/components/Ebilanz.tsx"
click node_payroll "https://github.com/speicherstadt/haben/blob/main/packages/core/src/lohnabrechnung/index.ts"
click node_contributions "https://github.com/speicherstadt/haben/blob/main/packages/core/src/sozialversicherung/index.ts"
click node_contributionform "https://github.com/speicherstadt/haben/blob/main/packages/core/src/sv-meldeportal/beitragsnachweis.ts"
click node_elster "https://github.com/speicherstadt/haben/blob/main/packages/elster/src/process-client.ts"
click node_elsterxml "https://github.com/speicherstadt/haben/blob/main/packages/elster/src/xml.ts"
click node_storage "https://github.com/speicherstadt/haben/blob/main/apps/web/src/server/storage.ts"
click node_db "https://github.com/speicherstadt/haben/blob/main/apps/web/src/server/db/schema.ts"
click node_imports "https://github.com/speicherstadt/haben/blob/main/packages/import/src/lexoffice/client.ts"
click node_einvoice "https://github.com/speicherstadt/haben/blob/main/packages/einvoice/src/typst-compiler.ts"

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_invoice,node_receipts,node_contacts,node_user toneBlue
class node_bank,node_ledger,node_reports,node_archive,node_assets toneAmber
class node_vat,node_annual,node_balance,node_payroll,node_contributions,node_contributionform toneMint
class node_webapp,node_storage,node_db toneRose
class node_elster,node_elsterxml,node_imports,node_einvoice,node_bankservice,node_elsterservice,node_legacy toneIndigo
```

## Components

### Invoices and records

- [Invoices and quotes](https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/rechnungen/neu.tsx): `apps/web/src/routes/_app/rechnungen/neu.tsx`
- [Receipts and documents](https://github.com/speicherstadt/haben/blob/main/apps/web/src/server/modules/belege/index.ts): `apps/web/src/server/modules/belege/index.ts`
- [Contacts](https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/kontakte/index.tsx): `apps/web/src/routes/_app/kontakte/index.tsx`

### Accounting and reporting

- [Bank reconciliation](https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/bank.tsx): `apps/web/src/routes/_app/bank.tsx`
- [Bookkeeping](https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/buchungen/index.tsx): `apps/web/src/routes/_app/buchungen/index.tsx`
- [Reports and exports](https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/auswertungen.tsx): `apps/web/src/routes/_app/auswertungen.tsx`
- [Year archive](https://github.com/speicherstadt/haben/blob/main/apps/web/src/components/archiv/ArchiveFiles.tsx): `apps/web/src/components/archiv/ArchiveFiles.tsx`
- [Assets and depreciation](https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/anlagen/index.tsx): `apps/web/src/routes/_app/anlagen/index.tsx`

### Tax and payroll

- [VAT returns](https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/umsatzsteuer/index.tsx): `apps/web/src/routes/_app/umsatzsteuer/index.tsx`
- [Annual returns](https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app/jahreserklaerung/index.tsx): `apps/web/src/routes/_app/jahreserklaerung/index.tsx`
- [Balance and E-Bilanz](https://github.com/speicherstadt/haben/blob/main/apps/web/src/components/Ebilanz.tsx): `apps/web/src/components/Ebilanz.tsx`
- [Payroll](https://github.com/speicherstadt/haben/blob/main/packages/core/src/lohnabrechnung/index.ts): `packages/core/src/lohnabrechnung/index.ts`
- [Social contributions](https://github.com/speicherstadt/haben/blob/main/packages/core/src/sozialversicherung/index.ts): `packages/core/src/sozialversicherung/index.ts`
- [Contribution notices](https://github.com/speicherstadt/haben/blob/main/packages/core/src/sv-meldeportal/beitragsnachweis.ts): `packages/core/src/sv-meldeportal/beitragsnachweis.ts`

### Application platform

- [Haben web app](https://github.com/speicherstadt/haben/blob/main/apps/web/src/routes/_app.tsx): `apps/web/src/routes/_app.tsx`
- [Document storage](https://github.com/speicherstadt/haben/blob/main/apps/web/src/server/storage.ts): `apps/web/src/server/storage.ts`
- [Application database](https://github.com/speicherstadt/haben/blob/main/apps/web/src/server/db/schema.ts): `apps/web/src/server/db/schema.ts`

### External integrations

- [ELSTER integration](https://github.com/speicherstadt/haben/blob/main/packages/elster/src/process-client.ts): `packages/elster/src/process-client.ts`
- [ELSTER XML](https://github.com/speicherstadt/haben/blob/main/packages/elster/src/xml.ts): `packages/elster/src/xml.ts`
- [Accounting imports](https://github.com/speicherstadt/haben/blob/main/packages/import/src/lexoffice/client.ts): `packages/import/src/lexoffice/client.ts`
- [E-invoice rendering](https://github.com/speicherstadt/haben/blob/main/packages/einvoice/src/typst-compiler.ts): `packages/einvoice/src/typst-compiler.ts`
- **Banking services**
- **German tax authority**
- **Legacy accounting products**

### Other components

- **Business user**

## Connections

- Business user → Haben web app: uses (evidence: `README.md`)
- Haben web app → Invoices and quotes: creates (evidence: `README.md`)
- Haben web app → Receipts and documents: captures (evidence: `README.md`)
- Haben web app → Contacts: manages (evidence: `README.md`)
- Haben web app → Bank reconciliation: reconciles (evidence: `README.md`)
- Haben web app → Bookkeeping: records (evidence: `README.md`)
- Haben web app → Reports and exports: produces (evidence: `README.md`)
- Haben web app → Year archive: archives (evidence: `README.md`)
- Haben web app → Assets and depreciation: tracks (evidence: `README.md`)
- Haben web app → VAT returns: prepares (evidence: `README.md`)
- Haben web app → Annual returns: prepares (evidence: `README.md`)
- Haben web app → Balance and E-Bilanz: prepares (evidence: `README.md`)
- Haben web app → Payroll: calculates (evidence: `README.md`)
- Payroll → Social contributions: calculates (evidence: `packages/core/src/lohnabrechnung/index.ts`)
- Social contributions → Contribution notices: informs (evidence: `packages/core/src/sv-meldeportal/beitragsnachweis.ts`)
- Haben web app → ELSTER integration: submits returns (evidence: `README.md`)
- ELSTER integration → ELSTER XML: validates XML (evidence: `packages/elster/src/process-client.ts`)
- ELSTER integration → German tax authority: sends filings (evidence: `README.md`)
- Haben web app → Document storage: stores documents (evidence: `apps/web/src/server/storage.ts`)
- Haben web app → Application database: stores records
- Haben web app → Banking services: imports transactions (evidence: `README.md`)
- Haben web app → E-invoice rendering: renders e-invoices (evidence: `README.md`)
- Haben web app → Accounting imports: imports records (evidence: `README.md`)
- Accounting imports → Legacy accounting products: reads data
