# gitarber/habits_tracker architecture

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

- Interactive diagram: https://gitdiagram.com/gitarber/habits_tracker
- Repository: https://github.com/gitarber/habits_tracker

## Overview

Daily Habits Tracker is a cross-platform Flutter app for creating habits, setting reminders, and tracking completion and streaks. The user workflow is to enter the app, view habits, create or edit one, and record daily completion; local persistence is documented, but the sampled source does not show the Dart runtime wiring. The graph preserves README capabilities whose implementation files were not sampled and includes the Windows and Linux host-shell modules named in the source index. Those platform-shell edges are limited to relationships visible in the excerpts.

Main entry points: [`lib/screens/home_screen.dart`](https://github.com/gitarber/habits_tracker/blob/main/lib/screens/home_screen.dart) (Habit home), [`lib/providers/habits_provider.dart`](https://github.com/gitarber/habits_tracker/blob/main/lib/providers/habits_provider.dart) (Habit state), [`lib/main.dart`](https://github.com/gitarber/habits_tracker/blob/main/lib/main.dart) (App entry), [`lib/widgets/add_habit_dialog.dart`](https://github.com/gitarber/habits_tracker/blob/main/lib/widgets/add_habit_dialog.dart) (Habit editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_entry["App entry<br/>[main.dart]"]
  node_onboarding["Onboarding"]
  node_home["Habit home<br/>[home_screen.dart]"]
  node_habit_tile["Habit tile<br/>[habit_tile.dart]"]
  node_add_button["Add button"]
  node_add_dialog["Habit editor"]
  node_time_picker["Time picker"]
end

subgraph group_habit_domain["Habit domain"]
  node_habit_state["Habit state"]
  node_habit_model["Habit model<br/>[habit.dart]"]
  node_log_model["Habit log<br/>[habit_log.dart]"]
end

subgraph group_tracking_reminders["Tracking and reminders"]
  node_progress["Progress and streaks"]
  node_reminders["Daily reminders"]
end

subgraph group_persistence["Local persistence"]
  node_database_service["Database service"]
  node_sqlite[("Local SQLite")]
end

subgraph group_platform_shells["Platform shells"]
  node_windows_entry["Windows entry<br/>[main.cpp]"]
  node_windows_flutter["Flutter window<br/>[flutter_window.h]"]
  node_windows_window["Win32 window<br/>[win32_window.cpp]"]
  node_windows_registrant["Windows plugins"]
  node_linux_entry["Linux entry<br/>[main.cc]"]
  node_linux_application["Linux application<br/>[my_application.h]"]
  node_linux_registrant["Linux plugins"]
  node_macos_registrant["macOS plugins"]
  node_ios_delegate["iOS app delegate<br/>[AppDelegate.swift]"]
end

node_user(("App user"))

node_user -.->|"launches"| node_entry
node_entry -.->|"routes to"| node_onboarding
node_entry -.->|"opens"| node_home
node_user -.->|"views habits"| node_home
node_home -.->|"shows habits"| node_habit_tile
node_home -.->|"offers creation"| node_add_button
node_add_button -.->|"opens editor"| node_add_dialog
node_add_dialog -.->|"selects time"| node_time_picker
node_home -.->|"uses state"| node_habit_state
node_add_dialog -.->|"updates habits"| node_habit_state
node_habit_state -.->|"manages"| node_habit_model
node_habit_state -.->|"tracks completion"| node_log_model
node_habit_state -.->|"persists data"| node_database_service
node_database_service -.->|"reads and writes"| node_sqlite
node_home -.->|"shows progress"| node_progress
node_habit_state -.->|"supports statistics"| node_progress
node_user -.->|"sets reminders"| node_reminders
node_windows_entry -->|"creates"| node_windows_flutter
node_windows_flutter -->|"extends"| node_windows_window
node_linux_entry -->|"creates and runs"| node_linux_application
node_ios_delegate -.->|"names registrant"| node_macos_registrant

click node_entry "https://github.com/gitarber/habits_tracker/blob/main/lib/main.dart"
click node_onboarding "https://github.com/gitarber/habits_tracker/blob/main/lib/screens/onboarding_screen.dart"
click node_home "https://github.com/gitarber/habits_tracker/blob/main/lib/screens/home_screen.dart"
click node_habit_tile "https://github.com/gitarber/habits_tracker/blob/main/lib/widgets/habit_tile.dart"
click node_add_button "https://github.com/gitarber/habits_tracker/blob/main/lib/widgets/add_habit_button.dart"
click node_add_dialog "https://github.com/gitarber/habits_tracker/blob/main/lib/widgets/add_habit_dialog.dart"
click node_time_picker "https://github.com/gitarber/habits_tracker/blob/main/lib/widgets/custom_time_picker.dart"
click node_habit_state "https://github.com/gitarber/habits_tracker/blob/main/lib/providers/habits_provider.dart"
click node_habit_model "https://github.com/gitarber/habits_tracker/blob/main/lib/models/habit.dart"
click node_log_model "https://github.com/gitarber/habits_tracker/blob/main/lib/models/habit_log.dart"
click node_progress "https://github.com/gitarber/habits_tracker/tree/main/lib"
click node_reminders "https://github.com/gitarber/habits_tracker/tree/main/lib"
click node_database_service "https://github.com/gitarber/habits_tracker/blob/main/lib/services/database_service.dart"
click node_windows_entry "https://github.com/gitarber/habits_tracker/blob/main/windows/runner/main.cpp"
click node_windows_flutter "https://github.com/gitarber/habits_tracker/blob/main/windows/runner/flutter_window.h"
click node_windows_window "https://github.com/gitarber/habits_tracker/blob/main/windows/runner/win32_window.cpp"
click node_windows_registrant "https://github.com/gitarber/habits_tracker/blob/main/windows/flutter/generated_plugin_registrant.h"
click node_linux_entry "https://github.com/gitarber/habits_tracker/blob/main/linux/runner/main.cc"
click node_linux_application "https://github.com/gitarber/habits_tracker/blob/main/linux/runner/my_application.h"
click node_linux_registrant "https://github.com/gitarber/habits_tracker/blob/main/linux/flutter/generated_plugin_registrant.h"
click node_macos_registrant "https://github.com/gitarber/habits_tracker/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift"
click node_ios_delegate "https://github.com/gitarber/habits_tracker/blob/main/ios/Runner/AppDelegate.swift"

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_entry,node_onboarding,node_home,node_habit_tile,node_add_button,node_add_dialog,node_time_picker,node_user toneBlue
class node_habit_state,node_habit_model,node_log_model toneAmber
class node_progress,node_reminders toneMint
class node_database_service,node_sqlite toneRose
class node_windows_entry,node_windows_flutter,node_windows_window,node_windows_registrant,node_linux_entry,node_linux_application,node_linux_registrant,node_macos_registrant,node_ios_delegate toneIndigo
```

## Components

### App experience

- [App entry](https://github.com/gitarber/habits_tracker/blob/main/lib/main.dart): `lib/main.dart`
- [Onboarding](https://github.com/gitarber/habits_tracker/blob/main/lib/screens/onboarding_screen.dart): `lib/screens/onboarding_screen.dart`
- [Habit home](https://github.com/gitarber/habits_tracker/blob/main/lib/screens/home_screen.dart): `lib/screens/home_screen.dart`
- [Habit tile](https://github.com/gitarber/habits_tracker/blob/main/lib/widgets/habit_tile.dart): `lib/widgets/habit_tile.dart`
- [Add button](https://github.com/gitarber/habits_tracker/blob/main/lib/widgets/add_habit_button.dart): `lib/widgets/add_habit_button.dart`
- [Habit editor](https://github.com/gitarber/habits_tracker/blob/main/lib/widgets/add_habit_dialog.dart): `lib/widgets/add_habit_dialog.dart`
- [Time picker](https://github.com/gitarber/habits_tracker/blob/main/lib/widgets/custom_time_picker.dart): `lib/widgets/custom_time_picker.dart`

### Habit domain

- [Habit state](https://github.com/gitarber/habits_tracker/blob/main/lib/providers/habits_provider.dart): `lib/providers/habits_provider.dart`
- [Habit model](https://github.com/gitarber/habits_tracker/blob/main/lib/models/habit.dart): `lib/models/habit.dart`
- [Habit log](https://github.com/gitarber/habits_tracker/blob/main/lib/models/habit_log.dart): `lib/models/habit_log.dart`

### Tracking and reminders

- [Progress and streaks](https://github.com/gitarber/habits_tracker/tree/main/lib): `lib`
- [Daily reminders](https://github.com/gitarber/habits_tracker/tree/main/lib): `lib`

### Local persistence

- [Database service](https://github.com/gitarber/habits_tracker/blob/main/lib/services/database_service.dart): `lib/services/database_service.dart`
- **Local SQLite**

### Platform shells

- [Windows entry](https://github.com/gitarber/habits_tracker/blob/main/windows/runner/main.cpp): `windows/runner/main.cpp`
- [Flutter window](https://github.com/gitarber/habits_tracker/blob/main/windows/runner/flutter_window.h): `windows/runner/flutter_window.h`
- [Win32 window](https://github.com/gitarber/habits_tracker/blob/main/windows/runner/win32_window.cpp): `windows/runner/win32_window.cpp`
- [Windows plugins](https://github.com/gitarber/habits_tracker/blob/main/windows/flutter/generated_plugin_registrant.h): `windows/flutter/generated_plugin_registrant.h`
- [Linux entry](https://github.com/gitarber/habits_tracker/blob/main/linux/runner/main.cc): `linux/runner/main.cc`
- [Linux application](https://github.com/gitarber/habits_tracker/blob/main/linux/runner/my_application.h): `linux/runner/my_application.h`
- [Linux plugins](https://github.com/gitarber/habits_tracker/blob/main/linux/flutter/generated_plugin_registrant.h): `linux/flutter/generated_plugin_registrant.h`
- [macOS plugins](https://github.com/gitarber/habits_tracker/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift): `macos/Flutter/GeneratedPluginRegistrant.swift`
- [iOS app delegate](https://github.com/gitarber/habits_tracker/blob/main/ios/Runner/AppDelegate.swift): `ios/Runner/AppDelegate.swift`

### Other components

- **App user**

## Connections

- App user → App entry: launches
- App entry → Onboarding: routes to
- App entry → Habit home: opens
- App user → Habit home: views habits
- Habit home → Habit tile: shows habits
- Habit home → Add button: offers creation
- Add button → Habit editor: opens editor
- Habit editor → Time picker: selects time
- Habit home → Habit state: uses state
- Habit editor → Habit state: updates habits
- Habit state → Habit model: manages
- Habit state → Habit log: tracks completion
- Habit state → Database service: persists data
- Database service → Local SQLite: reads and writes
- Habit home → Progress and streaks: shows progress
- Habit state → Progress and streaks: supports statistics
- App user → Daily reminders: sets reminders
- Windows entry → Flutter window: creates (evidence: `windows/runner/main.cpp`)
- Flutter window → Win32 window: extends (evidence: `windows/runner/flutter_window.h`)
- Linux entry → Linux application: creates and runs (evidence: `linux/runner/main.cc`)
- iOS app delegate → macOS plugins: names registrant (evidence: `ios/Runner/AppDelegate.swift`)
