Hi everyone! 👋
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 FinanceMate, an open-source, offline-first personal expense tracker.
🔗 Project Links
- GitHub (Flutter Frontend): github.com/tirtho666/FinanceMate
- GitHub (Node.js/PostgreSQL Backend): github.com/tirtho666/FinanceMate-Backend
- Live Launch on Product Hunt: View FinanceMate on Product Hunt
- Android APK (Latest Release): Download on GitHub
🏗️ How I Architected It
1. Moving from BaaS to a Custom Node.js + PostgreSQL Backend
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 Node.js, Express, and PostgreSQL (hosted on Neon & Render), giving me complete control over relational transaction records and authentication.
2. Offline-First Sync with SQLite (sqflite)
An expense tracker has to be instant—you shouldn't have to wait for a network spinner while standing at a checkout counter.
- Local-First Writes: Every new transaction or deletion is written immediately to a local SQLite database so the UI updates with zero latency.
- Background Sync: Pending operations are tracked locally and synced automatically to the PostgreSQL REST API once connectivity is restored, preventing duplicate entries or stale balance calculations.
3. Clean Architecture in Flutter
To keep the codebase maintainable as features grew, I structured the Flutter app strictly around Clean Architecture:
-
Presentation Layer: Built with
Providerfor predictable state updates across the dashboard, transaction history, and category pickers. - Domain Layer: Pure Dart entities and use cases independent of any UI or database package.
-
Data Layer: Repositories that coordinate between the local
sqflitedata source and the remote REST API client.
4. Dual-Layer Security
-
Cloud Security: Protected all REST endpoints using
bcryptpassword hashing and 30-day JWT tokens, ensuring users can only query or delete their own records. -
Device Security: Added an optional local App Lock that stores a SHA-256 hash via
flutter_secure_storagerather than saving raw credentials on the device.
💬 I’d Love Your Feedback & Questions!
I built FinanceMate to solve a real daily problem, and I’m actively improving it. I’d really appreciate your thoughts in the comments:
- Architecture & Sync: How do you handle offline-first conflict resolution or background queue retries in your Flutter apps?
- Feature Suggestions: What features would make this expense tracker genuinely useful for your daily workflow (e.g., recurring budgets, CSV/PDF export, multi-account wallets)?
- Questions: 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!
Both the frontend and backend repositories are completely open-source—if you find the codebase helpful, a star on GitHub means a lot! ⭐
Top comments (0)