# muanyan-mjq/flowdiary architecture

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

- Interactive diagram: https://gitdiagram.com/muanyan-mjq/flowdiary
- Repository: https://github.com/muanyan-mjq/flowdiary

## Overview

随心耶 is a Flutter diary and personal-wellbeing app. The main journey is a user entering the app, creating a diary through weather, mood, event and writing steps, then revisiting entries through home, search, calendar and memory views. Other documented branches cover focus and tasks, fortune readings, daily signs, privacy, and optional cloud sync. The README supports the feature map and named service integrations; Dart implementation excerpts were not provided, so internal call-level wiring is not asserted.

Main entry points: [`lib/screens/home_screen.dart`](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/home_screen.dart) (Home feed), [`lib/screens/diary_wizard_screen.dart`](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/diary_wizard_screen.dart) (Diary wizard), [`lib/main.dart`](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/main.dart) (App entry), [`lib/steps/writing_step.dart`](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/steps/writing_step.dart) (Writing step)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_entry["App entry<br/>[main.dart]"]
  node_home["Home feed<br/>[home_screen.dart]"]
end

subgraph group_diary["Diary and memories"]
  node_wizard["Diary wizard"]
  node_weatherstep["Weather step<br/>[weather_step.dart]"]
  node_moodstep["Mood step<br/>[mood_step.dart]"]
  node_eventstep["Event step<br/>[event_step.dart]"]
  node_writingstep["Writing step<br/>[writing_step.dart]"]
  node_diarymodel["Diary entry<br/>[diary_entry.dart]"]
  node_diaryviews["Diary views"]
  node_drafts["Drafts<br/>[drafts_screen.dart]"]
  node_memories["Memory tunnel"]
  node_search["Diary search<br/>[search_screen.dart]"]
end

subgraph group_wellbeing["Rituals and insights"]
  node_focus["Focus and tasks<br/>[focus_screen.dart]"]
  node_timer["Pomodoro timer<br/>[timer_screen.dart]"]
  node_fortune["Fortune readings"]
  node_calendar["Mood calendar"]
  node_signs["Daily sign wall"]
end

subgraph group_account["Identity and settings"]
  node_profile["Profile and growth"]
  node_lock["App lock"]
  node_userauth["Local account<br/>[user_service.dart]"]
  node_syncscreen["Sync controls<br/>[sync_screen.dart]"]
  node_feedback["Feedback"]
end

subgraph group_services["Storage and integrations"]
  node_diarystorage[("Diary storage<br/>[diary_storage.dart]")]
  node_cloudsync["Cloud sync"]
  node_weather["Weather lookup"]
end

node_user(("User"))
node_supabase[("Supabase")]
node_qweather["QWeather API"]
node_formspree["Formspree"]

node_user -->|"opens"| node_entry
node_entry -->|"shows feed"| node_home
node_home -->|"starts entry"| node_wizard
node_wizard -->|"chooses weather"| node_weatherstep
node_wizard -->|"chooses mood"| node_moodstep
node_wizard -->|"sets tags"| node_eventstep
node_wizard -->|"opens writing"| node_writingstep
node_writingstep -->|"creates entry"| node_diarymodel
node_writingstep -->|"saves entry"| node_diarystorage
node_home -->|"opens entries"| node_diaryviews
node_writingstep -->|"autosaves draft"| node_drafts
node_home -->|"opens memories"| node_memories
node_home -->|"searches entries"| node_search
node_home -->|"opens tasks"| node_focus
node_focus -->|"starts timer"| node_timer
node_home -->|"opens readings"| node_fortune
node_profile -->|"views moods"| node_calendar
node_profile -->|"opens sign wall"| node_signs
node_entry -->|"gates access"| node_lock
node_entry -->|"authenticates locally"| node_userauth
node_syncscreen -->|"requests sync"| node_cloudsync
node_cloudsync -.->|"syncs data"| node_supabase
node_weatherstep -.->|"gets local weather"| node_weather
node_weather -.->|"queries weather"| node_qweather
node_feedback -.->|"submits feedback"| node_formspree

