<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Spendwise</title>
    <description>The latest articles on DEV Community by Spendwise (getspendwise).</description>
    <link>https://dev.to/getspendwise</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F16126%2F5d8ccb19-e0d4-45da-a3ea-cb8b12746119.png</url>
      <title>DEV Community: Spendwise</title>
      <link>https://dev.to/getspendwise</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/getspendwise"/>
    <language>en</language>
    <item>
      <title>Money in SQLite: building an offline-first expense tracker with Expo</title>
      <dc:creator>Kasim Rangwala</dc:creator>
      <pubDate>Sun, 15 Nov 2026 11:12:56 +0000</pubDate>
      <link>https://dev.to/getspendwise/money-in-sqlite-building-an-offline-first-expense-tracker-with-expo-2o2</link>
      <guid>https://dev.to/getspendwise/money-in-sqlite-building-an-offline-first-expense-tracker-with-expo-2o2</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;That constraint changes the design. This post covers the four decisions that mattered most while building Spendwise, a local-first &lt;a href="https://spendwise.download/" rel="noopener noreferrer"&gt;expense tracker&lt;/a&gt; for Android: how money is stored, how the schema evolves, how reads stay scoped, and how exports work without a spreadsheet dependency.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Money never touches a float
&lt;/h2&gt;

&lt;p&gt;The single rule that prevents most finance bugs: &lt;strong&gt;money is an integer in minor units&lt;/strong&gt;. A coffee is &lt;code&gt;350&lt;/code&gt;, not &lt;code&gt;3.5&lt;/code&gt;. Currency decimals come from a table, because not every currency has two:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;parseAmountToMinor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;currencyCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;CurrencyCode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'-'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;AppError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'VALIDATION_ERROR'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'errors.invalidAmount'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;decimals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getCurrencyDecimals&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;currencyCode&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;parseFloat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;normalizeAmountInput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;decimals&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isFinite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;AppError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'VALIDATION_ERROR'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'errors.invalidAmount'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="n"&gt;decimals&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Number.parseFloat&lt;/code&gt; appears here exactly once, at the boundary where text becomes a number, and the result is immediately rounded to an integer. Every sum, budget comparison and balance after that is integer arithmetic. &lt;code&gt;0.1 + 0.2&lt;/code&gt; never enters the ledger.&lt;/p&gt;

&lt;p&gt;The other half is input normalization. The decimal keypad follows the device locale, so &lt;code&gt;12,50&lt;/code&gt; arrives as often as &lt;code&gt;12.50&lt;/code&gt;, and an Arabic or Persian keypad types its own digits and separators. Stripping commas — the obvious fix — turned &lt;code&gt;12,50&lt;/code&gt; into &lt;code&gt;1250&lt;/code&gt;, a 100× error. The parser caches the locale's grouping and decimal separators from &lt;code&gt;Intl.NumberFormat().formatToParts()&lt;/code&gt; and strips only the grouping character.&lt;/p&gt;

&lt;p&gt;Rejecting the minus sign before cleaning is deliberate too. A negative amount is not a valid transaction in this app; if the sign is silently dropped, a refund becomes an expense.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Migrations are a list, not a diff
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;expo-sqlite&lt;/code&gt; gives you &lt;code&gt;openDatabaseAsync&lt;/code&gt;, &lt;code&gt;execAsync&lt;/code&gt; and prepared statements. It does not give you a migration framework. The whole mechanism is a version table and an ordered array:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;runMigrations&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;SQLite&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SQLiteDatabase&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`
    CREATE TABLE IF NOT EXISTS schema_migrations (
      version INTEGER PRIMARY KEY NOT NULL
    );
  `&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getFirstAsync&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s1"&gt;'SELECT MAX(version) as version FROM schema_migrations'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;currentVersion&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;migration&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;migrations&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;migration&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;currentVersion&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;migration&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;up&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;runAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'INSERT INTO schema_migrations (version) VALUES (?)'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;migration&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each migration is a module exporting &lt;code&gt;version&lt;/code&gt; and &lt;code&gt;up&lt;/code&gt;. They are imported and listed in &lt;code&gt;client.ts&lt;/code&gt; in order — the list is the source of truth, not the filesystem. That catches the class of bug where a bundled app cannot enumerate its own assets and silently skips a migration.&lt;/p&gt;

&lt;p&gt;Two rules keep this safe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Never edit a released migration.&lt;/strong&gt; Add a new numbered one. An app on someone's phone already ran the old body; changing it means two users have two different schemas with the same version number.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One database handle.&lt;/strong&gt; A module-level singleton with an &lt;code&gt;initPromise&lt;/code&gt; guard means concurrent callers during startup wait for the same migration run instead of racing it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The schema is ordinary SQLite: transactions, categories, budgets, recurring rules, people, groups, attachments. Nothing exotic, which is the point — the queries are portable, and the data can be read with any SQLite browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Scoping needs one predicate, not one per query
&lt;/h2&gt;

