# achyuth072/kagelin architecture

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

- Interactive diagram: https://gitdiagram.com/achyuth072/kagelin
- Repository: https://github.com/achyuth072/kagelin

## Overview

Kagelin is an offline-first productivity PWA for tasks, habits, focus sessions, calendars, reminders, and insights; accounts add cloud sync. The main user workflow is to work with personal productivity data in the app, optionally connect calendars or an account, and review progress or export and back up data. The graph preserves the documented product branches and shows selected runtime layers. Relationships for unsampled features are included only where the README documents them; implementation details for those branches were not inspected.

Main entry points: [`src/components/layout/AppShell.tsx`](https://github.com/achyuth072/kagelin/blob/main/src/components/layout/AppShell.tsx) (App navigation), [`src/components/tasks/TaskView.tsx`](https://github.com/achyuth072/kagelin/blob/main/src/components/tasks/TaskView.tsx) (Tasks and projects), [`src/components/settings/SettingsClient.tsx`](https://github.com/achyuth072/kagelin/blob/main/src/components/settings/SettingsClient.tsx) (Settings and backup), [`app/calendar/page.tsx`](https://github.com/achyuth072/kagelin/blob/main/app/calendar/page.tsx) (Calendar)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_home["Home entry<br/>[page.tsx]"]
  node_app_shell["App navigation<br/>[AppShell.tsx]"]
  node_settings["Settings and backup<br/>[SettingsClient.tsx]"]
end

subgraph group_product["Product workflows"]
  node_tasks["Tasks and projects<br/>[TaskView.tsx]"]
  node_habits["Habits<br/>[HabitView.tsx]"]
  node_focus["Focus timer<br/>[page.tsx]"]
  node_calendar["Calendar<br/>[page.tsx]"]
end

subgraph group_data["Data and privacy"]
  node_task_queries["Task queries<br/>[useTasks.ts]"]
  node_timer_state[("Timer state<br/>[timerStore.ts]")]
  node_auth["Authentication<br/>[AuthProvider.tsx]"]
  node_supabase["Supabase client<br/>[client.ts]"]
  node_query["Query and mutations<br/>[QueryProvider.tsx]"]
  node_device_data[("Device data<br/>[uiStore.ts]")]
  node_encryption["Content encryption<br/>[keyManager.ts]"]
  node_cloud[("Cloud service")]
end

subgraph group_integrations["Integrations"]
  node_habit_api["Habit entries<br/>[route.ts]"]
  node_calendar_sync["Calendar sync<br/>[orchestrator.ts]"]
  node_calendar_api["Calendar APIs<br/>[route.ts]"]
  node_webdav["WebDAV backup<br/>[route.ts]"]
  node_calendar_providers["Calendar providers"]
end

subgraph group_operations["Reminders and insights"]
  node_stats["Stats and insights<br/>[StatsClient.tsx]"]
  node_push["Push notifications<br/>[route.ts]"]
  node_briefing["Daily briefings<br/>[index.ts]"]
end

node_user(("User"))

node_user -->|"opens"| node_home
node_home -.->|"renders"| node_app_shell
node_app_shell -.->|"navigates to"| node_tasks
node_app_shell -.->|"navigates to"| node_habits
node_app_shell -.->|"navigates to"| node_focus
node_app_shell -.->|"navigates to"| node_calendar
node_app_shell -.->|"navigates to"| node_stats
node_tasks -.->|"loads tasks"| node_task_queries
node_task_queries -->|"queries"| node_supabase
node_habits -.->|"records entries"| node_habit_api
node_focus -.->|"tracks sessions"| node_timer_state
node_calendar -.->|"syncs events"| node_calendar_sync
node_calendar -->|"discovers calendars"| node_calendar_api
node_calendar_api -.->|"connects"| node_calendar_providers
node_stats -.->|"summarizes activity"| node_task_queries
node_user -->|"signs in"| node_auth
node_auth -->|"authenticates"| node_supabase
node_tasks -.->|"uses mutations"| node_query
node_query -->|"uses client"| node_supabase
node_tasks -.->|"works offline"| node_device_data
node_settings -.->|"manages keys"| node_encryption
node_settings -.->|"backs up"| node_webdav
node_settings -.->|"enables sync"| node_cloud
node_auth -.->|"enables account sync"| node_cloud
node_push -.->|"sends reminders"| node_user
node_briefing -.->|"delivers plans"| node_user

click node_home "https://github.com/achyuth072/kagelin/blob/main/app/page.tsx"
click node_app_shell "https://github.com/achyuth072/kagelin/blob/main/src/components/layout/AppShell.tsx"
click node_tasks "https://github.com/achyuth072/kagelin/blob/main/src/components/tasks/TaskView.tsx"
click node_task_queries "https://github.com/achyuth072/kagelin/blob/main/src/lib/hooks/useTasks.ts"
click node_habits "https://github.com/achyuth072/kagelin/blob/main/src/components/habits/HabitView.tsx"
click node_habit_api "https://github.com/achyuth072/kagelin/blob/main/app/api/habits/entry/route.ts"
click node_focus "https://github.com/achyuth072/kagelin/blob/main/app/focus/page.tsx"
click node_timer_state "https://github.com/achyuth072/kagelin/blob/main/src/lib/store/timerStore.ts"
click node_calendar "https://github.com/achyuth072/kagelin/blob/main/app/calendar/page.tsx"
click node_calendar_sync "https://github.com/achyuth072/kagelin/blob/main/src/lib/sync/orchestrator.ts"
click node_calendar_api "https://github.com/achyuth072/kagelin/blob/main/app/api/calendar/discover/route.ts"
click node_stats "https://github.com/achyuth072/kagelin/blob/main/src/components/stats/StatsClient.tsx"
click node_auth "https://github.com/achyuth072/kagelin/blob/main/src/components/AuthProvider.tsx"
click node_supabase "https://github.com/achyuth072/kagelin/blob/main/src/lib/supabase/client.ts"
click node_query "https://github.com/achyuth072/kagelin/blob/main/src/components/QueryProvider.tsx"
click node_device_data "https://github.com/achyuth072/kagelin/blob/main/src/lib/store/uiStore.ts"
click node_encryption "https://github.com/achyuth072/kagelin/blob/main/src/lib/crypto/keyManager.ts"
click node_settings "https://github.com/achyuth072/kagelin/blob/main/src/components/settings/SettingsClient.tsx"
click node_webdav "https://github.com/achyuth072/kagelin/blob/main/app/api/webdav/%5B%5B...path%5D%5D/route.ts"
click node_push "https://github.com/achyuth072/kagelin/blob/main/app/api/push/send/route.ts"
click node_briefing "https://github.com/achyuth072/kagelin/blob/main/supabase/functions/daily-briefing/index.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_home,node_app_shell,node_settings,node_user toneBlue
class node_tasks,node_habits,node_focus,node_calendar toneAmber
class node_task_queries,node_timer_state,node_auth,node_supabase,node_query,node_device_data,node_encryption,node_cloud toneMint
class node_habit_api,node_calendar_sync,node_calendar_api,node_webdav,node_calendar_providers toneRose
class node_stats,node_push,node_briefing toneIndigo
```

## Components

### App experience

- [Home entry](https://github.com/achyuth072/kagelin/blob/main/app/page.tsx): `app/page.tsx`
- [App navigation](https://github.com/achyuth072/kagelin/blob/main/src/components/layout/AppShell.tsx): `src/components/layout/AppShell.tsx`
- [Settings and backup](https://github.com/achyuth072/kagelin/blob/main/src/components/settings/SettingsClient.tsx): `src/components/settings/SettingsClient.tsx`

### Product workflows

- [Tasks and projects](https://github.com/achyuth072/kagelin/blob/main/src/components/tasks/TaskView.tsx): `src/components/tasks/TaskView.tsx`
- [Habits](https://github.com/achyuth072/kagelin/blob/main/src/components/habits/HabitView.tsx): `src/components/habits/HabitView.tsx`
- [Focus timer](https://github.com/achyuth072/kagelin/blob/main/app/focus/page.tsx): `app/focus/page.tsx`
- [Calendar](https://github.com/achyuth072/kagelin/blob/main/app/calendar/page.tsx): `app/calendar/page.tsx`

### Data and privacy

- [Task queries](https://github.com/achyuth072/kagelin/blob/main/src/lib/hooks/useTasks.ts): `src/lib/hooks/useTasks.ts`
- [Timer state](https://github.com/achyuth072/kagelin/blob/main/src/lib/store/timerStore.ts): `src/lib/store/timerStore.ts`
- [Authentication](https://github.com/achyuth072/kagelin/blob/main/src/components/AuthProvider.tsx): `src/components/AuthProvider.tsx`
- [Supabase client](https://github.com/achyuth072/kagelin/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- [Query and mutations](https://github.com/achyuth072/kagelin/blob/main/src/components/QueryProvider.tsx): `src/components/QueryProvider.tsx`
- [Device data](https://github.com/achyuth072/kagelin/blob/main/src/lib/store/uiStore.ts): `src/lib/store/uiStore.ts`
- [Content encryption](https://github.com/achyuth072/kagelin/blob/main/src/lib/crypto/keyManager.ts): `src/lib/crypto/keyManager.ts`
- **Cloud service**

### Integrations

- [Habit entries](https://github.com/achyuth072/kagelin/blob/main/app/api/habits/entry/route.ts): `app/api/habits/entry/route.ts`
- [Calendar sync](https://github.com/achyuth072/kagelin/blob/main/src/lib/sync/orchestrator.ts): `src/lib/sync/orchestrator.ts`
- [Calendar APIs](https://github.com/achyuth072/kagelin/blob/main/app/api/calendar/discover/route.ts): `app/api/calendar/discover/route.ts`
- [WebDAV backup](https://github.com/achyuth072/kagelin/blob/main/app/api/webdav/%5B%5B...path%5D%5D/route.ts): `app/api/webdav/[[...path]]/route.ts`
- **Calendar providers**

### Reminders and insights

- [Stats and insights](https://github.com/achyuth072/kagelin/blob/main/src/components/stats/StatsClient.tsx): `src/components/stats/StatsClient.tsx`
- [Push notifications](https://github.com/achyuth072/kagelin/blob/main/app/api/push/send/route.ts): `app/api/push/send/route.ts`
- [Daily briefings](https://github.com/achyuth072/kagelin/blob/main/supabase/functions/daily-briefing/index.ts): `supabase/functions/daily-briefing/index.ts`

### Other components

- **User**

## Connections

- User → Home entry: opens (evidence: `app/page.tsx`)
- Home entry → App navigation: renders
- App navigation → Tasks and projects: navigates to
- App navigation → Habits: navigates to
- App navigation → Focus timer: navigates to
- App navigation → Calendar: navigates to
- App navigation → Stats and insights: navigates to
- Tasks and projects → Task queries: loads tasks
- Task queries → Supabase client: queries (evidence: `src/lib/hooks/useTasks.ts`)
- Habits → Habit entries: records entries
- Focus timer → Timer state: tracks sessions (evidence: `app/focus/page.tsx`)
- Calendar → Calendar sync: syncs events
- Calendar → Calendar APIs: discovers calendars (evidence: `app/calendar/page.tsx`)
- Calendar APIs → Calendar providers: connects
- Stats and insights → Task queries: summarizes activity
- User → Authentication: signs in (evidence: `README.md`)
- Authentication → Supabase client: authenticates (evidence: `src/components/AuthProvider.tsx`)
- Tasks and projects → Query and mutations: uses mutations
- Query and mutations → Supabase client: uses client (evidence: `src/components/QueryProvider.tsx`)
- Tasks and projects → Device data: works offline (evidence: `README.md`)
- Settings and backup → Content encryption: manages keys
- Settings and backup → WebDAV backup: backs up (evidence: `README.md`)
- Settings and backup → Cloud service: enables sync (evidence: `README.md`)
- Authentication → Cloud service: enables account sync (evidence: `README.md`)
- Push notifications → User: sends reminders (evidence: `README.md`)
- Daily briefings → User: delivers plans (evidence: `README.md`)
