How nafishahmeddev/fintracker works
Main Components
• User Interface (Presentation Layer): Represented by the Flutter “screens” (home, accounts, categories, onboard, settings, etc.) and various widgets (buttons, dialogs, currency displays). This layer is where users interact, and it is organized into directories like lib/screens and lib/widgets.
• Business Logic Layer: This is implemented using the BLoC pattern as seen in the lib/bloc folder (especially the cubit and events). This layer handles state management, event processing, and orchestration between the UI and the data layer.
• Data Access Layer: The lib/dao and lib/model directories alone with migration helpers (lib/helpers/migrations) indicate that data persistence is managed through DAOs for accounts, categories, and payments. There is also a database helper (lib/helpers/db.helper.dart) that suggests local database usage.
• Platform-Specific Modules: The separate folders for android, ios, linux, macos, and windows show that FinTracker is built as a cross-platform app. These modules handle native integration and deployment specifics.
Relationships and Interactions
• User actions (e.g., tapping buttons or entering expense details) from the UI trigger events.
• These events are dispatched to the Business Logic (BLoC) components which process them and decide (through state changes) what to update on the UI.
• Business Logic interacts with the Data Access Objects to read from or write to the local database/storage (using the db.helper and migration helpers to manage schema changes).
• UI components then refresh based on updated state and data provided back by BLoC.
– From “UI Layer (Screens/Widgets)” to “BLoC (Cubit/Events)”
– From “BLoC” to “Data Access/DAO” and vice versa.
Architectural Patterns & Design Principles
• The app uses the Flutter framework following the BLoC (Business Logic Component) pattern, which promotes a reactive and event-driven design.
• There is a clear separation of concerns: the UI is decoupled from business logic, and data access is isolated behind DAOs. This modularity supports maintainability and testability.
• The multi-platform support indicates that while the core logic is shared, there are platform-specific wrappers and configurations.