# lucasadorno79/flutter_proyect1 architecture

> Architecture diagram of the GitHub repository lucasadorno79/flutter_proyect1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lucasadorno79/flutter_proyect1
- Repository: https://github.com/lucasadorno79/flutter_proyect1

## Overview

1. **Overall shape**
   - This is a **Flutter cross-platform app** with targets for **Android, iOS, web, Linux, and macOS**.
   - The repo is organized around a single shared Dart codebase in `lib/`, with native shell projects only handling platform bootstrapping.

2. **App entry and composition root**
   - `lib/main.dart` is the likely startup point for the Flutter app.
   - It should be the place where the app is initialized, dependencies are wired up, and the first screen/navigation flow is selected.

3. **Platform boundary layer**
   - `android/`, `ios/`, `linux/`, `macos/`, and `web/` contain the generated/native wrappers needed to launch Flutter on each platform.
   - These folders are not the business logic layer; they mainly host platform-specific startup code, manifests, build configs, icons, and launch assets.
   - Notable platform entry points include `MainActivity.kt` on Android, `AppDelegate.swift` on iOS/macOS, `MainFlutterWindow.swift` on macOS, and `web/index.html` for the browser build.

4. **Domain model layer**
   - `lib/models/` defines the app’s core entities:
     - `transaction_model.dart`
     - `fund_model.dart`
     - `category_model.dart`
     - `calendar_event.dart`
   - The naming suggests the app is centered on **transaction/fund management with categorization and calendar-based views**.

5. **Persistence/data access**
   - `lib/database/app_database.dart` is the app’s local data layer.
   - This is the boundary between UI/business logic and stored app state, likely holding records for transactions, funds, categories, and calendar-related data.

6. **Service layer**
   - `lib/services/` contains app-wide infrastructure services:
     - `auth_service.dart` for authentication/session handling
     - `notification_service.dart` for local/device notifications
     - `preferences_service.dart` for persisted user settings
   - These services sit between screens and platform capabilities or local persistence, keeping UI code thinner.

7. **Feature screens**
   - `lib/screens/` is the main presentation layer:
     - `login_screen.dart`
     - `home_screen.dart`
     - `add_transaction_screen.dart`
     - `calendar_screen.dart`
     - `reports_screen.dart`
     - `settings_screen.dart`
   - These are the primary user-facing workflows, likely mapping to login/auth, dashboarding, data entry, calendar review, reporting, and configuration.

8. **Reusable UI components**
   - `lib/widgets/` contains shared building blocks used across screens:
     - `floating_calendar.dart`
     - `summary_card.dart`
     - `transaction_tile.dart`
   - These are presentation-only components that help avoid duplicating common UI patterns across feature screens.

9. **App data flow**
   - A typical flow is: **startup in `main.dart` → auth/preferences/database initialization → screen navigation → screens read/write models through services/database → shared widgets render state**.
   - Notifications and preferences are cross-cutting concerns that influence behavior across multiple screens rather than belonging to one feature.

10. **Assets and presentation resources**
   - `assets/images/` holds app image assets.
   - Platform-specific launch icons, splash screens, and app icons are configured separately under each target directory.

11. **Testing**
   - `test/widget_test.dart` provides Flutter widget-level test coverage.
   - Native `RunnerTests` folders exist for iOS and macOS, but the primary test surface in this repo appears to be Flutter widget testing.

12. **Architecture summary for a diagram**
   - The cleanest diagram is a **layered Flutter app**:
     - **Platform shells** on the outside
     - **Shared Flutter UI** in the middle (`screens` + `widgets`)
     - **Services and database** beneath UI
     - **Models** as the shared domain contract
   - The most important boundaries are between **UI**, **app services**, and **local persistence/platform integrations**.

Main entry points: [`lib/main.dart`](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/main.dart) (Main), [`lib/screens/home_screen.dart`](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/screens/home_screen.dart) (Home), [`lib/database/app_database.dart`](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/database/app_database.dart) (Database), [`lib/screens/add_transaction_screen.dart`](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/screens/add_transaction_screen.dart) (Add Txn)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platforms["Platform shells"]
  node_android_shell["Android<br/>platform shell<br/>[MainActivity.kt]"]
  node_ios_shell["iOS<br/>platform shell<br/>[AppDelegate.swift]"]
  node_macos_shell["macOS<br/>platform shell"]
  node_web_shell["Web<br/>platform shell<br/>[index.html]"]
end

subgraph group_app["Flutter app"]
  node_main["Main<br/>flutter entrypoint<br/>[main.dart]"]
end

subgraph group_ui["Presentation"]
  node_login_screen["Login<br/>screen<br/>[login_screen.dart]"]
  node_home_screen["Home<br/>screen<br/>[home_screen.dart]"]
  node_add_transaction_screen["Add Txn<br/>screen"]
  node_calendar_screen["Calendar<br/>screen"]
  node_reports_screen["Reports<br/>screen"]
  node_settings_screen["Settings<br/>screen"]
  node_floating_calendar["Float Cal<br/>widget"]
  node_summary_card["Summary<br/>widget<br/>[summary_card.dart]"]
  node_transaction_tile["Txn Tile<br/>widget"]
