# dreminmx-tech/deeptracker architecture

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

- Interactive diagram: https://gitdiagram.com/dreminmx-tech/deeptracker
- Repository: https://github.com/dreminmx-tech/deeptracker

## Overview

DeepTracker is an offline-first browser habit tracker: users record daily habit progress, manage habits and schedules, write journal notes, review streaks, and maintain local settings or backups. The main route is App navigation into a screen, which updates shared state; the store persists that state in browser storage. Separate domain logic supports habit actions, date handling, streak/stat calculations, journal data, and urge timers. The README documents offline PWA support and the broader user-facing capabilities; several UI and integration links rely on its descriptions or the SOURCE INDEX rather than sampled implementations.

Main entry points: [`src/App.tsx`](https://github.com/dreminmx-tech/deeptracker/blob/main/src/App.tsx) (App shell), [`src/lib/actions.ts`](https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/actions.ts) (Habit actions), [`src/lib/storage.ts`](https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/storage.ts) (Data storage), [`src/components/TodayView.tsx`](https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/TodayView.tsx) (Today view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_app["App shell<br/>[App.tsx]"]
  node_today["Today view<br/>[TodayView.tsx]"]
  node_habit_view["Habits view<br/>[HabitsView.tsx]"]
  node_habit_form["Habit editor<br/>[HabitForm.tsx]"]
  node_habit_row["Habit row<br/>[HabitRow.tsx]"]
  node_urge_timer["Urge timer<br/>[UrgeTimer.tsx]"]
  node_journal_view["Journal view<br/>[JournalView.tsx]"]
  node_stats_view["Stats view<br/>[StatsView.tsx]"]
  node_settings_view["Settings view<br/>[SettingsView.tsx]"]
  node_translations["Translations<br/>[i18n.ts]"]
end

subgraph group_habit_domain["Habit tracking"]
  node_actions["Habit actions<br/>[actions.ts]"]
  node_habit_logic["Habit logic<br/>[habits.ts]"]
  node_date_logic["Date logic<br/>[date.ts]"]
  node_timer_logic["Timer logic<br/>[timer.ts]"]
end

subgraph group_personal_data["Personal data"]
  node_store["Shared state<br/>[store.tsx]"]
  node_storage[("Data storage<br/>[storage.ts]")]
  node_journal_logic["Journal logic<br/>[journal.ts]"]
end

subgraph group_platform["Browser platform"]
  node_diagnostics["Diagnostics<br/>[diagnostics.ts]"]
  node_back_button["Back handling<br/>[useBackButton.ts]"]
  node_keyboard_inset["Keyboard layout"]
  node_install_prompt["Install prompt"]
  node_service_worker["Offline worker<br/>[sw.js]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"provides state"| node_store
node_app -->|"routes to"| node_today
node_app -->|"routes to"| node_habit_view
node_app -->|"routes to"| node_journal_view
node_app -->|"routes to"| node_stats_view
node_app -->|"routes to"| node_settings_view
node_app -->|"localizes shell"| node_translations
node_app -->|"handles back"| node_back_button
node_store -->|"loads and saves"| node_storage
node_today -->|"updates progress"| node_actions
node_today -->|"checks progress"| node_habit_logic
node_today -->|"renders rows"| node_habit_row
node_today -->|"renders urges"| node_urge_timer
node_habit_view -->|"opens editor"| node_habit_form
node_habit_view -->|"renders rows"| node_habit_row
node_habit_view -->|"manages habits"| node_actions
node_habit_view -->|"reads habit state"| node_habit_logic
node_habit_form -->|"saves habit"| node_actions
node_urge_timer -->|"records outcome"| node_actions
node_urge_timer -->|"gets duration"| node_timer_logic
node_urge_timer -->|"reads entry"| node_habit_logic
node_journal_view -->|"reads notes"| node_journal_logic
node_journal_view -->|"adapts to keyboard"| node_keyboard_inset
node_stats_view -->|"calculates stats"| node_habit_logic
node_settings_view -->|"imports and exports"| node_storage
node_settings_view -->|"updates settings"| node_actions
node_settings_view -->|"offers installation"| node_install_prompt
node_settings_view -->|"runs diagnostics"| node_diagnostics
node_actions -->|"uses rules"| node_habit_logic
node_actions -->|"uses duration"| node_timer_logic
node_storage -->|"normalizes notes"| node_journal_logic
node_storage -->|"validates dates"| node_date_logic
node_storage -->|"seeds habits"| node_translations
node_storage -->|"uses timer defaults"| node_timer_logic
node_app -.->|"supports offline use"| node_service_worker

click node_app "https://github.com/dreminmx-tech/deeptracker/blob/main/src/App.tsx"
click node_today "https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/TodayView.tsx"
click node_habit_view "https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/HabitsView.tsx"
click node_habit_form "https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/HabitForm.tsx"
click node_habit_row "https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/HabitRow.tsx"
click node_urge_timer "https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/UrgeTimer.tsx"
click node_journal_view "https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/JournalView.tsx"
click node_stats_view "https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/StatsView.tsx"
click node_settings_view "https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/SettingsView.tsx"
click node_store "https://github.com/dreminmx-tech/deeptracker/blob/main/src/store.tsx"
click node_storage "https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/storage.ts"
click node_actions "https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/actions.ts"
click node_habit_logic "https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/habits.ts"
click node_date_logic "https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/date.ts"
click node_timer_logic "https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/timer.ts"
click node_journal_logic "https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/journal.ts"
click node_translations "https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/i18n.ts"
click node_diagnostics "https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/diagnostics.ts"
click node_back_button "https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/useBackButton.ts"
click node_keyboard_inset "https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/useKeyboardInset.ts"
click node_install_prompt "https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/useInstallPrompt.ts"
click node_service_worker "https://github.com/dreminmx-tech/deeptracker/blob/main/public/sw.js"

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_app,node_today,node_habit_view,node_habit_form,node_habit_row,node_urge_timer,node_journal_view,node_stats_view,node_settings_view,node_translations,node_user toneBlue
class node_actions,node_habit_logic,node_date_logic,node_timer_logic toneAmber
class node_store,node_storage,node_journal_logic toneMint
class node_diagnostics,node_back_button,node_keyboard_inset,node_install_prompt,node_service_worker toneRose
```

## Components

### App experience

- [App shell](https://github.com/dreminmx-tech/deeptracker/blob/main/src/App.tsx): `src/App.tsx`
- [Today view](https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/TodayView.tsx): `src/components/TodayView.tsx`
- [Habits view](https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/HabitsView.tsx): `src/components/HabitsView.tsx`
- [Habit editor](https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/HabitForm.tsx): `src/components/HabitForm.tsx`
- [Habit row](https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/HabitRow.tsx): `src/components/HabitRow.tsx`
- [Urge timer](https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/UrgeTimer.tsx): `src/components/UrgeTimer.tsx`
- [Journal view](https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/JournalView.tsx): `src/components/JournalView.tsx`
- [Stats view](https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/StatsView.tsx): `src/components/StatsView.tsx`
- [Settings view](https://github.com/dreminmx-tech/deeptracker/blob/main/src/components/SettingsView.tsx): `src/components/SettingsView.tsx`
- [Translations](https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/i18n.ts): `src/lib/i18n.ts`

### Habit tracking

- [Habit actions](https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/actions.ts): `src/lib/actions.ts`
- [Habit logic](https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/habits.ts): `src/lib/habits.ts`
- [Date logic](https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/date.ts): `src/lib/date.ts`
- [Timer logic](https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/timer.ts): `src/lib/timer.ts`

### Personal data

- [Shared state](https://github.com/dreminmx-tech/deeptracker/blob/main/src/store.tsx): `src/store.tsx`
- [Data storage](https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/storage.ts): `src/lib/storage.ts`
- [Journal logic](https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/journal.ts): `src/lib/journal.ts`

### Browser platform

- [Diagnostics](https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/diagnostics.ts): `src/lib/diagnostics.ts`
- [Back handling](https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/useBackButton.ts): `src/lib/useBackButton.ts`
- [Keyboard layout](https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/useKeyboardInset.ts): `src/lib/useKeyboardInset.ts`
- [Install prompt](https://github.com/dreminmx-tech/deeptracker/blob/main/src/lib/useInstallPrompt.ts): `src/lib/useInstallPrompt.ts`
- [Offline worker](https://github.com/dreminmx-tech/deeptracker/blob/main/public/sw.js): `public/sw.js`

### Other components

- **User**

## Connections

- User → App shell: uses (evidence: `README.md`)
- App shell → Shared state: provides state (evidence: `src/App.tsx`)
- App shell → Today view: routes to (evidence: `src/App.tsx`)
- App shell → Habits view: routes to (evidence: `src/App.tsx`)
- App shell → Journal view: routes to (evidence: `src/App.tsx`)
- App shell → Stats view: routes to (evidence: `src/App.tsx`)
- App shell → Settings view: routes to (evidence: `src/App.tsx`)
- App shell → Translations: localizes shell (evidence: `src/App.tsx`)
- App shell → Back handling: handles back (evidence: `src/App.tsx`)
- Shared state → Data storage: loads and saves (evidence: `src/store.tsx`)
- Today view → Habit actions: updates progress (evidence: `src/components/TodayView.tsx`)
- Today view → Habit logic: checks progress (evidence: `src/components/TodayView.tsx`)
- Today view → Habit row: renders rows (evidence: `src/components/TodayView.tsx`)
- Today view → Urge timer: renders urges (evidence: `src/components/TodayView.tsx`)
- Habits view → Habit editor: opens editor (evidence: `src/components/HabitsView.tsx`)
- Habits view → Habit row: renders rows (evidence: `src/components/HabitsView.tsx`)
- Habits view → Habit actions: manages habits (evidence: `src/components/HabitsView.tsx`)
- Habits view → Habit logic: reads habit state (evidence: `src/components/HabitsView.tsx`)
- Habit editor → Habit actions: saves habit (evidence: `src/components/HabitForm.tsx`)
- Urge timer → Habit actions: records outcome (evidence: `src/components/UrgeTimer.tsx`)
- Urge timer → Timer logic: gets duration (evidence: `src/components/UrgeTimer.tsx`)
- Urge timer → Habit logic: reads entry (evidence: `src/components/UrgeTimer.tsx`)
- Journal view → Journal logic: reads notes (evidence: `src/components/JournalView.tsx`)
- Journal view → Keyboard layout: adapts to keyboard (evidence: `src/components/JournalView.tsx`)
- Stats view → Habit logic: calculates stats (evidence: `src/components/StatsView.tsx`)
- Settings view → Data storage: imports and exports (evidence: `src/components/SettingsView.tsx`)
- Settings view → Habit actions: updates settings (evidence: `src/components/SettingsView.tsx`)
- Settings view → Install prompt: offers installation (evidence: `src/components/SettingsView.tsx`)
- Settings view → Diagnostics: runs diagnostics (evidence: `src/components/SettingsView.tsx`)
- Habit actions → Habit logic: uses rules (evidence: `src/lib/actions.ts`)
- Habit actions → Timer logic: uses duration (evidence: `src/lib/actions.ts`)
- Data storage → Journal logic: normalizes notes (evidence: `src/lib/storage.ts`)
- Data storage → Date logic: validates dates (evidence: `src/lib/storage.ts`)
- Data storage → Translations: seeds habits (evidence: `src/lib/storage.ts`)
- Data storage → Timer logic: uses timer defaults (evidence: `src/lib/storage.ts`)
- App shell → Offline worker: supports offline use (evidence: `README.md`)
