# 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`. ```bash 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: ```bash 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): ```bash 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= 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](https://lucide.dev) (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.