<?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: Tirtho Dhar</title>
    <description>The latest articles on DEV Community by Tirtho Dhar (@tirtho666).</description>
    <link>https://dev.to/tirtho666</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%2Fuser%2Fprofile_image%2F4280450%2Fcc5f0650-8bb4-45f1-9c68-a3f8f44783e1.png</url>
      <title>DEV Community: Tirtho Dhar</title>
      <link>https://dev.to/tirtho666</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tirtho666"/>
    <language>en</language>
    <item>
      <title>How I Built an Offline-First Personal Expense Tracker with Flutter, Node.js, and PostgreSQL (Open Source)</title>
      <dc:creator>Tirtho Dhar</dc:creator>
      <pubDate>Thu, 03 Dec 2026 12:28:21 +0000</pubDate>
      <link>https://dev.to/tirtho666/how-i-built-an-offline-first-personal-expense-tracker-with-flutter-nodejs-and-postgresql-open-2c9o</link>
      <guid>https://dev.to/tirtho666/how-i-built-an-offline-first-personal-expense-tracker-with-flutter-nodejs-and-postgresql-open-2c9o</guid>
      <description>&lt;p&gt;Hi everyone! 👋&lt;/p&gt;

&lt;p&gt;Most personal expense trackers either lock basic features behind subscriptions or break down the moment you lose internet connection. To solve this for myself—and share a clean full-stack reference for fellow developers—I built &lt;strong&gt;FinanceMate&lt;/strong&gt;, an open-source, offline-first personal expense tracker.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔗 Project Links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub (Flutter Frontend):&lt;/strong&gt; &lt;a href="https://github.com/tirtho666/FinanceMate" rel="noopener noreferrer"&gt;github.com/tirtho666/FinanceMate&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub (Node.js/PostgreSQL Backend):&lt;/strong&gt; &lt;a href="https://github.com/tirtho666/FinanceMate-Backend" rel="noopener noreferrer"&gt;github.com/tirtho666/FinanceMate-Backend&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live Launch on Product Hunt:&lt;/strong&gt; &lt;a href="https://www.producthunt.com/products/financemate" rel="noopener noreferrer"&gt;View FinanceMate on Product Hunt&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Android APK (Latest Release):&lt;/strong&gt; &lt;a href="https://github.com/tirtho666/FinanceMate/releases/latest" rel="noopener noreferrer"&gt;Download on GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🏗️ How I Architected It
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Moving from BaaS to a Custom Node.js + PostgreSQL Backend
&lt;/h4&gt;

&lt;p&gt;Initially, I prototyped the app using Firebase, but I wanted full ownership over the data schema, custom query logic, and predictable hosting without usage-based surprises. I migrated the backend to a custom REST API built with &lt;strong&gt;Node.js, Express, and PostgreSQL&lt;/strong&gt; (hosted on Neon &amp;amp; Render), giving me complete control over relational transaction records and authentication.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Offline-First Sync with SQLite (&lt;code&gt;sqflite&lt;/code&gt;)
&lt;/h4&gt;

&lt;p&gt;An expense tracker has to be instant—you shouldn't have to wait for a network spinner while standing at a checkout counter.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Local-First Writes:&lt;/strong&gt; Every new transaction or deletion is written immediately to a local &lt;strong&gt;SQLite&lt;/strong&gt; database so the UI updates with zero latency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Background Sync:&lt;/strong&gt; Pending operations are tracked locally and synced automatically to the PostgreSQL REST API once connectivity is restored, preventing duplicate entries or stale balance calculations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. Clean Architecture in Flutter
&lt;/h4&gt;

&lt;p&gt;To keep the codebase maintainable as features grew, I structured the Flutter app strictly around &lt;strong&gt;Clean Architecture&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Presentation Layer:&lt;/strong&gt; Built with &lt;code&gt;Provider&lt;/code&gt; for predictable state updates across the dashboard, transaction history, and category pickers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Domain Layer:&lt;/strong&gt; Pure Dart entities and use cases independent of any UI or database package.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Layer:&lt;/strong&gt; Repositories that coordinate between the local &lt;code&gt;sqflite&lt;/code&gt; data source and the remote REST API client.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  4. Dual-Layer Security
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Security:&lt;/strong&gt; Protected all REST endpoints using &lt;code&gt;bcrypt&lt;/code&gt; password hashing and 30-day &lt;strong&gt;JWT&lt;/strong&gt; tokens, ensuring users can only query or delete their own records.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Device Security:&lt;/strong&gt; Added an optional local &lt;strong&gt;App Lock&lt;/strong&gt; that stores a &lt;strong&gt;SHA-256&lt;/strong&gt; hash via &lt;code&gt;flutter_secure_storage&lt;/code&gt; rather than saving raw credentials on the device.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  💬 I’d Love Your Feedback &amp;amp; Questions!
&lt;/h3&gt;

&lt;p&gt;I built &lt;strong&gt;FinanceMate&lt;/strong&gt; to solve a real daily problem, and I’m actively improving it. I’d really appreciate your thoughts in the comments:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Architecture &amp;amp; Sync:&lt;/strong&gt; How do you handle offline-first conflict resolution or background queue retries in your Flutter apps?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Feature Suggestions:&lt;/strong&gt; What features would make this expense tracker genuinely useful for your daily workflow (e.g., recurring budgets, CSV/PDF export, multi-account wallets)?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Questions:&lt;/strong&gt; If you’re migrating from Firebase to a custom Node.js + PostgreSQL stack and have questions about the setup or Clean Architecture structure, feel free to ask below!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Both the frontend and backend repositories are completely open-source—if you find the codebase helpful, a star on GitHub means a lot! ⭐&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>opensource</category>
      <category>node</category>
      <category>postgres</category>
    </item>
  </channel>
</rss>
