Frederick Garcia
← Back to Home

PayLend

PayLend is a Premium Offline-First mobile application designed for comprehensive management of loans, collections, and finances, built with Flutter. It guarantees that the user can operate 100% of the application without the internet, featuring seamless background synchronization.

🚀 General Idea

The system is built on strict Clean Architecture principles and an Offline-First strategy. It utilizes an advanced bidirectional synchronization engine and a high-precision financial engine (using decimal and rational numbers to prevent floating-point errors) for exact French System calculations, principal payments, and amortizations.

🛠 Technologies Used

  • Framework & UI: Flutter (SDK ^3.11.4) featuring a “Dark Premium” design
  • State Management: flutter_riverpod (riverpod_annotation)
  • Navigation & Deep Linking: go_router
  • Local Database: drift (SQLite) with complex relational queries and reactive streams
  • Backend & Cloud Synchronization: supabase_flutter (Auth, PostgreSQL, Storage, RPCs)
  • High-Precision Math: decimal and rational libraries
  • Security & Authentication: Hybrid authentication (google_sign_in, sign_in_with_apple), and biometrics with local_auth
  • Internationalization (i18n): easy_localization (Supports English, Spanish, German, French, Haitian Creole, Italian, and Portuguese)
  • Reporting & Export: pdf, printing, csv, and share_plus
  • Charts & Business Intelligence: fl_chart for visual dashboards and projections
  • Subscriptions: purchases_flutter (RevenueCat)
  • Telemetry & Stability: firebase_analytics and firebase_crashlytics

📦 Data Models

The relational schema maps 1 to 1 to credit operations:

  • Clients: id, firstName, lastName, phone, identityDocument
  • Loans: id, clientId, principalAmount, interestRate, termMonths, paymentFrequency
  • Installments: id, loanId, installmentNumber, dueDate, amountDue, status, paidAt
  • Payments: Atomic and immutable records (id, installmentId, amount, principalAmount, interestAmount, paymentDate)
  • Services: Catalog of additional charges
  • Sync Queue (SyncQueue): Offline operation metadata for synchronization (targetTable, operation, recordId, payload)

🏗 Architecture & Structure

  • Bidirectional Synchronization (Offline-First): Employs the Outbox Pattern, saving mutations in a queue table (SyncQueue) and utilizing Isolates for background downloads without blocking the UI.
  • High-Precision Financial Engine: Mathematical calculations using absolute precision libraries, avoiding fractional errors native to SQLite/Dart.
  • Business Intelligence (BI) Module: Risk scoring engine (PayLend Score) with A-F grades and interactive cash flow projections.

🔒 Security & Best Practices

  • Right to be Forgotten: Rigorous process to permanently delete accounts and purge stored data.
  • Biometric Protection: Access restricted by Face ID / Touch ID, with an intelligent fallback to PIN.
  • Soft Deletion: deleted_at column to prevent data re-hydration and manage offline deletions, supported by a scheduled Garbage Collector in Supabase (pg_cron).
  • Magic Authentication: Passwordless access with Magic Links, alongside native social integrations.