end

subgraph group_data["Data layer"]
  node_auth_service["Auth<br/>[auth_service.dart]"]
  node_notification_service["Notify"]
  node_preferences_service["Prefs"]
  node_app_database[("Database<br/>local store<br/>[app_database.dart]")]
  node_transaction_model["Transaction<br/>domain model"]
  node_fund_model["Fund<br/>domain model<br/>[fund_model.dart]"]
  node_category_model["Category<br/>domain model"]
  node_calendar_event["Calendar Event<br/>domain model"]
end

node_android_shell -->|"launches"| node_main
node_ios_shell -->|"launches"| node_main
node_macos_shell -->|"launches"| node_main
node_web_shell -->|"loads"| node_main
node_main -->|"initializes"| node_auth_service
node_main -->|"initializes"| node_preferences_service
node_main -->|"opens"| node_app_database
node_main -->|"routes to"| node_login_screen
node_main -->|"routes to"| node_home_screen
node_login_screen -->|"uses"| node_auth_service
node_home_screen -->|"composes"| node_summary_card
node_home_screen -->|"composes"| node_transaction_tile
node_home_screen -->|"opens"| node_add_transaction_screen
node_home_screen -->|"opens"| node_calendar_screen
node_home_screen -->|"opens"| node_reports_screen
node_home_screen -->|"opens"| node_settings_screen
node_add_transaction_screen -->|"edits"| node_transaction_model
node_add_transaction_screen -->|"selects"| node_fund_model
node_add_transaction_screen -->|"selects"| node_category_model
node_add_transaction_screen -->|"writes"| node_app_database
node_calendar_screen -->|"composes"| node_floating_calendar
node_calendar_screen -->|"reads"| node_calendar_event
node_calendar_screen -->|"queries"| node_app_database
node_reports_screen -->|"analyzes"| node_transaction_model
node_reports_screen -->|"breaks down"| node_fund_model
node_reports_screen -->|"breaks down"| node_category_model
node_settings_screen -->|"updates"| node_preferences_service
node_settings_screen -->|"configures"| node_notification_service
node_app_database -->|"stores"| node_transaction_model
node_app_database -->|"stores"| node_fund_model
node_app_database -->|"stores"| node_category_model
node_app_database -->|"stores"| node_calendar_event
node_notification_service -.->|"triggers from"| node_calendar_event

