Daniel Flippo
On this page

Integration and data pipelines
currently healthcare EDI

Reading this with an agent? llms.txt has the same facts in plain text.

Daniel Flippo

Integration and data pipelines
currently healthcare EDI

Reading this with an agent? llms.txt has the same facts in plain text.

Home

Case study · Financial Planner

An import you can safely run twice, and a privacy rule that lives in one place.

A self-hosted, multi-user personal finance platform built to replace a paid budgeting subscription. It imports bank and card data, de-duplicates and categorizes it, and keeps each person’s private accounts private inside a shared household.

  • Python
  • Django
  • PostgreSQL
  • Docker Compose

Who it’s for

Built for a two-person household. It runs on a home server. It exists because I wanted to stop paying for a budgeting subscription.

The repo is public and MIT licensed, with deployment docs, so anyone comfortable with Docker can run their own.

The problem

Bank and card data arrives in different shapes: each source exports its own columns, dates and signs, and a fresh download overlaps the last one. A card payment shows up as spending on one account and income on another, and a refund looks like income. Meanwhile some accounts are shared and some are not.

This is the same shape as partner data ingestion at work: per-source formats, repeated deliveries and a downstream report that is only trustworthy if the pipeline is. So the pipeline is the interesting part of this project.

Constraints

  • Exact money. Amounts are integer cents with an explicit ISO 4217 currency, so there is no floating-point drift anywhere in the pipeline. Version 1 accepts USD only, and the database rejects anything else.
  • Re-importing must never double-count, yet two genuine identical purchases on one day must both survive.
  • Private by default. The app is reachable only over a private Tailscale network. A household shares some accounts and keeps others private, including in search, totals, charts, exports, logs and error messages.
  • No real financial data in the repo or in logs. All fixtures are synthetic and imported row contents are never written to logs. Even working out a bank’s CSV layout avoids sharing a file: a small script prints only the file’s shape, with every letter and digit masked.
  • Small to run. Server-rendered pages, one Docker Compose stack and no Node toolchain, because it is a household app.

Decisions and tradeoffs What was chosen, what was passed on, and what it costs

Fingerprint rows, and count them instead of requiring them to be unique

Chose
Each row gets a SHA-256 fingerprint of account, date, signed amount and description, computed at import and never rewritten. A re-import is previewed as new, duplicate and invalid rows, and only the new ones are stored. Overlap is checked against active rows on the same account, so an undone batch can be imported again.
Passed on
A unique constraint on the fingerprint, or matching on the bank’s own transaction number. One bank’s profile stores that number but deliberately does not match on it.
Cost
Identical rows can’t be told apart, so they are counted, not collapsed. Importing the same activity as both CSV and OFX can create duplicates when the descriptions differ, and the docs say to use one format per period or undo the extra batch.

One sign convention for every account type

Chose
Negative is money out and positive is money in, including on credit cards. Each importer profile maps its source’s columns and signs onto that rule, and tests enforce it.
Passed on
Keeping each bank’s own sign and translating at report time.
Cost
Every profile carries a sign rule. Balances are a separate case: a SimpleFIN credit-card balance keeps the protocol’s sign while a hand-entered one is the positive amount owed, so net worth handles the sign per source.

Archive instead of delete

Chose
Undoing an import archives that batch and only its transactions. Corrections write an append-only history row in the same database transaction as the edit. Database relationships are protected, so provenance can’t be deleted by accident.
Passed on
Hard deletes, and edits that overwrite the original.
Cost
Archived records stay in the database, and every read has to exclude them.

Transfers and refunds stay out of income and spending

Chose
Two transactions pair as a transfer or card payment when they have opposite signs, equal amounts, different accounts and dates within a window (five days by default). Only a pair with exactly one counterpart is marked automatically. The rest are suggestions until someone confirms them. A refund is linked to its original purchase and is subtracted from spending in the original’s category instead of counting as income.
Passed on
Counting every row as income or spending, or auto-pairing anything that looks close.
Cost
Ambiguous pairs need a human, and refund links are made by hand. Pairing runs on what the asking person can see, so two members can legitimately see different totals.

Unverified investment activity is stored but kept out of the totals

