# iabolfazlmhm/focusapp architecture

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

- Interactive diagram: https://gitdiagram.com/iabolfazlmhm/focusapp
- Repository: https://github.com/iabolfazlmhm/focusapp

## Overview

FocusApp is a local-first Pomodoro timer, task manager, and habit tracker. The user enters through the app bootstrap, then works in the timer, task, and habit views; focus time and habit activity feed the progress dashboard. Settings and other views provide localization, help, quotes, data portability, and Trash. Shared state, browser storage, and reusable UI utilities support these workflows. Some feature modules were not excerpted, so their README-documented capabilities are included, but uncertain internal call paths are omitted.

Main entry points: [`src/main.js`](https://github.com/iabolfazlmhm/focusapp/blob/master/src/main.js) (App bootstrap), [`src/features/timer/timer.js`](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/timer/timer.js) (Timer and focus), [`src/features/progress/progress.js`](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/progress/progress.js) (Progress dashboard), [`src/features/settings/settings.js`](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/settings/settings.js) (Settings and backup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App entry"]
  node_bootstrap["App bootstrap<br/>[main.js]"]
  node_settings["Settings and backup<br/>[settings.js]"]
  node_trash["Trash and restore<br/>[trash.js]"]
  node_trashui["Trash interface<br/>[trash-ui.js]"]
  node_help["Help guide<br/>[help.js]"]
end

subgraph group_work["Focus and planning"]
  node_timer["Timer and focus<br/>[timer.js]"]
  node_focusmode["Focus mode<br/>[focus-mode.js]"]
  node_tasks["Task manager<br/>[tasks.js]"]
  node_taskview["Task rendering<br/>[tasks-render.js]"]
  node_taskstore["Task persistence<br/>[tasks-storage.js]"]
  node_habits["Habit tracker<br/>[habits.js]"]
  node_habitview["Habit rendering<br/>[habits-render.js]"]
  node_habitlogic["Habit scheduling<br/>[habits-logic.js]"]
  node_habitstore["Habit persistence<br/>[habits-storage.js]"]
end

subgraph group_insights["Progress and content"]
  node_progress["Progress dashboard<br/>[progress.js]"]
  node_heatmap["Activity heatmaps"]
  node_report["Daily report<br/>[progress-report.js]"]
  node_stats["Progress statistics<br/>[progress-stats.js]"]
  node_quotes["Quotes<br/>[quotes.js]"]
  node_motivation["Motivation data<br/>[motivation.js]"]
end

subgraph group_platform["Shared platform"]
  node_state["Shared app state<br/>[state.js]"]
  node_storage[("Browser storage<br/>[storage.js]")]
  node_i18n["Localization<br/>[i18n.js]"]
  node_dates["Date utilities<br/>[date-utils.js]"]
  node_dom["DOM utilities<br/>[dom-utils.js]"]
  node_audio["Audio engine<br/>[audio.js]"]
  node_toast["Toast notifications<br/>[toast.js]"]
  node_widgets["Shared UI widgets"]
end

node_user(("User"))

node_user -->|"opens app"| node_bootstrap
node_bootstrap -->|"initializes"| node_timer
node_bootstrap -->|"initializes"| node_tasks
node_bootstrap -->|"initializes"| node_habits
node_bootstrap -->|"initializes"| node_progress
node_bootstrap -->|"initializes"| node_settings
node_bootstrap -->|"initializes"| node_focusmode
node_bootstrap -->|"initializes"| node_quotes
node_tasks -->|"renders"| node_taskview
node_tasks -->|"saves"| node_taskstore
node_tasks -->|"soft-deletes"| node_trash
node_taskview -->|"saves preferences"| node_taskstore
node_timer -->|"saves focus time"| node_taskstore
node_timer -->|"formats task time"| node_taskview
node_habits -.->|"renders"| node_habitview
node_habitview -->|"calculates cadence"| node_habitlogic
node_habitview -->|"reads data"| node_habitstore
node_progress -->|"uses"| node_heatmap
node_progress -->|"uses"| node_stats
node_heatmap -->|"opens report"| node_report
node_heatmap -->|"uses"| node_stats
node_settings -->|"opens"| node_trashui
node_trashui -->|"manages items"| node_trash
node_quotes -->|"uses"| node_motivation
node_settings -->|"updates preferences"| node_progress
node_state -->|"loads state"| node_storage
node_i18n -->|"loads locale"| node_storage
node_bootstrap -.->|"initializes"| node_i18n
node_timer -->|"updates timer state"| node_state
node_timer -->|"plays sounds"| node_audio
node_toast -->|"plays feedback"| node_audio
node_progress -->|"uses dates"| node_dates
node_help -->|"saves help state"| node_storage
node_settings -->|"switches language"| node_i18n
node_timer -->|"records timer data"| node_storage
node_widgets -->|"date picker uses"| node_dates

click node_bootstrap "https://github.com/iabolfazlmhm/focusapp/blob/master/src/main.js"
click node_timer "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/timer/timer.js"
click node_focusmode "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/timer/focus-mode.js"
click node_tasks "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/tasks/tasks.js"
click node_taskview "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/tasks/tasks-render.js"
click node_taskstore "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/tasks/tasks-storage.js"
click node_habits "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/habits/habits.js"
click node_habitview "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/habits/habits-render.js"
click node_habitlogic "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/habits/habits-logic.js"
click node_habitstore "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/habits/habits-storage.js"
click node_progress "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/progress/progress.js"
click node_heatmap "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/progress/progress-heatmap.js"
click node_report "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/progress/progress-report.js"
click node_stats "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/progress/progress-stats.js"
click node_settings "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/settings/settings.js"
click node_trash "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/trash/trash.js"
click node_trashui "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/trash/trash-ui.js"
click node_quotes "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/quotes/quotes.js"
click node_motivation "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/quotes/motivation.js"
click node_help "https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/help/help.js"
click node_state "https://github.com/iabolfazlmhm/focusapp/blob/master/src/core/state.js"
click node_storage "https://github.com/iabolfazlmhm/focusapp/blob/master/src/core/storage.js"
click node_i18n "https://github.com/iabolfazlmhm/focusapp/blob/master/src/core/i18n.js"
click node_dates "https://github.com/iabolfazlmhm/focusapp/blob/master/src/core/date-utils.js"
click node_dom "https://github.com/iabolfazlmhm/focusapp/blob/master/src/core/dom-utils.js"
click node_audio "https://github.com/iabolfazlmhm/focusapp/blob/master/src/shared/audio.js"
click node_toast "https://github.com/iabolfazlmhm/focusapp/blob/master/src/shared/toast/toast.js"
click node_widgets "https://github.com/iabolfazlmhm/focusapp/tree/master/src/shared"

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_bootstrap,node_settings,node_trash,node_trashui,node_help,node_user toneBlue
class node_timer,node_focusmode,node_tasks,node_taskview,node_taskstore,node_habits,node_habitview,node_habitlogic,node_habitstore toneAmber
class node_progress,node_heatmap,node_report,node_stats,node_quotes,node_motivation toneMint
class node_state,node_storage,node_i18n,node_dates,node_dom,node_audio,node_toast,node_widgets toneRose
```

## Components

### App entry

- [App bootstrap](https://github.com/iabolfazlmhm/focusapp/blob/master/src/main.js): `src/main.js`
- [Settings and backup](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/settings/settings.js): `src/features/settings/settings.js`
- [Trash and restore](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/trash/trash.js): `src/features/trash/trash.js`
- [Trash interface](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/trash/trash-ui.js): `src/features/trash/trash-ui.js`
- [Help guide](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/help/help.js): `src/features/help/help.js`

### Focus and planning

- [Timer and focus](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/timer/timer.js): `src/features/timer/timer.js`
- [Focus mode](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/timer/focus-mode.js): `src/features/timer/focus-mode.js`
- [Task manager](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/tasks/tasks.js): `src/features/tasks/tasks.js`
- [Task rendering](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/tasks/tasks-render.js): `src/features/tasks/tasks-render.js`
- [Task persistence](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/tasks/tasks-storage.js): `src/features/tasks/tasks-storage.js`
- [Habit tracker](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/habits/habits.js): `src/features/habits/habits.js`
- [Habit rendering](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/habits/habits-render.js): `src/features/habits/habits-render.js`
- [Habit scheduling](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/habits/habits-logic.js): `src/features/habits/habits-logic.js`
- [Habit persistence](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/habits/habits-storage.js): `src/features/habits/habits-storage.js`

### Progress and content

- [Progress dashboard](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/progress/progress.js): `src/features/progress/progress.js`
- [Activity heatmaps](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/progress/progress-heatmap.js): `src/features/progress/progress-heatmap.js`
- [Daily report](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/progress/progress-report.js): `src/features/progress/progress-report.js`
- [Progress statistics](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/progress/progress-stats.js): `src/features/progress/progress-stats.js`
- [Quotes](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/quotes/quotes.js): `src/features/quotes/quotes.js`
- [Motivation data](https://github.com/iabolfazlmhm/focusapp/blob/master/src/features/quotes/motivation.js): `src/features/quotes/motivation.js`

### Shared platform

- [Shared app state](https://github.com/iabolfazlmhm/focusapp/blob/master/src/core/state.js): `src/core/state.js`
- [Browser storage](https://github.com/iabolfazlmhm/focusapp/blob/master/src/core/storage.js): `src/core/storage.js`
- [Localization](https://github.com/iabolfazlmhm/focusapp/blob/master/src/core/i18n.js): `src/core/i18n.js`
- [Date utilities](https://github.com/iabolfazlmhm/focusapp/blob/master/src/core/date-utils.js): `src/core/date-utils.js`
- [DOM utilities](https://github.com/iabolfazlmhm/focusapp/blob/master/src/core/dom-utils.js): `src/core/dom-utils.js`
- [Audio engine](https://github.com/iabolfazlmhm/focusapp/blob/master/src/shared/audio.js): `src/shared/audio.js`
- [Toast notifications](https://github.com/iabolfazlmhm/focusapp/blob/master/src/shared/toast/toast.js): `src/shared/toast/toast.js`
- [Shared UI widgets](https://github.com/iabolfazlmhm/focusapp/tree/master/src/shared): `src/shared`

### Other components

- **User**

## Connections

- User → App bootstrap: opens app (evidence: `README.md`)
- App bootstrap → Timer and focus: initializes (evidence: `src/main.js`)
- App bootstrap → Task manager: initializes (evidence: `src/main.js`)
- App bootstrap → Habit tracker: initializes (evidence: `src/main.js`)
- App bootstrap → Progress dashboard: initializes (evidence: `src/main.js`)
- App bootstrap → Settings and backup: initializes (evidence: `src/main.js`)
- App bootstrap → Focus mode: initializes (evidence: `src/main.js`)
- App bootstrap → Quotes: initializes (evidence: `src/main.js`)
- Task manager → Task rendering: renders (evidence: `src/features/tasks/tasks.js`)
- Task manager → Task persistence: saves (evidence: `src/features/tasks/tasks.js`)
- Task manager → Trash and restore: soft-deletes (evidence: `src/features/tasks/tasks.js`)
- Task rendering → Task persistence: saves preferences (evidence: `src/features/tasks/tasks-render.js`)
- Timer and focus → Task persistence: saves focus time (evidence: `src/features/timer/timer.js`)
- Timer and focus → Task rendering: formats task time (evidence: `src/features/timer/timer.js`)
- Habit tracker → Habit rendering: renders
- Habit rendering → Habit scheduling: calculates cadence (evidence: `src/features/habits/habits-render.js`)
- Habit rendering → Habit persistence: reads data (evidence: `src/features/habits/habits-render.js`)
- Progress dashboard → Activity heatmaps: uses (evidence: `src/features/progress/progress.js`)
- Progress dashboard → Progress statistics: uses (evidence: `src/features/progress/progress.js`)
- Activity heatmaps → Daily report: opens report (evidence: `src/features/progress/progress-heatmap.js`)
- Activity heatmaps → Progress statistics: uses (evidence: `src/features/progress/progress-heatmap.js`)
- Settings and backup → Trash interface: opens (evidence: `src/features/settings/settings.js`)
- Trash interface → Trash and restore: manages items (evidence: `src/features/trash/trash-ui.js`)
- Quotes → Motivation data: uses (evidence: `src/features/quotes/quotes.js`)
- Settings and backup → Progress dashboard: updates preferences (evidence: `src/features/settings/settings.js`)
- Shared app state → Browser storage: loads state (evidence: `src/core/state.js`)
- Localization → Browser storage: loads locale (evidence: `src/core/i18n.js`)
- App bootstrap → Localization: initializes (evidence: `src/main.js`)
- Timer and focus → Shared app state: updates timer state (evidence: `src/features/timer/timer.js`)
- Timer and focus → Audio engine: plays sounds (evidence: `src/features/timer/timer.js`)
- Toast notifications → Audio engine: plays feedback (evidence: `src/shared/toast/toast.js`)
- Progress dashboard → Date utilities: uses dates (evidence: `src/features/progress/progress.js`)
- Help guide → Browser storage: saves help state (evidence: `src/features/help/help.js`)
- Settings and backup → Localization: switches language (evidence: `src/features/settings/settings.js`)
- Timer and focus → Browser storage: records timer data (evidence: `src/features/timer/timer.js`)
- Shared UI widgets → Date utilities: date picker uses (evidence: `src/shared/date-nav/date-picker-popover.js`)
