Menu

1 / 5

Money in SQLite: building an offline-first expense tracker with Expo

DEV Community: reactnative·Kasim Rangwala·2 days ago
#xZeCTocU
#devtoreactnative#devto#dev#migration#version
Reading 0:00
15s threshold

Most expense trackers treat your spending history as a server-side asset. You sign up, the app syncs, and the ledger lives somewhere you cannot see. I wanted the opposite: the ledger is a SQLite file on the phone, and the app is a reader and writer for it.

That constraint changes the design. This post covers the four decisions that mattered most while building Spendwise, a local-first expense tracker for Android: how money is stored, how the schema evolves, how reads stay scoped, and how exports work without a spreadsheet dependency.

1. Money never touches a float

The single rule that prevents most finance bugs: money is an integer in minor units . A coffee is 350 , not 3.5 . Currency decimals come from a table, because not every currency has two:

export function parseAmountToMinor ( amount : string , currencyCode : CurrencyCode ) : number { if ( amount .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.