How to Build an Expense Tracker App
Expense trackers die when entering expenses becomes a chore. Fast manual entry, bank statement imports and rules that categorize for you are what keep them alive.
Key takeaways
- Store money as integer cents with a currency code. Floating point amounts eventually produce totals that are off by a cent.
- CSV import with duplicate detection and categorization rules does most of the work; live bank connections can wait.
- A budget is a target per category per month. The screen people check is "how much is left", not a pie chart.
To build an expense tracker app, you need accounts, transactions (date, amount, payee, category), categories with monthly budgets, and a quick way to get transactions in: fast manual entry plus import from bank statement files. Rules that categorize imported transactions automatically, and a screen that shows how much is left in each budget this month, turn it from a spreadsheet into something people open every day.
Whose money, and for what
Expense trackers come in a few flavors: personal budgeting, a couple or household sharing a budget, freelancers separating business expenses for taxes, and small teams collecting expense claims. The household version adds members and "who paid"; the freelancer version adds receipts and tax categories; the team version adds approvals. Choose one. A shared household budget for couples is a well-defined, underserved first product.
The data model
- households (or workspaces) and members: who shares the budget, with roles.
- accounts: household id, name ("Joint checking", "Visa"), type (checking, savings, credit card, cash), currency, and opening balance.
- transactions: account id, date, amount in integer cents (negative for spending, positive for income), currency, payee as written by the bank, a cleaned payee name, category id, note, who paid, a receipt path, the import batch it came from, and a fingerprint for duplicate detection.
- categories: household id, name, group (Bills, Everyday, Fun, Savings), icon, and whether it counts as spending.
- budgets: category id, month, and the planned amount in cents.
- rules: household id, a match (payee contains "TESCO"), the category to apply, and an optional cleaned payee name.
- import_batches: file name, account, imported count, skipped duplicates, created date and who imported it, so an import can be undone in one step.
Money as integer cents is non-negotiable. Decimal fractions like 0.1 cannot be stored exactly in floating point, and summing thousands of transactions drifts. Store 1999 for 19.99 and format only for display. Transfers between your own accounts (paying the credit card from checking) are two linked transactions with a transfer flag, excluded from spending totals so they are not counted twice.
Imports that do not create a mess
Almost every bank lets customers download transactions as CSV, and many also offer OFX or QIF formats. CSV import is the most valuable feature you can build, and also the easiest to get wrong:
- 01Column mapping: every bank names columns differently. Show the first rows, let the user map date, description and amount (or separate debit and credit columns), and remember the mapping per account.
- 02Date and number formats: 03/04 is March 4 in the US and April 3 in most of Europe; 1.234,56 is a European amount. Detect from the data where possible and ask when ambiguous.
- 03Sign conventions: some banks show spending as negative, some as a positive debit. Let the user flip it per account.
- 04Duplicates: build a fingerprint from account, date, amount and the bank's description, and skip rows already imported. Overlapping downloads are normal.
- 05Rules: apply categorization rules on import, and mark anything left uncategorized for review.
- 06Undo: every import is a batch that can be deleted as one unit.
Run the parsing and duplicate check on the server (an edge function) so the rules are the same on every device. Rules can be learned: when the user categorizes "BLUE BOTTLE 0423" as Coffee, offer to create a rule for future Blue Bottle transactions.
Budgets people actually check
Each month, each category has a planned amount. The main screen shows each category with spent so far, the budget and what is left, as a bar that fills up. Sort by most nearly overspent, or by group. Add two details that make budgets feel humane: roll unspent money forward (or not) as a per-category choice, and copy last month's budget as the starting point so planning takes a minute.
Reports come second: spending by category this month versus last month and the average, a monthly trend over a year, and income versus spending. A simple weekly digest email ("you have 140 left for groceries with 9 days to go") keeps people engaged without opening the app; a Startbase Cloud scheduled job can send it every Sunday. See Jobs.
Privacy and security
Financial data deserves strict rules. With Startbase Cloud, the agent turns on row-level security on each table it creates; in your brief, say that every table is scoped to the household and readable only by its members, then test it with an account outside the household. Receipts go in a private storage bucket served through signed links. Never ask users for their online banking passwords, ever. The publish step runs a security check for leaked keys and tables without row-level security, and you can run deeper scans from the Backend tab; see Security. For general guidance, read is AI-generated code safe.
The screens
- 01Budget: categories with spent, budget and left for the month, and a month switcher.
- 02Transactions: a list by date with search and filters, uncategorized ones highlighted, swipe to categorize.
- 03Add expense: amount first with a number pad, then category from recent ones, then optional payee and note. Under five seconds.
- 04Import: choose account, upload file, map columns, preview with duplicates marked, confirm.
- 05Rules: list, edit, test against past transactions.
- 06Reports and Settings (accounts, categories, household members, currency).
What to leave out of version one
- Live bank connections.
- Multiple currencies with exchange rates. Support one currency per household at first.
- Investment tracking and net worth.
- Receipt scanning with automatic data extraction. Attaching a photo is enough at first.
- Bill splitting between friends, which is a different app.
A brief you can paste
Build a shared budget app for couples. Users sign in with email or Google and create or join a household by invite. Accounts (checking, savings, credit card, cash) and transactions with date, amount stored as integer cents, payee, cleaned payee, category, note, who paid and an optional receipt photo in a private bucket. Transfers between own accounts are linked and excluded from spending. CSV import per account: preview rows, map columns, remember the mapping, handle DD/MM and MM/DD dates and debit or credit columns, skip duplicates by a fingerprint of account, date, amount and description, apply payee rules, and save each import as a batch that can be undone. When I categorize a transaction, offer to create a rule. Monthly budgets per category with spent, budget and left bars, sorted by most nearly overspent, copy last month, optional rollover. Reports: by category this month versus last and a 12-month trend. Weekly Sunday email with what is left per category. All data visible only to household members.
Test the importer with real statement files from two different banks before anything else; that is where the bugs live. If you are building this for a small business rather than a household, the business use case and the internal tools guide show the adjacent ground. Before inviting strangers, run through the app security checklist.
Frequently asked questions
How should an expense tracker store money?
As integer cents with a currency code, for example 1999 for 19.99. Floating point numbers cannot represent many decimal amounts exactly, so totals drift over thousands of transactions.
How do expense apps import bank transactions?
The simplest way is uploading the CSV or OFX file a bank lets you download, mapping its columns once and skipping duplicates. Live connections use paid aggregator services that link to banks directly.
How do expense trackers categorize transactions automatically?
With rules that match the payee text, such as "description contains TESCO means Groceries", applied on import. Many apps learn rules by offering to create one whenever the user categorizes a transaction.
How do I avoid duplicate transactions when importing?
Create a fingerprint from the account, date, amount and the bank's description for each row, and skip rows whose fingerprint already exists. Keep each import as a batch so a bad one can be undone.
