+
+
Dashboard
+
{{ start.strftime('%B %Y') }} ·
+
+
+
+
+{% if missed %}
+
+
+
{{ icon('wallet') }}
+
Net worth
+
{{ net_worth|eur(0) }}
+
Cash {{ cash|eur(0) }} · Invested {{ invest_value|eur(0) }}
+
+
+
{{ icon('shopping-cart') }}
+
Spent in {{ start.strftime('%B') }}
+
{{ cur.expense|eur(0) }}
+
Income {{ cur.income|eur(0) }} ·
+ {{ (cur.income - cur.expense)|eur(0, true) }}
+
+
+ {% set a = pt.get('all') %}
+
{{ icon('trending-up') }}
+
Investments + gold
+
{{ (a.value if a else 0)|eur(0) }}
+
{% if a %}Paid
{{ a.cost|eur(0) }} ·
+
{{ a.pnl_pct|pct }} {% else %}
Add holdings {% endif %}
+
+
+
{{ icon('handshake') }}
+
Debts (net)
+
{{ (owed - i_owe)|eur(0, true) }}
+
I owe {{ i_owe|eur(0) }} · Owed to me {{ owed|eur(0) }}
+
+
+
+
+
{{ d.name }} {{ 'I owe' if d.direction == 'i_owe' else 'owed to me' }}
+ {% if d.closed %}closed {% endif %}
+
+ {% if d.match_pattern %}{% endif %}
+
+
+
+
+
+Debts What you owe and what others owe you
+
+
+
{{ icon('arrow-up-right') }}
I owe
{{ sums.i_owe|eur }}
+
{{ icon('arrow-down-right') }}
Owed to me
{{ sums.owed_to_me|eur }}
+
{{ icon('scale') }}
Net
{{ (sums.owed_to_me - sums.i_owe)|eur(2, true) }}
+
+
+{% for dir, label in [('i_owe', 'Debts I have'), ('owed_to_me', 'Money people owe me')] %}
+Import statements ING (NL) and Revolut CSV exports · duplicates are skipped automatically
+
+
+
+
{{ icon('download') }} Where to get the files
+
ING (main and shared): Mijn ING → account → Af- en bijschrijvingen downloaden → format
+ Kommagescheiden CSV or Puntkomma-gescheiden , pick a date range. Both formats work, Dutch or English headers.
+
Revolut: app → account → ⋯ → Statement → Excel /CSV , pick the period. Only completed
+ transactions from the Current account are imported.
+
Prefer automatic syncing? Set up Enable Banking under Settings .
+
+
+
+{% if results %}
+
+
{{ title }}
+
{{ 'Physical gold valued at live spot price' if is_gold else 'Stocks, ETFs and crypto at live prices' }} ·
+
+
+
+
+ {% set a = t.get('all') %}
+
{{ icon('gem' if is_gold else 'line-chart') }}
Current value
{{ (a.value if a else 0)|eur }}
+
{% if a and a.missing_price %}{{ a.missing_price }} without price (counted at cost) {% else %}live prices{% endif %}
+
{{ icon('banknote') }}
Paid
{{ (a.cost if a else 0)|eur }}
incl. fees, open positions
+
{{ icon('arrow-up-right' if a and a.pnl >= 0 else 'arrow-down-right') }}
Unrealised P/L
+
{{ (a.pnl if a else 0)|eur(2, true) }}
{{ (a.pnl_pct if a else None)|pct }}
+
{{ icon('check') }}
Realised P/L
{{ (a.realized if a else 0)|eur(2, true) }}
from sells
+
+
+{% if not is_gold %}
+
+ {% for k, label in [('stock','Stocks & ETFs'),('crypto','Crypto')] %}{% set x = t.get(k) %}
+
{{ icon('bitcoin' if k == 'crypto' else 'bar-chart-3') }}
{{ label }}
+
{{ (x.value if x else 0)|eur }}
+
paid {{ (x.cost if x else 0)|eur }} · {{ (x.pnl if x else 0)|eur(2, true) }} ({{ (x.pnl_pct if x else None)|pct }} )
+ {% endfor %}
+
+{% endif %}
+
+
+
+
{{ icon('line-chart') }} Value vs paid
+
+ 1M 3M
+ 6M 1Y All
+
+ {% if chart.labels %}
+
+ {% else %}
{{ icon('line-chart') }} A data point is stored each time prices refresh.
{% endif %}
+
+
+
{{ icon('pie-chart') }} Allocation
+ {% if chart.alloc_values %}
+
+
+ {% else %}
{{ icon('pie-chart') }} No priced holdings yet.
{% endif %}
+
+
+
+
+
+
+
Recurring payments Subscriptions and fixed costs, detected from your statements
+
+
+
+
+
{{ icon('calendar-clock') }}
Fixed costs / month
{{ out_total|eur }}
{{ (out_total*12)|eur(0) }} per year
+
{{ icon('piggy-bank') }}
Recurring income / month
{{ in_total|eur }}
add salary manually below
+
{{ icon('alert-triangle') }}
Missed
+ {% set ns = namespace(m=0) %}{% for r in recs %}{% if rec_state(r) == 'missed' %}{% set ns.m = ns.m + 1 %}{% endif %}{% endfor %}
+
{{ ns.m }}
past expected date + grace period
+
+
+Settings Accounts, bank sync, categories and rules
+
+
+
{{ icon('landmark') }} Accounts
+
Add the IBANs of all your own accounts (including Revolut's) so transfers between them are recognised and not counted as spending.
+ “Your share” scales a joint account's spending, e.g. 50 for the shared house account.
+
+
+
+
+
{{ icon('refresh-cw') }} Automatic bank sync (Enable Banking)
+ {% if eb_configured %}
+
Configured ✓. New transactions are pulled every few hours. Bank consent expires (usually after 90–180 days); reconnect when it does.
+ {% if eb_valid %}
{% for k, v in eb_valid.items() %}{{ k }} consent valid until {{ v[:10] }} {% endfor %} {% endif %}
+
+
+
+
+
Bank names must match Enable Banking's list exactly (NL list ).
+ Revolut may be listed under LT. In free restricted mode, first link the same accounts in the Enable Banking control panel.
+ {% else %}
+
Not configured. You can keep importing CSVs, or enable sync:
+
+ Sign up at enablebanking.com and create an application (environment: Production , redirect URL: {{ request.base_url }}eb/callback).
+ Download the private key to ./secrets/enablebanking.pem and put the application ID in .env as EB_APP_ID.
+ In the Enable Banking control panel, use Link accounts for ING and Revolut (needed for the free restricted mode).
+ docker compose up -d, then come back here and press Connect.
+
+ {% endif %}
+
+
+
+
+
{{ icon('pie-chart') }} Categories
+
Kind “transfer” is excluded from income/expense totals (own-account moves, investing, savings).
+
+
+
+
+
{{ icon('sparkles') }} Categorisation rules
+
+
Matches whole words, case-insensitive. Prefix with re: for a regular expression. Lower priority wins.
+
+
+
+
+
+ Pattern In Category Prio
+
+ {% for r in rules %}
+ {{ r.pattern }}{{ r.field }} {{ r.category.name }}
+ {{ r.priority }}
+
+ {% endfor %}
+
+
+
+
+{% endblock %}
diff --git a/app/templates/transactions.html b/app/templates/transactions.html
new file mode 100644
index 0000000..7bacf93
--- /dev/null
+++ b/app/templates/transactions.html
@@ -0,0 +1,49 @@
+{% extends "base.html" %}
+{% block title %}Transactions{% endblock %}
+{% block content %}
+Transactions {{ total }} transactions · net {{ total_amount|eur }}
+
+
+
{{ icon('receipt') }} Activity {{ icon('lock', 'sm') }} Changing a category locks it so rules won't overwrite it.
+
+
+ Date Counterparty Account Category Amount Note
+
+ {% for t in txs %}
+
+ {{ t.date.strftime('%d-%m-%Y') }}
+ {{ icon('arrow-down-right' if t.amount > 0 else 'arrow-up-right', 'sm') }}
+
{{ t.counterparty or '—' }} {% if t.recurring_id %}
{{ icon('repeat', 'sm') }} {% endif %}{% if t.debt_id %}
{{ icon('handshake', 'sm') }} {% endif %}
+
{{ t.counter_iban or '' }} {{ t.description }}
+ {{ t.account.name }}
+ —
+ {% for c in categories %}{{ c.name }} {% endfor %}
+ {% if t.category_locked %}{{ icon('lock', 'sm') }} {% endif %}
+ {{ t.amount|eur }}{% if t.currency != 'EUR' %} {{ t.currency }} {% endif %}
+
+ {{ icon('plus', 'sm') }} Rule
+
+ {% else %}No transactions match. {% endfor %}
+
+
+
+ {% if pages > 1 %}
+
+ {% endif %}
+
+{% endblock %}
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..bb0c48f
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,148 @@
+# Self-hosted personal finance stack
+# traefik -> reverse proxy + TLS, forward-auth to authentik
+# authentik -> SSO / login (server + worker + postgres; no Redis needed since 2025.10)
+# finance -> the app (FastAPI) + its own postgres
+#
+# Usage: cp .env.example .env && edit && docker compose up -d --build
+
+name: finance
+
+x-authentik-env: &authentik-env
+ AUTHENTIK_SECRET_KEY: ${AUTHENTIK_SECRET_KEY:?set AUTHENTIK_SECRET_KEY in .env}
+ AUTHENTIK_ERROR_REPORTING__ENABLED: "false"
+ AUTHENTIK_POSTGRESQL__HOST: authentik-db
+ AUTHENTIK_POSTGRESQL__USER: authentik
+ AUTHENTIK_POSTGRESQL__NAME: authentik
+ AUTHENTIK_POSTGRESQL__PASSWORD: ${AUTHENTIK_DB_PASSWORD:?set AUTHENTIK_DB_PASSWORD in .env}
+
+services:
+ traefik:
+ image: traefik:${TRAEFIK_TAG:-v3.6}
+ restart: unless-stopped
+ ports:
+ - "80:80"
+ - "443:443"
+ environment:
+ # Only needed if you use the Let's Encrypt DNS challenge (see traefik/traefik.yml)
+ CF_DNS_API_TOKEN: ${CF_DNS_API_TOKEN:-}
+ volumes:
+ - /var/run/docker.sock:/var/run/docker.sock:ro
+ - ./traefik/traefik.yml:/etc/traefik/traefik.yml:ro
+ - ./traefik/dynamic:/etc/traefik/dynamic:ro
+ - ./traefik/certs:/certs:ro
+ - traefik-acme:/acme
+ networks: [proxy]
+
+ authentik-db:
+ image: postgres:16-alpine
+ restart: unless-stopped
+ environment:
+ POSTGRES_USER: authentik
+ POSTGRES_DB: authentik
+ POSTGRES_PASSWORD: ${AUTHENTIK_DB_PASSWORD}
+ volumes:
+ - authentik-db:/var/lib/postgresql/data
+ healthcheck:
+ test: ["CMD-SHELL", "pg_isready -d authentik -U authentik"]
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ networks: [authentik]
+
+ authentik-server:
+ image: ghcr.io/goauthentik/server:${AUTHENTIK_TAG:-2026.8.5}
+ restart: unless-stopped
+ command: server
+ environment: *authentik-env
+ volumes:
+ - ./authentik/data:/data
+ - ./authentik/custom-templates:/templates
+ depends_on:
+ authentik-db:
+ condition: service_healthy
+ networks: [proxy, authentik]
+ labels:
+ - traefik.enable=true
+ - traefik.docker.network=finance_proxy
+ - traefik.http.routers.authentik.rule=Host(`${AUTH_HOST}`)
+ - traefik.http.routers.authentik.entrypoints=websecure
+ - traefik.http.routers.authentik.tls=true
+ - traefik.http.services.authentik.loadbalancer.server.port=9000
+
+ authentik-worker:
+ image: ghcr.io/goauthentik/server:${AUTHENTIK_TAG:-2026.8.5}
+ restart: unless-stopped
+ command: worker
+ user: root
+ environment: *authentik-env
+ volumes:
+ - /var/run/docker.sock:/var/run/docker.sock
+ - ./authentik/data:/data
+ - ./authentik/certs:/certs
+ - ./authentik/custom-templates:/templates
+ depends_on:
+ authentik-db:
+ condition: service_healthy
+ networks: [authentik]
+
+ finance-db:
+ image: postgres:16-alpine
+ restart: unless-stopped
+ environment:
+ POSTGRES_USER: finance
+ POSTGRES_DB: finance
+ POSTGRES_PASSWORD: ${FINANCE_DB_PASSWORD:?set FINANCE_DB_PASSWORD in .env}
+ volumes:
+ - finance-db:/var/lib/postgresql/data
+ healthcheck:
+ test: ["CMD-SHELL", "pg_isready -d finance -U finance"]
+ interval: 10s
+ timeout: 5s
+ retries: 5
+ networks: [finance]
+
+ finance:
+ build: ./app
+ restart: unless-stopped
+ environment:
+ DATABASE_URL: postgresql+psycopg://finance:${FINANCE_DB_PASSWORD}@finance-db:5432/finance
+ TZ: ${TZ:-Europe/Amsterdam}
+ PUBLIC_URL: https://${FINANCE_HOST}
+ # Enable Banking (optional, see README)
+ EB_APP_ID: ${EB_APP_ID:-}
+ EB_KEY_PATH: /run/secrets/enablebanking.pem
+ EB_SYNC_HOURS: ${EB_SYNC_HOURS:-6}
+ # Prices
+ COINGECKO_API_KEY: ${COINGECKO_API_KEY:-}
+ PRICE_REFRESH_MINUTES: ${PRICE_REFRESH_MINUTES:-60}
+ volumes:
+ - ./secrets:/run/secrets:ro
+ depends_on:
+ finance-db:
+ condition: service_healthy
+ networks: [proxy, finance]
+ labels:
+ - traefik.enable=true
+ - traefik.docker.network=finance_proxy
+ # The app itself, protected by authentik forward-auth
+ - traefik.http.routers.finance.rule=Host(`${FINANCE_HOST}`)
+ - traefik.http.routers.finance.entrypoints=websecure
+ - traefik.http.routers.finance.tls=true
+ - traefik.http.routers.finance.middlewares=authentik@file,secure-headers@file
+ - traefik.http.services.finance.loadbalancer.server.port=8000
+ # authentik's embedded outpost must answer /outpost.goauthentik.io/ on the app's host
+ - traefik.http.routers.finance-outpost.rule=Host(`${FINANCE_HOST}`) && PathPrefix(`/outpost.goauthentik.io/`)
+ - traefik.http.routers.finance-outpost.entrypoints=websecure
+ - traefik.http.routers.finance-outpost.tls=true
+ - traefik.http.routers.finance-outpost.priority=100
+ - traefik.http.routers.finance-outpost.service=authentik@docker
+
+networks:
+ proxy:
+ authentik:
+ finance:
+
+volumes:
+ traefik-acme:
+ authentik-db:
+ finance-db:
diff --git a/secrets/.gitkeep b/secrets/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/traefik/certs/.gitkeep b/traefik/certs/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/traefik/dynamic/middlewares.yml b/traefik/dynamic/middlewares.yml
new file mode 100644
index 0000000..d822786
--- /dev/null
+++ b/traefik/dynamic/middlewares.yml
@@ -0,0 +1,22 @@
+http:
+ middlewares:
+ # Forward every request to authentik's embedded outpost; unauthenticated users get redirected to login.
+ authentik:
+ forwardAuth:
+ address: http://authentik-server:9000/outpost.goauthentik.io/auth/traefik
+ trustForwardHeader: true
+ authResponseHeaders:
+ - X-authentik-username
+ - X-authentik-groups
+ - X-authentik-email
+ - X-authentik-name
+ - X-authentik-uid
+
+ secure-headers:
+ headers:
+ frameDeny: true
+ contentTypeNosniff: true
+ referrerPolicy: same-origin
+ stsSeconds: 31536000
+ customResponseHeaders:
+ X-Robots-Tag: "noindex, nofollow"
diff --git a/traefik/dynamic/tls.yml b/traefik/dynamic/tls.yml
new file mode 100644
index 0000000..61f2acf
--- /dev/null
+++ b/traefik/dynamic/tls.yml
@@ -0,0 +1,10 @@
+# Optional: use your own certificate (e.g. made with mkcert for *.home.lan).
+# Put the files in ./traefik/certs and uncomment. Without this (and without Let's Encrypt)
+# Traefik serves its built-in self-signed certificate.
+#
+# tls:
+# stores:
+# default:
+# defaultCertificate:
+# certFile: /certs/local.crt
+# keyFile: /certs/local.key
diff --git a/traefik/traefik.yml b/traefik/traefik.yml
new file mode 100644
index 0000000..0797a29
--- /dev/null
+++ b/traefik/traefik.yml
@@ -0,0 +1,43 @@
+# Traefik static configuration
+api:
+ dashboard: false
+
+log:
+ level: INFO
+
+entryPoints:
+ web:
+ address: ":80"
+ http:
+ redirections:
+ entryPoint:
+ to: websecure
+ scheme: https
+ websecure:
+ address: ":443"
+ http:
+ tls: {}
+ # Uncomment to get real certificates via Let's Encrypt DNS challenge
+ # (works for LAN-only hosts as long as you own the domain):
+ # tls:
+ # certResolver: letsencrypt
+ # domains:
+ # - main: "example.com"
+ # sans: ["*.example.com"]
+
+providers:
+ docker:
+ exposedByDefault: false
+ network: finance_proxy
+ file:
+ directory: /etc/traefik/dynamic
+ watch: true
+
+# certificatesResolvers:
+# letsencrypt:
+# acme:
+# email: you@example.com
+# storage: /acme/acme.json
+# dnsChallenge:
+# provider: cloudflare # set CF_DNS_API_TOKEN in .env (or use another provider)
+# resolvers: ["1.1.1.1:53"]