Chose
Investment activity from an export is kept with its original fields under its own kind and left out of income and spending until its meaning is confirmed. The schema has no symbol, quantity or price fields, because those would be invented. Projections are labelled and never added to actuals.
Passed on
Guessing what each activity type means so the numbers look complete.
Cost
Investment accounts are incomplete in cash-flow views, and the home view says so.

Deny by default, with one visibility layer

Chose
Authentication middleware denies every route except sign-in, setup, invitation and recovery. Every query for accounts, transactions, balances, goals and planned items goes through one visible_to(person) layer, so a private-account leak would take a defect in one place, not in every view. Sensitive actions such as export need re-authentication.
Passed on
Filtering per view, and allow-lists of protected routes.
Cost
Every new feature has to be written against the layer, and the aggregates (pairing, recurring charges) have to be defined over visible rows only.

A daily bank sync that reuses the import path

Chose
An optional SimpleFIN Bridge connection on a scheduled worker. Posted transactions only, mapped into the same batches and fingerprints as a CSV. The access URL is encrypted at rest and never logged. If the bridge reports an error for an account, no batch is created for it, so a missing-import warning stays accurate.
Passed on
Importing pending transactions, which the protocol leaves out by default.
Cost
Pending items appear a little late. A relinked account can import rows the old link had already seen, because duplicate checks are per remote account.

How it was built

How data flows in A CSV export goes through a per-bank profile and a daily SimpleFIN sync joins it at the normalize step. Rows are fingerprinted, checked against the account, previewed, committed as an import batch, and then stored as transactions for transfer, refund and recurring checks. CSV exportone file per bank SimpleFIN syncdaily, scheduled Bank profilecolumns and signs Normalizedate · signed cents · USD · description SHA-256 fingerprintaccount · date · amount · description Already on this account?yes: reported as a duplicate, not stored Previewnew · duplicate · invalid, then confirm Import batchundo archives the whole batch Transactionsthen transfer, refund, recurring checks
How data flows in: two sources, one provenance-tracked store, and an idempotent path for both. Redrawn from the README’s “How data flows in” diagram.
Who can see which account Two household members each ask the same visibility layer. A private account is visible only to its owner, a co-owned account belongs to the household, and a lent account stays owned by the lender. Member Aasks as themselves Member Basks as themselves visible_to(person)the one layer every query goes through Privateowner only Co-ownedthe household’s Lentlender owns
The access model, simplified. Private accounts are invisible to everyone else, co-owned ones pass to a remaining member if the owner leaves, and lent ones revert to private if the lender leaves.

Shape of the system

Four Docker Compose services on a home server: the Django app, a background worker for the bank sync, a nightly backup job and PostgreSQL. The app binds to localhost and is published only to the private Tailscale network, which terminates HTTPS. Uploaded CSVs are staged on a memory-backed filesystem and deleted after use. Integrity rules live in the schema as well as in code: check constraints reject invalid account scopes, non-USD currency and more than one open household membership.

Where AI agents did the work, and what I decided

AI coding agents implemented the project under my direction, issue by issue. Product decisions are written into the requirements doc before code is written, and each change is one pull request tied to a specified issue with acceptance criteria.

  • I made the owner-confirmed calls recorded in the stack doc: Python, PostgreSQL and server-rendered pages, plus later product decisions such as Google sign-in alongside passwords. Where the agent recommended instead, the doc says so and leaves the choice open to correction.
  • Agents work in isolated git worktrees and never merge. Each pull request runs the test suite, an automated review and the SonarCloud quality gate. Findings are fixed until the checks are clean, and then I review and merge.

What’s proven so far

Results

  • Built for a two-person household and running on a home server.
  • The pytest suite runs on in-memory SQLite and on PostgreSQL, the production engine, on every pull request and push to main, which also checks migrations on an empty database.
  • A SonarCloud quality gate runs in CI on every pull request, including coverage on new code.

Limits

  • Built for two users on one home server, so nothing here shows how it behaves at larger scale.
  • USD only, and no de-duplication across formats: the same activity imported as CSV and as OFX can double up.
  • Investment activity is not yet interpreted, so investment accounts are partial in the cash-flow views.
  • The bank-specific importers are verified against file shapes and synthetic fixtures, because real exports are never shared.

Next

  • Define what verified investment activity means, so it can count in the totals.

Source and docs

There is no live demo and no screenshots, on purpose: the data is a household’s finances. The repo ships a synthetic fixture instead.

Back to the homepage summary