User guide

Dashboard

invoiceguard dashboard            # http://127.0.0.1:8000/
invoiceguard dashboard --port 8080

A small FastAPI + Jinja2 web UI that shares the CLI's SQLite database. Binds to 127.0.0.1 by default (localhost only). The API docs (/docs, /redoc) are disabled.

Pages

  • GET / — invoice list with status filters (draft, sent, partially-paid, paid, overdue, void), totals (outstanding / overdue / collected), and per-status counts, plus a Payouts section with per-freelancer payout timing (due / overdue / upcoming / settled / no schedule, with next or missed payout date, as of today — the same rollup payout schedule and freelancer list use; hidden when the roster is empty, and freelancers with no billable invoices get no row). Append ?as_of=YYYY-MM-DD to project the timing to that day instead (the header then reads payout timing as of <date> with a "back to today" link, and the status-filter and Details links keep the projection); an invalid date is a clean 400. Only the payout timing is projected — the invoice list, totals, and escalation stages stay as-of-today. Each row shows the invoice kind, amount, project, due date, current escalation stage — and, for partially-paid invoices, how much has been paid and what is left.
  • GET /invoices.csv — the same invoice list as a CSV download (v0.46.0): one row per invoice in the same newest-first order, with the same columns the page prints (invoice id, client, project, kind, status, amount, currency, paid, outstanding, freelancer, due date, days overdue, escalation stage), plus the attributed freelancer's payout timing in trailing payout_status / payout_date columns — the missed run date when overdue, the next payout date when due or upcoming, empty for settled / no schedule — taken from the same agency summary rows the Payouts section uses. Honors the same ?status= filter and ?as_of= projection (default: today); an unknown status is a 404 and an invalid date a clean 400, matching the page. An empty book downloads a header-only CSV. A Download CSV link on the index page (in the filter row) carries the filter and projection on screen. Token-gated exactly like the index page (see Authentication below).
  • GET /invoices/{id} — invoice detail: amount, paid and outstanding balances, status, Stripe payment link, due date, a payments ledger (every recorded payment with date, method, and note), and a chronological timeline of dunning events and payments. When the invoice is assigned to a freelancer, the Freelancer row also shows their payout timing (due / overdue / upcoming / settled / no schedule, with next or missed payout date, as of today — the same rollup as the index Payouts section; no phrase when the freelancer has no billable invoices). ?as_of=YYYY-MM-DD projects that timing to the day (marked (as of <date>), back link keeps the projection); the amounts and timeline stay as-of-today, and an invalid date is a clean 400.
  • GET /invoices/{id}.csv — the same invoice's full record as a CSV download (v0.47.0): one row with the same columns the detail page prints (invoice id, client, client email, project, kind, status, paid-late flag, amount, currency, paid, outstanding, freelancer, due date, days overdue, escalation stage), plus the detail-only facts (sent date, paid-in-full date, contract acknowledgment with its date, deposit percent, late-fee rate and grace days, accrued fees with months billed and accrual start, total with fees, project value with its currency), plus the attributed freelancer's payout timing in trailing payout_status / payout_date columns — the missed run date when overdue, the next payout date when due or upcoming, empty for settled / no schedule — taken from the same agency summary rows the page's Freelancer row uses. Honors the same ?as_of= projection (default: today); an unknown invoice is a 404 and an invalid date a clean 400, matching the page. A Download CSV link on the detail page (in the invoice header) carries the projection on screen. Token-gated exactly like the detail page (see Authentication below).
  • GET /invoices/{id}/timeline.csv — the detail page's timeline as a CSV download (v0.48.0): one row per event in the same chronological order the page prints them (contract acknowledgment, sent, payments, dunning stages, paid), with the invoice id on every row, the date, and the event — the payment amount as a plain decimal string with the invoice's currency, the payment method (empty when manual), and the escalation stage label (Day 1 / Day 7 / Day 15) on dunning rows. An invoice with no events yet exports a header-only CSV; an unknown invoice is a 404. A Download CSV link on the detail page's Timeline card opens it. Token-gated exactly like the detail page (see Authentication below).
  • GET /healthz — {"ok": true}, for uptime checks.
  • GET /sign/{token} — the client's one-time contract signing page: renders the contract, collects a typed name and a drawn signature (see Contracts).
  • POST /sign/{token} — records the signature; returns a signed-receipt page. Unknown or already-used tokens return 404 / 400.
  • POST /webhooks/stripe — the Stripe webhook receiver (see Webhooks).

Unknown status filters and missing invoices return a 404 page.

Authentication (v0.41.0)

The two pages above expose client names/emails, amounts, and payment history, so they require a dashboard token when one is configured: set INVOICEGUARD_DASHBOARD_TOKEN or dashboard_token in the config file (see Configuration). Present it as an Authorization: Bearer <token> header, or open the dashboard once with ?token=<token> in the URL — a successful visit sets an HttpOnly cookie so the in-dashboard links keep working. Requests without a valid token get HTTP 401.

When no token is configured the pages are unauthenticated, and startup logs and prints a loud warning saying so — that mode is for trusted localhost only; never expose the app beyond one without a token (put it behind TLS if you do: the token travels in headers/cookies). The webhook endpoint (verified by Stripe signature), the /sign/{token} pages (the URL token is the capability), and /healthz are never token-gated.

Screenshots

Captured from the real dashboard running locally against seeded demo data (every sample name is labeled (demo)):

Invoice list

Invoice list — status filters, totals, and escalation stages.

Invoice detail

Invoice detail — timeline of dunning events.

Invoice detail with partial payment

Invoice detail — a partially-paid invoice: Paid/Outstanding amounts, the payments ledger, and payment events in the timeline.

Notes

  • The dashboard never inserts data on startup — it creates empty tables if the DB is fresh, nothing more.
  • It reads and writes the same tables as the CLI; column names and types are frozen (additive migrations only). See Database.
  • Webhook verification needs the signing secret — resolution order is documented in Webhooks. Without a real secret, POST /webhooks/stripe returns HTTP 500.
  • Totals, defined: Outstanding = sum of outstanding balances over sent/overdue/partially-paid invoices; Overdue = the same over overdue invoices only; Collected = sum of all rows in the payment ledger. (Since v0.2.0; for older databases the ledger backfill makes the numbers identical to the old definitions.)