&lt;p&gt;Once groups exist — a trip, a shared household — every scoped table has a nullable &lt;code&gt;group_id&lt;/code&gt;. The app-level context is &lt;code&gt;NULL&lt;/code&gt;, meaning "not in a group". The trap follows immediately:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;transactions&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;group_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;-- never matches NULL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;= NULL&lt;/code&gt; is never true in SQL, so a scoped read written with &lt;code&gt;=&lt;/code&gt; silently returns nothing for the app-level ledger, and a read that forgets the predicate silently returns every group's rows. Both failures are quiet, which is the worst kind.&lt;/p&gt;

&lt;p&gt;The fix is a single helper that every repository uses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;scopeFilter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;column&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;groupId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;GroupScope&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;ScopeFilter&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;groupId&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;
    &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;sql&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`${column} IS NULL`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;sql&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`${column} = ?`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;groupId&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It returns SQL plus the params to bind, in order, so callers compose rather than concatenate. The column name is always a literal written in the repository layer — never user input. Reads take &lt;code&gt;groupId: GroupScope = null&lt;/code&gt;, so an existing app-level call keeps its meaning and a group read is opt-in at the call site.&lt;/p&gt;

&lt;p&gt;The rule that makes this stick: &lt;strong&gt;no hand-written scope predicates&lt;/strong&gt;. If a repository needs one, it calls the helper. Reviewing a diff for &lt;code&gt;group_id&lt;/code&gt; used without it is mechanical, which is exactly what you want in the one place a mistake leaks another context's data.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Exports: self-contained PDF, hand-written XLSX
&lt;/h2&gt;

&lt;p&gt;Two export paths, both built on the same data model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PDF&lt;/strong&gt; goes through &lt;code&gt;expo-print&lt;/code&gt;, which renders a self-contained HTML document with the platform's own engine. Every currency symbol the app supports prints correctly without embedding a font, and the file needs no network. The charts are drawn inline in HTML rather than reusing the on-screen &lt;code&gt;react-native-svg&lt;/code&gt; charts, because a print document cannot share a native view tree.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;XLSX&lt;/strong&gt; was the interesting one. An &lt;code&gt;.xlsx&lt;/code&gt; is a ZIP of XML parts. A spreadsheet library is roughly a megabyte of dependency for one export button, so the app builds the parts it needs — workbook, styles, one sheet per report table — and writes the ZIP itself with stored (uncompressed) entries.&lt;/p&gt;

&lt;p&gt;Two details that decide whether Excel opens the result:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Control characters are not legal in XML 1.0. Notes are free text and can carry anything, so they are stripped from every cell rather than trusted.&lt;/li&gt;
&lt;li&gt;Money is written as a plain decimal string from the formatter (&lt;code&gt;minorToDisplayAmount&lt;/code&gt;), flagged numeric, never as a float computed on the way out. The formatting layer is the only place integer minor units become &lt;code&gt;12.50&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result is a few hundred lines, no native module, and the same content as the PDF.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this buys, and what it costs
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Buys:&lt;/strong&gt; the app works in airplane mode, the first launch has no signup, and backing up means keeping a file. There is no server to breach and no sync conflict to resolve.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Costs:&lt;/strong&gt; multi-device sync is a feature you have to build deliberately, not something the database gives you. Device loss is real unless the user exports or backs up. And every schema change needs a migration that runs correctly on an old database — the cost is paid per release, not once.&lt;/p&gt;

&lt;p&gt;For a personal finance app, the trade is worth it. The ledger is the product; it should live where the user can see it.&lt;/p&gt;

&lt;p&gt;If you want to see the result, Spendwise is &lt;a href="https://play.google.com/store/apps/details?id=com.gripxtech.spendwise&amp;amp;hl=en_US" rel="noopener noreferrer"&gt;free on Google Play&lt;/a&gt;. I write about the internals when something is worth sharing; the &lt;a href="https://spendwise.download/blog/why-local-first" rel="noopener noreferrer"&gt;local-first article on the site&lt;/a&gt; goes deeper on the data model.&lt;/p&gt;

&lt;p&gt;Questions about the migration runner or the scope helper are welcome in the comments — especially if you have hit the &lt;code&gt;= NULL&lt;/code&gt; bug in your own schema.&lt;/p&gt;

</description>
      <category>android</category>
      <category>reactnative</category>
      <category>sqlite</category>
      <category>expo</category>
    </item>
  </channel>
</rss>