click node_entry "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/main.dart"
click node_home "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/home_screen.dart"
click node_wizard "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/diary_wizard_screen.dart"
click node_weatherstep "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/steps/weather_step.dart"
click node_moodstep "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/steps/mood_step.dart"
click node_eventstep "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/steps/event_step.dart"
click node_writingstep "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/steps/writing_step.dart"
click node_diarymodel "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/models/diary_entry.dart"
click node_diarystorage "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/utils/diary_storage.dart"
click node_diaryviews "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/diary_detail_screen.dart"
click node_drafts "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/drafts_screen.dart"
click node_memories "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/moo_space_tunnel_screen.dart"
click node_search "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/search_screen.dart"
click node_focus "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/focus_screen.dart"
click node_timer "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/timer_screen.dart"
click node_fortune "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/fortune_screen.dart"
click node_calendar "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/mood_calendar_screen.dart"
click node_signs "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/daily_sign_square_screen.dart"
click node_profile "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/profile_screen.dart"
click node_lock "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/app_lock_screen.dart"
click node_userauth "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/utils/user_service.dart"
click node_syncscreen "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/sync_screen.dart"
click node_cloudsync "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/services/cloud_sync_service.dart"
click node_weather "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/utils/weather_service.dart"
click node_feedback "https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/feedback_screen.dart"

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_home,node_user toneBlue
class node_wizard,node_weatherstep,node_moodstep,node_eventstep,node_writingstep,node_diarymodel,node_diaryviews,node_drafts,node_memories,node_search,node_supabase toneAmber
class node_focus,node_timer,node_fortune,node_calendar,node_signs,node_qweather toneMint
class node_profile,node_lock,node_userauth,node_syncscreen,node_feedback toneRose
class node_diarystorage,node_cloudsync,node_weather,node_formspree toneIndigo
```

## Components

### App shell

- [App entry](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/main.dart): `lib/main.dart`
- [Home feed](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/home_screen.dart): `lib/screens/home_screen.dart`

### Diary and memories

- [Diary wizard](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/diary_wizard_screen.dart): `lib/screens/diary_wizard_screen.dart`
- [Weather step](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/steps/weather_step.dart): `lib/steps/weather_step.dart`
- [Mood step](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/steps/mood_step.dart): `lib/steps/mood_step.dart`
- [Event step](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/steps/event_step.dart): `lib/steps/event_step.dart`
- [Writing step](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/steps/writing_step.dart): `lib/steps/writing_step.dart`
- [Diary entry](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/models/diary_entry.dart): `lib/models/diary_entry.dart`
- [Diary views](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/diary_detail_screen.dart): `lib/screens/diary_detail_screen.dart`
- [Drafts](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/drafts_screen.dart): `lib/screens/drafts_screen.dart`
- [Memory tunnel](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/moo_space_tunnel_screen.dart): `lib/screens/moo_space_tunnel_screen.dart`
- [Diary search](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/search_screen.dart): `lib/screens/search_screen.dart`

### Rituals and insights

- [Focus and tasks](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/focus_screen.dart): `lib/screens/focus_screen.dart`
- [Pomodoro timer](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/timer_screen.dart): `lib/screens/timer_screen.dart`
- [Fortune readings](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/fortune_screen.dart): `lib/screens/fortune_screen.dart`
- [Mood calendar](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/mood_calendar_screen.dart): `lib/screens/mood_calendar_screen.dart`
- [Daily sign wall](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/daily_sign_square_screen.dart): `lib/screens/daily_sign_square_screen.dart`

### Identity and settings

- [Profile and growth](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/profile_screen.dart): `lib/screens/profile_screen.dart`
- [App lock](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/app_lock_screen.dart): `lib/screens/app_lock_screen.dart`
- [Local account](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/utils/user_service.dart): `lib/utils/user_service.dart`
- [Sync controls](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/sync_screen.dart): `lib/screens/sync_screen.dart`
- [Feedback](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/screens/feedback_screen.dart): `lib/screens/feedback_screen.dart`

### Storage and integrations

- [Diary storage](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/utils/diary_storage.dart): `lib/utils/diary_storage.dart`
- [Cloud sync](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/services/cloud_sync_service.dart): `lib/services/cloud_sync_service.dart`
- [Weather lookup](https://github.com/muanyan-mjq/flowdiary/blob/main/lib/utils/weather_service.dart): `lib/utils/weather_service.dart`

### Other components

- **User**
- **Supabase**
- **QWeather API**
- **Formspree**

## Connections

- User → App entry: opens (evidence: `README.md`)
- App entry → Home feed: shows feed (evidence: `README.md`)
- Home feed → Diary wizard: starts entry (evidence: `README.md`)
- Diary wizard → Weather step: chooses weather (evidence: `README.md`)
- Diary wizard → Mood step: chooses mood (evidence: `README.md`)
- Diary wizard → Event step: sets tags (evidence: `README.md`)
- Diary wizard → Writing step: opens writing (evidence: `README.md`)
- Writing step → Diary entry: creates entry (evidence: `README.md`)
- Writing step → Diary storage: saves entry (evidence: `README.md`)
- Home feed → Diary views: opens entries (evidence: `README.md`)
- Writing step → Drafts: autosaves draft (evidence: `README.md`)
- Home feed → Memory tunnel: opens memories (evidence: `README.md`)
- Home feed → Diary search: searches entries (evidence: `README.md`)
- Home feed → Focus and tasks: opens tasks (evidence: `README.md`)
- Focus and tasks → Pomodoro timer: starts timer (evidence: `README.md`)
- Home feed → Fortune readings: opens readings (evidence: `README.md`)
- Profile and growth → Mood calendar: views moods (evidence: `README.md`)
- Profile and growth → Daily sign wall: opens sign wall (evidence: `README.md`)
- App entry → App lock: gates access (evidence: `README.md`)
- App entry → Local account: authenticates locally (evidence: `README.md`)
- Sync controls → Cloud sync: requests sync (evidence: `README.md`)
- Cloud sync → Supabase: syncs data (evidence: `README.md`)
- Weather step → Weather lookup: gets local weather (evidence: `README.md`)
- Weather lookup → QWeather API: queries weather (evidence: `README.md`)
- Feedback → Formspree: submits feedback (evidence: `README.md`)
