How armanmaurya/balancr works
Project Type and Purpose
• Type: Cross-platform mobile & desktop application built with Flutter.
• Purpose: Manage shared expenses—add members, track transactions, view balances, and settle up.
File Structure
• Top-Level Folders
• android, ios, linux, macos, windows, web → platform-specific shell projects
• lib → core Dart code (UI, business logic, data models)
• .github/workflows → CI/CD definitions
• Inside lib/
• models → Person & Transaction classes, generated code (e.g. JSON serialization)
• providers → LedgerProvider (state-management/business logic)
• screens → UI pages (home, onboarding, add/search person, transactions)
• widgets → reusable UI controls (buttons, cards, lists, bottom sheets, inputs)
• Configuration Files
• pubspec.yaml/lock → dependencies (Flutter SDK, provider, build_runner, json_serializable, local-storage plugin)
• CI workflow → automated builds/releases
Key Insights from README
• Uses Flutter ≥3.29.2
• Core features: expense/member management, balance overview, settle-up
• No remote server—assumed local persistence (e.g., SQLite or Hive)
Main Components and Their Interactions
a. Platform Shells
• Android, iOS, macOS, Windows, Linux, Web projects serve as native wrappers for the Flutter Engine.
b. Flutter Engine & Dart Runtime
• The common runtime hosting UI and business logic across platforms.
c. Presentation Layer (UI)
• Screens: onboarding, home, add/search person, transaction
• Widgets: cards, buttons, lists, inputs, modals
d. Business Logic Layer
• LedgerProvider (Provider pattern): orchestrates state, exposes methods to add/edit persons & transactions, computes balances
e. Data Layer
• Models: Person & Transaction classes with JSON (de)serialization
• Local Persistence: plugin (SQLite, Hive, or similar) for storing/fetching model instances
f. CI/CD
• GitHub Actions workflow for testing, building, and releasing across platforms
Architectural Patterns & Design Principles
• Layered Architecture: clear separation between UI, business logic, and data
• Provider Pattern: for state management & dependency injection
• MVVM-style separation (Views in screens/widgets, ViewModel in providers)
• Code Generation: for model serialization (.g.dart files)
• Cross-Platform Abstraction: shared Dart code + platform channels/plugins
Putting It All Together
• Center: Flutter Engine hosting
• Presentation Layer (Screens → Widgets → Assets)
• Business Logic Layer (LedgerProvider)
• Data Layer (Models → Local DB)
• Right side: CI/CD pipeline (GitHub Actions)
• External Plugins: path_provider, sqflite/hive, device_info – connect to Flutter Engine or directly to data layer