2026-11-17 22:18:14 +01:00
2026-11-17 22:16:18 +01:00
2026-11-17 21:48:36 +01:00
2026-11-17 22:16:18 +01:00
2026-11-17 22:16:18 +01:00
2026-11-17 22:18:14 +01:00
2026-11-17 22:16:18 +01:00

Spendr: a self-hosted dashboard for ING, Revolut, investments, gold and debts

browser ──https──▶ Traefik (existing) ──authentik@docker──▶ Authentik (existing, auth.dv3.app)
                      │
                      └──▶ spendr (FastAPI) ──▶ spendr-db (Postgres)
                                 │
                                 ├─ Yahoo Finance  (stocks/ETFs, gold spot, FX)
                                 ├─ CoinGecko      (crypto)
                                 └─ Enable Banking (optional automatic ING/Revolut sync)

What it does

Feature How
Categories ~200 seed rules for Dutch merchants (AH, Jumbo, NS, Ziggo, Vattenfall, CZ, Belastingdienst…). Fix one in the table and it gets a 🔒 lock. Click +rule to turn a fix into a rule. Moves between your own IBANs are auto-tagged Transfers and left out of spending.
Subscriptions / monthly costs Detects weekly, monthly, quarterly and yearly payments from regular gaps and similar amounts (price increases are tolerated). You can confirm, ignore, or add an item by hand (rent, salary, yearly insurance).
Missed payment alert A recurring item whose next date + grace period (6 days for monthly) has passed shows as missed on the dashboard.
Investments You log buys and sells; cost is tracked with the average-cost method. Shows value vs paid, unrealised and realised P/L, allocation, and history. Stocks/ETFs use Yahoo tickers (VWRL.AS, IWDA.AS, ASML.AS), crypto uses CoinGecko ids (bitcoin). Everything is in EUR.
Gold Grams or troy oz × purity (24k, 22k Krugerrand, 18k jewellery…) × spot (COMEX GC=F → EUR). A manual price override is available for dealer buyback prices. Silver works too: use symbol SI=F.
Debts Covers both directions (what you owe and what you're owed). With a monthly amount and due day set, it shows on track / ahead / behind (n missed), the next due date and an estimated payoff date. Payments are matched from bank transactions automatically by a text pattern, or you can add them by hand.
Joint account Give the ING shared account a "your share %" (e.g. 50) and its spending is scaled in the totals.
Live numbers Every 30 s (and whenever you come back to the tab) the page fetches /api/live. Changed totals, prices and P/L count up or down and flash green or red, with no reload. Refresh prices runs in place. When new transactions arrive, a "new data · reload" hint appears so charts can be redrawn.
Dark mode Auto (follows the system), Light or Dark toggle in the sidebar, remembered per browser.
Mobile Desktop-first layout. On phones there's a bottom tab bar and a slide-out menu, and tables scroll sideways.

Setup (DV3 server)

This stack uses the Traefik and Authentik you already run. It only adds two containers: spendr and spendr-db.

mkdir -p ~/docker/spendr && cd ~/docker/spendr
# copy the contents of this folder here (compose.yaml, .env.example, app/, secrets/)
cp .env.example .env
nano .env            # set SPENDR_DB_PASSWORD:  openssl rand -base64 32 | tr -d '\n/+='
sudo docker compose up -d --build
  • DNS / TLS: spendr.dv3.app gets its certificate from the existing letsencrypt resolver, like your other services.
  • Login: the router uses authentik@docker. Your domain-level forward-auth provider (cookie domain dv3.app) protects it with no extra setup. Optional: create an Authentik application spendr and bind a policy or group if only certain users should get in.
  • Why forward auth and not OIDC: the app has no login of its own, so forward auth is the right fit (see your conventions).
  • Sign out: the sidebar button goes to https://auth.dv3.app/outpost.goauthentik.io/sign_out (set via SIGN_OUT_URL in compose.yaml).
  • Komodo / Gitea: see Deploy with Gitea + Komodo below (recommended).

Deploy with Gitea + Komodo (GitOps)

Same flow as YoteInvest: push to Gitea, then Komodo redeploys.

  1. Gitea: create an empty repo Mitchell/Spendr on git.dv3.app (no README), then from the unzipped folder:
    cd spendr
    git init -b main && git add . && git commit -m "Spendr: initial version"
    git remote add origin https://git.dv3.app/Mitchell/Spendr.git
    git push -u origin main
    
    .gitignore keeps .env and the Enable Banking key out of the repo.
  2. Secrets folder on the NUC (only needed for Enable Banking):
    sudo mkdir -p /etc/komodo/secrets/spendr
    sudo cp enablebanking.pem /etc/komodo/secrets/spendr/   # later, once you have it
    
  3. Komodo → Stacks → New stack spendr:
    • Source: Git Repo → provider git.dv3.app, repo Mitchell/Spendr, branch main. The file is compose.yaml, so no File Paths needed.
    • Turn on Run Build (the app image is built from ./app), so a push also rebuilds the image.
    • Environment (secrets live here, not in the repo):
      SPENDR_DB_PASSWORD=<openssl rand -base64 32 | tr -d '\n/+='>
      SECRETS_DIR=/etc/komodo/secrets/spendr
      PG_VOLUME=spendr-db
      EB_APP_ID=
      
    • Deploy.
  4. Auto-deploy on push: copy the stack's webhook URL (/listener/github/...). In Gitea, open repo → Settings → Webhooks → Gitea, choose JSON, set the secret to KOMODO_WEBHOOK_SECRET, and paste the URL.
  5. Open https://spendr.dv3.app. Authentik asks you to log in, then you land on the dashboard.

PG_VOLUME pins the database volume name, so renaming or recreating the stack never orphans your data.

Getting data in

CSV (always works). Use Import and select several files at once. Overlapping periods are deduplicated.

  • ING: Mijn ING → Af- en bijschrijvingen downloaden → CSV (comma or semicolon, NL or EN headers). The account is detected from the IBAN in the file.
  • Revolut: app → ⋯ → Statement → CSV. Only completed transactions from the Current account are imported.

First go to Settings → Accounts and add the IBANs of all three accounts (Revolut's too). Transfers between them are then recognised, and the shared account gets its share %.

Automatic sync (Enable Banking, free for your own accounts):

  1. Sign up at enablebanking.com → Applications → create one (Production). Set the redirect URL to https://spendr.dv3.app/eb/callback.
  2. Save the downloaded private key as secrets/enablebanking.pem and put the app id in .env → EB_APP_ID.
  3. In their control panel, use Link accounts for ING and Revolut. Free "restricted mode" only returns accounts you linked there.
  4. sudo docker compose up -d, then go to Settings → Connect (ING / NL, then Revolut; Revolut may be listed under LT).
  5. The app syncs every EB_SYNC_HOURS. Bank consent (PSD2) expires after 90–180 days, so you'll need to click Connect again now and then. The expiry date is shown in Settings.

CSV and API imports share the same dedupe key (account + date + amount + n-th of that day), so you can mix them.

Operations

  • Backup: sudo docker compose exec spendr-db pg_dump -U spendr spendr | gzip > spendr-$(date +%F).sql.gz. Never run docker compose down -v, because it deletes the database volume.
  • Logs: sudo docker compose logs -f spendr
  • Not exposed: the app has no published port. It is only reachable through Traefik and Authentik. Keep it that way.
  • Prices refresh every PRICE_REFRESH_MINUTES. Yahoo's endpoint is unofficial. If a ticker fails, the holding shows "price error" and you can set a manual price.
  • The schema is created on start (create_all). Add Alembic if you start changing models.

UI

  • Icons are Lucide (ISC licence), stored inside the app as an SVG sprite (templates/_icons.svg), so no CDN is needed.
  • Charts use Chart.js and have hover tooltips: savings rate per month, and P/L at each point on the value line.
    • Click a bar to open that month, or a doughnut slice to see its transactions.
    • Click legend entries to hide or show them.
    • Range buttons (1M–All) on the history charts.
  • On phones: bottom tab bar plus a slide-out menu.

Ideas for later

Budgets per category, splitting shared-house costs with your partner, DEGIRO/Bitvavo CSV import for trades, ntfy/Telegram push for missed payments, salary-missed alerts.

S
Description
No description provided
Readme
1.3 MiB
Languages
Python 47.3%
HTML 30.8%
CSS 11.1%
JavaScript 10.4%
Dockerfile 0.4%