How juanmedina100/mi_cora works
Project Type and Purpose
• This is a cross-platform Flutter application (“Mi Cora”) targeting Android, iOS, Web and desktop (Windows, Linux, macOS).
• It appears to be a personal finance/transaction-tracking app: users add transactions, view history and filtered data, stored locally.
File-Structure Analysis
• Top-level Flutter folders: android/, ios/, windows/, linux/, macos/, web/ – auto-generated platform hosts.
• lib/
• models/: domain entities (CategorieModel, TransactionModel, TransactionFiltered, TransactionModelInsert)
• providers/: state-management (TransactionsProvider using Provider package)
• services/: persistence & business logic (CoraDatabase for SQLite, ServiceTransacciones for CRUD)
• screens/: UI pages organized by function (home, add, history)
• widgets/: reusable UI components
• utils/: helper functions
• app_main.dart & main.dart: app bootstrap and routing.
• test/: placeholder for widget tests.
• pubspec.yaml: dependencies (Flutter SDK, provider, sqflite or similar).
a. Presentation Layer
• Screens (HomeScreen, AddScreen, HistoryScreen)
• Widgets (HistoryHorizontal, HistoryVertical, NoDataAvailable)
b. State Management
• TransactionsProvider
c. Data Layer
• ServiceTransacciones (business logic)
• CoraDatabase (SQLite wrapper)
d. Domain Layer
• Models (TransactionModel, CategorieModel, etc.)
e. Platform Hosts (Android, iOS, Web, Desktop runners)
Relationships & Data Flow
• User taps in a Screen → Screen invokes a method on TransactionsProvider.
• TransactionsProvider calls ServiceTransacciones to perform add/read/update/delete.
• ServiceTransacciones interacts with CoraDatabase (SQL queries) to persist/fetch raw data.
• Database returns rows → ServiceTransacciones maps rows to Model objects.
• Provider updates its state (List<TransactionModel>), notifies listeners.
• Screen rebuilds, renders updated Widgets.
Architectural Patterns & Principles
• Layered architecture: Presentation → State → Service → Persistence
• Separation of concerns: UI only handles rendering; business logic in services; state in providers; data in database class.
• Provider pattern for reactive state management.
Elements
• Component labels (e.g., “HomeScreen”, “TransactionsProvider”, “CoraDatabase”)
• Interfaces/APIs (e.g., “Future<List<TransactionModel>> getAllTransactions()”)
Detail Level
• Within Services, show two subcomponents: ServiceTransacciones and CoraDatabase.
• Within lib/models, list key model classes.