PTCV

The backend of a finance app I do not have to feed by hand

The API behind my own finance app, web and mobile. Transactions come straight from the bank, categories fill themselves in, and a language model reads the month for me.

contextI tried many finance apps and never got used to any of them. So I built mine, and I use it with my real money.

bankOpen Financeimport · dedupewho picks the category, in this order1me2rules3history4AIAI only sees what is left overledgerexact money · insights
illustration, not a screenshot
the problem

Every app I tried asked me to type in data every day, and I do not keep that up for long. So the rule for mine was that the data arrives on its own: transactions come from the bank through Open Finance, categories are assigned without me, and the analysis I would never sit down to do is written by a language model. The backend exists to serve that, and to keep the money exact while doing it.

architecture
bankOpen Finance · Pluggy
API · FastAPIimport · rules · ledger · insights
PostgreSQLAlembic migrations
web · mobileReact · Expo

Every record belongs to a financial space, and every request checks the caller's membership in that space before touching data. Money travels as decimal strings in JSON, never as floats. Language models are an integration per user, with DeepSeek, OpenAI, Anthropic and Ollama Cloud supported.

decisions

What I chose, and what it cost

Bank data goes through the same door as a statement file

A bank sync is converted into the same import batch as an OFX or CSV statement. So it gets the same deduplication, the same category rules, the same card bill logic and the same undo. The cost: the sync can do nothing the importer cannot.

Who picks the category: me, then rules, then history, then AI

Whatever a rule resolves never reaches a model, so AI only sees what is left over. The cost: the rule matching exists twice, in the API and in the app's preview, and the two have to be kept identical.

The model proposes, I confirm

A model can draft a transaction from text or suggest categories in bulk, and nothing becomes a real record until I accept it. Provider keys are stored encrypted per user, not in environment variables.

One bootstrap endpoint, after the app got slow

Performance was not the goal of the project. It became work when opening the app cost nine requests and 27 queries. One endpoint now returns everything with 11 queries on a single session, and every response carries a Server-Timing header so a slow screen can be blamed on the right layer. The cost: the nine lists are not a consistent snapshot of each other, and one failed list fails the whole response.