How demizo/daily_you works
1. Project shape
- Daily You is a Flutter cross-platform journaling app, targeting Android, iOS, macOS, Linux, Windows, with Android-specific native plugins and desktop packaging scripts.
- The app is designed as offline-first and local-data-only: there is no backend service, account system, or cloud sync path in the repository.
2. Top-level runtime boundary
- lib/main.dart bootstraps the Flutter app.
- The app is then split into a small set of core services, a local persistence layer, state providers, and feature pages/widgets.
- Platform-specific code exists mainly to bridge Flutter with device/file-system capabilities, especially on Android.
3. Presentation layer
- User-facing screens live under lib/pages/:
- journal flow: home, entry detail, edit entry, gallery, image view, launch page
- analytics: statistics page
- settings: appearance, backup/restore, flashback, language, notification, security, storage, templates, about
- The UI is composed from reusable pieces in lib/widgets/ such as entry cards, markdown editors/toolbars, mood pickers, charts, template selectors, and settings controls.
4. State management boundary
- lib/providers/ contains the app’s state orchestration:
- entries_provider.dart
- entry_images_provider.dart
- templates_provider.dart
- These providers sit between the UI and persistence/services, exposing journal data, image data, and template data to pages and widgets.
5. Domain model
- Core data structures are in lib/models/:
- entry.dart
- image.dart
- template.dart
- flashback.dart
- These models represent the journal domain: entries, attached images, reusable templates, and “flashback” content used by reminder/recall features.
6. Local persistence layer
- lib/database/ is the app’s main data boundary:
- app_database.dart is the database entry point
- DAOs manage specific entities: entry_dao.dart, entry_image_dao.dart, template_dao.dart
- image_storage.dart handles image persistence separate from structured entry records
- The architecture implies a split between structured database records and file-backed binary image storage.
7. File and import/export flow
- Data portability is handled in lib/utils/:
- backup_restore_utils.dart
- export_utils.dart
- import_utils.dart
- zip_utils.dart
- file_layer.dart
- saf_transfer.dart
- This suggests a pipeline where local journal data can be packaged, exported, imported, and restored, with file-system access abstracted to support device storage rules.
8. Platform/device services
- Several top-level services coordinate device behavior:
- notification_manager.dart for reminders
- flashback_manager.dart for resurfacing past memories
- time_manager.dart for date/time semantics
- device_info_service.dart for platform-specific capabilities
- launch_intent.dart for startup/context routing
- config_provider.dart and theme_mode_provider.dart for app-wide settings
- These act as app services rather than UI components.
9. Native Android integration
- Android has custom Kotlin code in android/app/src/main/kotlin/...:
- MainActivity.kt
- MediaScannerPlugin.kt
- SafTransferPlugin.kt
- This is the main native boundary, likely used to support media visibility/scanning and Android Storage Access Framework file transfer behavior.
10. Desktop/mobile platform shells
- iOS, macOS, Linux, and Windows folders are standard Flutter runners and packaging shells.
- Desktop support includes native app entry points and generated plugin registrants, but the functional app logic remains in shared Dart code.
11. Localization and regionalization
- The app is heavily localized:
- source translations in lib/l10n/*.arb
- generated localization code in lib/l10n/generated/
- localized store metadata in fastlane/metadata/android/
- UI text is therefore routed through the generated localization layer rather than hardcoded strings.
12. Settings and user control
- The settings area is a major architectural surface, not an afterthought.
- It exposes controls for appearance, language, notifications, security, storage location, templates, and backup/restore, reinforcing the app’s privacy/data-ownership model.
13. Charts and insights
- Statistics and mood visualization are first-class features.
- Chart widgets under lib/widgets/ summarize mood over day/month and totals, while lib/pages/statistics_page.dart presents the aggregated view.
- This indicates a read-heavy analytics path over the same local entry data.
14. Build, release, and packaging pipeline
- Release automation is present via:
- GitHub Actions in .github/workflows/fastlane.yml
- Fastlane metadata in fastlane/
- release scripts like build_release.sh and prepare_release.sh
- Nix development environment via flake.nix
- Packaging targets include Android app bundles/APKs, desktop artifacts, and likely AppImage/Snap outputs, but all are driven from the same Flutter source tree.
15. Key architectural diagram boundaries
- The cleanest diagram should show:
- Flutter UI layer → state providers/services → local database + file storage
- side services for notifications, backup/import/export, localization, and platform plugins
- platform shells around the shared Dart core
- The central design principle is: all user data stays on-device, and every major feature reads from or writes to local storage.
Main entry points: entries_provider.dart Entries · backup_restore_utils.dart Backup flow · main.dart Main · settings_page.dart Settings
Components 21
Core app
Flutter bootstrap, shared shell, and app-wide configuration
- Main · App entry point that initializes the shared Flutter runtime
lib/main.dart - Responsive UI · Shared layout scaffold for mobile and desktop form factors
lib/layouts/responsive_layout.dart - Localizations · Generated localized strings used throughout the UI
lib/l10n/generated/app_localizations.dart
Feature UI
User-facing pages and reusable presentation components
- Launch · Initial routing and startup context handling
lib/pages/launch_page.dart - Home · Primary entry feed and navigation hub
lib/pages/home_page.dart - Entry detail · Reads and presents a single journal entry
lib/pages/entry_detail_page.dart - Edit entry · Creates and updates journal entries and attachments
lib/pages/edit_entry_page.dart - Gallery · Browse attached journal images
lib/pages/gallery_page.dart - Statistics · Aggregated mood and activity analytics
lib/pages/statistics_page.dart - Settings · Entry point for app preferences and data management
lib/pages/settings_page.dart
State & services
Providers and app services that coordinate reads, writes, and device behavior
- Entries · Orchestrates journal entry data between UI and persistence
lib/providers/entries_provider.dart - Images · Coordinates attached image metadata and loading
lib/providers/entry_images_provider.dart - Templates · Exposes reusable journal templates to the UI
lib/providers/templates_provider.dart - Notifications · Schedules reminder behavior and notification delivery
lib/notification_manager.dart - Flashback · Surfaces past memories and recall prompts
lib/flashback_manager.dart
Local data
Database, file-backed storage, and import/export flows
- Database · Structured persistence entry point for journal records
lib/database/app_database.dart - Image store · Separates binary image persistence from structured records
lib/database/image_storage.dart - Backup flow · Packages, exports, imports, and restores local data
lib/utils/backup_restore_utils.dart - File layer · Abstracts file-system access for device rules and storage locations
lib/utils/file_layer.dart
Platform shell
Native and runner integration for mobile and desktop targets
- Android bridge · Custom Kotlin plugins for media scanning and SAF transfers
android/app/src/main/kotlin/com/example/daily_you/MainActivity.kt - Desktop runner · Platform launcher and generated desktop integration
windows/runner/main.cpp
Connections 23
- Main → Responsive UI: boots shell · Initializes the app shell and responsive presentation
- Main → Launch: starts at · Routes first into the launch flow
- Main → Localizations: loads text · Uses generated locale resources for UI strings
- Responsive UI → Home: hosts · Renders the main journal home experience
- Home → Entries: reads entries · Consumes journal data through state providers
- Entry detail → Entries: reads entry · Loads a selected entry through shared state
- Edit entry → Entries: writes entries · Creates and updates journal content
- Gallery → Images: reads images · Browses attachment state and image records
- Edit entry → Images: edits images · Manages attachments during entry editing
- Statistics → Entries: aggregates data · Builds charts from local entry history
- Settings → Templates: manages templates · Exposes template settings and reuse flows
- Settings → Notifications: configures reminders · Adjusts notification behavior from settings
- Settings → Backup flow: backup/restore · Drives import, export, and restore actions
- Entries → Database: persists records · Reads and writes structured journal data
- Templates → Database: persists templates · Stores template definitions locally
- Images → Image store: loads assets · Retrieves attached image data from file-backed storage
- Backup flow → File layer: uses files · Packages data through the storage abstraction
- Backup flow → Database: exports db · Serializes local structured data for backup and restore
- Backup flow → Image store: exports media · Includes binary attachments in portability flows
- Flashback → Entries: recalls entries · Surfaces past journal content for flashback features
- Notifications → Localizations: formats text · Uses localized content for reminder messaging
- Android bridge → File layer: bridges storage · Connects Android native behavior to file-transfer flows
- Desktop runner → Main: launches app · Desktop shell hands control to the shared Flutter entry point