click node_main "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/main.dart"
click node_login_screen "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/screens/login_screen.dart"
click node_home_screen "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/screens/home_screen.dart"
click node_add_transaction_screen "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/screens/add_transaction_screen.dart"
click node_calendar_screen "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/screens/calendar_screen.dart"
click node_reports_screen "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/screens/reports_screen.dart"
click node_settings_screen "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/screens/settings_screen.dart"
click node_floating_calendar "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/widgets/floating_calendar.dart"
click node_summary_card "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/widgets/summary_card.dart"
click node_transaction_tile "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/widgets/transaction_tile.dart"
click node_auth_service "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/services/auth_service.dart"
click node_notification_service "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/services/notification_service.dart"
click node_preferences_service "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/services/preferences_service.dart"
click node_app_database "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/database/app_database.dart"
click node_transaction_model "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/models/transaction_model.dart"
click node_fund_model "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/models/fund_model.dart"
click node_category_model "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/models/category_model.dart"
click node_calendar_event "https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/models/calendar_event.dart"
click node_android_shell "https://github.com/lucasadorno79/flutter_proyect1/blob/main/android/app/src/main/kotlin/com/example/cat_manager/MainActivity.kt"
click node_ios_shell "https://github.com/lucasadorno79/flutter_proyect1/blob/main/ios/Runner/AppDelegate.swift"
click node_macos_shell "https://github.com/lucasadorno79/flutter_proyect1/blob/main/macos/Runner/MainFlutterWindow.swift"
click node_web_shell "https://github.com/lucasadorno79/flutter_proyect1/blob/main/web/index.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_android_shell,node_ios_shell,node_macos_shell,node_web_shell toneBlue
class node_main toneAmber
class node_login_screen,node_home_screen,node_add_transaction_screen,node_calendar_screen,node_reports_screen,node_settings_screen,node_floating_calendar,node_summary_card,node_transaction_tile toneMint
class node_auth_service,node_notification_service,node_preferences_service,node_app_database,node_transaction_model,node_fund_model,node_category_model,node_calendar_event toneRose
```

## Components

### Platform shells

Native launch wrappers and platform entry points

- [Android](https://github.com/lucasadorno79/flutter_proyect1/blob/main/android/app/src/main/kotlin/com/example/cat_manager/MainActivity.kt): platform shell · Android bootstrap and launch wrapper · `android/app/src/main/kotlin/com/example/cat_manager/MainActivity.kt`
- [iOS](https://github.com/lucasadorno79/flutter_proyect1/blob/main/ios/Runner/AppDelegate.swift): platform shell · iOS bootstrap and launch wrapper · `ios/Runner/AppDelegate.swift`
- [macOS](https://github.com/lucasadorno79/flutter_proyect1/blob/main/macos/Runner/MainFlutterWindow.swift): platform shell · macOS bootstrap and window host · `macos/Runner/MainFlutterWindow.swift`
- [Web](https://github.com/lucasadorno79/flutter_proyect1/blob/main/web/index.html): platform shell · Browser bootstrap and host page · `web/index.html`

### Flutter app

Shared Dart application code

- [Main](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/main.dart): flutter entrypoint · App startup and composition root · `lib/main.dart`

### Presentation

Screens and reusable widgets

- [Login](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/screens/login_screen.dart): screen · Authentication entry screen · `lib/screens/login_screen.dart`
- [Home](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/screens/home_screen.dart): screen · Primary dashboard and navigation hub · `lib/screens/home_screen.dart`
- [Add Txn](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/screens/add_transaction_screen.dart): screen · Transaction creation flow · `lib/screens/add_transaction_screen.dart`
- [Calendar](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/screens/calendar_screen.dart): screen · Calendar-based review and browsing · `lib/screens/calendar_screen.dart`
- [Reports](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/screens/reports_screen.dart): screen · Reporting and summaries · `lib/screens/reports_screen.dart`
- [Settings](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/screens/settings_screen.dart): screen · User preferences and app configuration · `lib/screens/settings_screen.dart`
- [Float Cal](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/widgets/floating_calendar.dart): widget · Shared calendar UI component · `lib/widgets/floating_calendar.dart`
- [Summary](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/widgets/summary_card.dart): widget · Reusable summary panel · `lib/widgets/summary_card.dart`
- [Txn Tile](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/widgets/transaction_tile.dart): widget · Reusable transaction row/card · `lib/widgets/transaction_tile.dart`

### Data layer

Models, storage, and app services

- [Auth](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/services/auth_service.dart): service · Authentication and session handling · `lib/services/auth_service.dart`
- [Notify](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/services/notification_service.dart): service · Local notification integration · `lib/services/notification_service.dart`
- [Prefs](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/services/preferences_service.dart): service · Persisted user settings · `lib/services/preferences_service.dart`
- [Database](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/database/app_database.dart): local store · Local persistence boundary · `lib/database/app_database.dart`
- [Transaction](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/models/transaction_model.dart): domain model · Core transaction entity · `lib/models/transaction_model.dart`
- [Fund](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/models/fund_model.dart): domain model · Fund or account entity · `lib/models/fund_model.dart`
- [Category](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/models/category_model.dart): domain model · Categorization entity · `lib/models/category_model.dart`
- [Calendar Event](https://github.com/lucasadorno79/flutter_proyect1/blob/main/lib/models/calendar_event.dart): domain model · Calendar-linked domain record · `lib/models/calendar_event.dart`

## Connections

- Android → Main: launches · Android host starts the Flutter app
- iOS → Main: launches · iOS host starts the Flutter app
- macOS → Main: launches · macOS host starts the Flutter app
- Web → Main: loads · Browser shell loads the Flutter bundle
- Main → Auth: initializes · Bootstraps authentication/session logic
- Main → Prefs: initializes · Loads persisted app settings
- Main → Database: opens · Connects app startup to local storage
- Main → Login: routes to · Selects the first screen based on app state
- Main → Home: routes to · Navigates into the main app shell
- Login → Auth: uses · Performs sign-in and session checks
- Home → Summary: composes · Displays high-level status cards
- Home → Txn Tile: composes · Renders recent transaction items
- Home → Add Txn: opens · Starts transaction entry flow
- Home → Calendar: opens · Jumps to calendar review
- Home → Reports: opens · Jumps to reporting views
- Home → Settings: opens · Jumps to user settings
- Add Txn → Transaction: edits · Creates or updates transaction records
- Add Txn → Fund: selects · Assigns a fund/account to the entry
- Add Txn → Category: selects · Assigns a category to the entry
- Add Txn → Database: writes · Persists the new transaction
- Calendar → Float Cal: composes · Uses shared calendar UI
- Calendar → Calendar Event: reads · Shows date-linked records
- Calendar → Database: queries · Loads events and transactions by date
- Reports → Transaction: analyzes · Aggregates transaction data
- Reports → Fund: breaks down · Slices reporting by fund
- Reports → Category: breaks down · Slices reporting by category
- Settings → Prefs: updates · Saves user preferences
- Settings → Notify: configures · Controls notification behavior
- Database → Transaction: stores · Persists transaction entities
- Database → Fund: stores · Persists fund entities
- Database → Category: stores · Persists category entities
- Database → Calendar Event: stores · Persists calendar-linked records
- Notify → Calendar Event: triggers from · Uses scheduled or dated app events
