# rohittrv7/streakly architecture

> Architecture diagram of the GitHub repository rohittrv7/streakly, 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/rohittrv7/streakly
- Repository: https://github.com/rohittrv7/streakly

## Overview

Streakly is a local-first mobile app for habit streaks, planning, focus sessions, and progress review. Users enter through the app’s screens, record activity in those domain features, and retain data locally; statistics turn tracked activity into visual summaries. Other documented capabilities include YouTube study playlists, notifications, backups, themes, and English/Roman Hinglish localization. Relationships beyond the sampled plan-month and notification-handler code rely on README documentation; the supplied excerpts do not show every feature’s runtime wiring.

Main entry points: [`src/app`](https://github.com/rohittrv7/streakly/tree/main/src/app) (App screens), [`src/features/stats/aggregate-tasks.ts`](https://github.com/rohittrv7/streakly/blob/main/src/features/stats/aggregate-tasks.ts) (Progress statistics), [`src/lib/notifications/handlers.ts`](https://github.com/rohittrv7/streakly/blob/main/src/lib/notifications/handlers.ts) (Notification handling), [`src/features/habits/streak.ts`](https://github.com/rohittrv7/streakly/blob/main/src/features/habits/streak.ts) (Habit tracking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_screens["App screens"]
  node_today["Today view<br/>[TodayBentoGrid.tsx]"]
  node_ui["UI components<br/>[Screen.tsx]"]
end

subgraph group_tracking["Activity tracking"]
  node_habits["Habit tracking<br/>[streak.ts]"]
  node_planner["Planner tasks<br/>[repo.ts]"]
  node_focus["Focus timer<br/>[timer.ts]"]
  node_stats["Progress statistics<br/>[aggregate-tasks.ts]"]
  node_youtube["YouTube study<br/>[YouTubeSection.tsx]"]
end

subgraph group_services["Local services"]
  node_sqlite[("Local database<br/>[client.ts]")]
  node_notifications["Notification planning<br/>[plan.ts]"]
  node_notification_handler["Notification handling<br/>[handlers.ts]"]
end

subgraph group_support["App support"]
  node_backup["Backup and restore<br/>[export.ts]"]
  node_settings["Settings<br/>[repo.ts]"]
  node_themes["Accent themes<br/>[store.ts]"]
  node_localization["Localization<br/>[t.ts]"]
end

node_user(("User"))
node_notification_os["Device notifications"]
node_youtube_api["YouTube API"]

node_user -->|"uses"| node_screens
node_screens -->|"shows"| node_today
node_screens -->|"supports"| node_habits
node_screens -->|"supports"| node_planner
node_screens -->|"supports"| node_focus
node_screens -->|"shows"| node_stats
node_screens -->|"supports"| node_youtube
node_screens -->|"uses"| node_ui
node_planner -->|"persists tasks"| node_sqlite
node_habits -->|"stores activity"| node_sqlite
node_focus -->|"logs sessions"| node_sqlite
node_stats -->|"summarizes"| node_habits
node_stats -->|"summarizes"| node_planner
node_stats -->|"summarizes"| node_focus
node_youtube -.->|"imports playlists"| node_youtube_api
node_screens -->|"configures"| node_notifications
node_notifications -->|"schedules"| node_notification_os
node_notification_os -->|"delivers responses"| node_notification_handler
node_notification_handler -->|"checks tasks"| node_planner
node_notification_handler -->|"checks completions"| node_habits
node_notification_handler -->|"updates focus"| node_focus
node_screens -->|"exports or restores"| node_backup
node_screens -->|"configures"| node_settings
node_settings -->|"stores preferences"| node_sqlite
node_screens -->|"selects accents"| node_themes
node_screens -->|"displays translations"| node_localization

click node_screens "https://github.com/rohittrv7/streakly/tree/main/src/app"
click node_today "https://github.com/rohittrv7/streakly/blob/main/src/features/today/components/TodayBentoGrid.tsx"
click node_ui "https://github.com/rohittrv7/streakly/blob/main/src/components/ui/Screen.tsx"
click node_habits "https://github.com/rohittrv7/streakly/blob/main/src/features/habits/streak.ts"
click node_planner "https://github.com/rohittrv7/streakly/blob/main/src/features/planner/repo.ts"
click node_focus "https://github.com/rohittrv7/streakly/blob/main/src/features/focus/timer.ts"
click node_stats "https://github.com/rohittrv7/streakly/blob/main/src/features/stats/aggregate-tasks.ts"
click node_youtube "https://github.com/rohittrv7/streakly/blob/main/src/features/youtube/components/YouTubeSection.tsx"
click node_sqlite "https://github.com/rohittrv7/streakly/blob/main/src/lib/db/client.ts"
click node_notifications "https://github.com/rohittrv7/streakly/blob/main/src/lib/notifications/plan.ts"
click node_notification_handler "https://github.com/rohittrv7/streakly/blob/main/src/lib/notifications/handlers.ts"
click node_backup "https://github.com/rohittrv7/streakly/blob/main/src/features/settings/backup/export.ts"
click node_settings "https://github.com/rohittrv7/streakly/blob/main/src/features/settings/repo.ts"
click node_themes "https://github.com/rohittrv7/streakly/blob/main/src/lib/theme/store.ts"
click node_localization "https://github.com/rohittrv7/streakly/blob/main/src/core/i18n/t.ts"

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_screens,node_today,node_ui,node_user toneBlue
class node_habits,node_planner,node_focus,node_stats,node_youtube toneAmber
class node_sqlite,node_notifications,node_notification_handler,node_youtube_api toneMint
class node_backup,node_settings,node_themes,node_localization toneRose
class node_notification_os toneIndigo
```

## Components

### App experience

- [App screens](https://github.com/rohittrv7/streakly/tree/main/src/app): `src/app`
- [Today view](https://github.com/rohittrv7/streakly/blob/main/src/features/today/components/TodayBentoGrid.tsx): `src/features/today/components/TodayBentoGrid.tsx`
- [UI components](https://github.com/rohittrv7/streakly/blob/main/src/components/ui/Screen.tsx): `src/components/ui/Screen.tsx`

### Activity tracking

- [Habit tracking](https://github.com/rohittrv7/streakly/blob/main/src/features/habits/streak.ts): `src/features/habits/streak.ts`
- [Planner tasks](https://github.com/rohittrv7/streakly/blob/main/src/features/planner/repo.ts): `src/features/planner/repo.ts`
- [Focus timer](https://github.com/rohittrv7/streakly/blob/main/src/features/focus/timer.ts): `src/features/focus/timer.ts`
- [Progress statistics](https://github.com/rohittrv7/streakly/blob/main/src/features/stats/aggregate-tasks.ts): `src/features/stats/aggregate-tasks.ts`
- [YouTube study](https://github.com/rohittrv7/streakly/blob/main/src/features/youtube/components/YouTubeSection.tsx): `src/features/youtube/components/YouTubeSection.tsx`

### Local services

- [Local database](https://github.com/rohittrv7/streakly/blob/main/src/lib/db/client.ts): `src/lib/db/client.ts`
- [Notification planning](https://github.com/rohittrv7/streakly/blob/main/src/lib/notifications/plan.ts): `src/lib/notifications/plan.ts`
- [Notification handling](https://github.com/rohittrv7/streakly/blob/main/src/lib/notifications/handlers.ts): `src/lib/notifications/handlers.ts`

### App support

- [Backup and restore](https://github.com/rohittrv7/streakly/blob/main/src/features/settings/backup/export.ts): `src/features/settings/backup/export.ts`
- [Settings](https://github.com/rohittrv7/streakly/blob/main/src/features/settings/repo.ts): `src/features/settings/repo.ts`
- [Accent themes](https://github.com/rohittrv7/streakly/blob/main/src/lib/theme/store.ts): `src/lib/theme/store.ts`
- [Localization](https://github.com/rohittrv7/streakly/blob/main/src/core/i18n/t.ts): `src/core/i18n/t.ts`

### Other components

- **User**
- **Device notifications**
- **YouTube API**

## Connections

- User → App screens: uses (evidence: `README.md`)
- App screens → Today view: shows (evidence: `README.md`)
- App screens → Habit tracking: supports (evidence: `README.md`)
- App screens → Planner tasks: supports (evidence: `README.md`)
- App screens → Focus timer: supports (evidence: `README.md`)
- App screens → Progress statistics: shows (evidence: `README.md`)
- App screens → YouTube study: supports (evidence: `README.md`)
- App screens → UI components: uses (evidence: `README.md`)
- Planner tasks → Local database: persists tasks (evidence: `README.md`)
- Habit tracking → Local database: stores activity (evidence: `README.md`)
- Focus timer → Local database: logs sessions (evidence: `README.md`)
- Progress statistics → Habit tracking: summarizes (evidence: `README.md`)
- Progress statistics → Planner tasks: summarizes (evidence: `README.md`)
- Progress statistics → Focus timer: summarizes (evidence: `src/features/stats/aggregate-tasks.ts`)
- YouTube study → YouTube API: imports playlists (evidence: `README.md`)
- App screens → Notification planning: configures (evidence: `README.md`)
- Notification planning → Device notifications: schedules (evidence: `README.md`)
- Device notifications → Notification handling: delivers responses (evidence: `src/lib/notifications/handlers.ts`)
- Notification handling → Planner tasks: checks tasks (evidence: `src/lib/notifications/handlers.ts`)
- Notification handling → Habit tracking: checks completions (evidence: `src/lib/notifications/handlers.ts`)
- Notification handling → Focus timer: updates focus (evidence: `src/lib/notifications/handlers.ts`)
- App screens → Backup and restore: exports or restores (evidence: `README.md`)
- App screens → Settings: configures (evidence: `README.md`)
- Settings → Local database: stores preferences (evidence: `README.md`)
- App screens → Accent themes: selects accents (evidence: `README.md`)
- App screens → Localization: displays translations (evidence: `README.md`)
