# bryantanjy/duewise architecture

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

- Interactive diagram: https://gitdiagram.com/bryantanjy/duewise
- Repository: https://github.com/bryantanjy/duewise

## Overview

Duewise is a local-first reminders app: users create dated reminders, configure recurrence and advance alerts, then track, complete, snooze, archive, or restore them. The app stores reminder state in SQLite and schedules device notifications; the README says there is no backend for local reminder flows. Backup/restore, calendar, widgets, appearance, and optional cloud sync are separate capabilities. Some feature routes were not sampled, so their connections below rely on README documentation rather than inspected call sites.

Main entry points: [`src/db/index.ts`](https://github.com/bryantanjy/duewise/blob/master/src/db/index.ts) (SQLite database), [`src/app/(tabs)/index.tsx`](https://github.com/bryantanjy/duewise/blob/master/src/app/(tabs)/index.tsx) (Home dashboard), [`src/services/item-operations.ts`](https://github.com/bryantanjy/duewise/blob/master/src/services/item-operations.ts) (Reminder operations), [`src/services/items.ts`](https://github.com/bryantanjy/duewise/blob/master/src/services/items.ts) (Item service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_dashboard["Home dashboard<br/>[index.tsx]"]
  node_library["Reminder library<br/>[items.tsx]"]
  node_calendar["Calendar<br/>[calendar.tsx]"]
  node_form["Reminder form<br/>[new.tsx]"]
  node_details["Reminder details"]
  node_archive["Archive<br/>[archived.tsx]"]
end

subgraph group_reminders["Reminder lifecycle"]
  node_operations["Reminder operations<br/>[item-operations.ts]"]
  node_items["Item service<br/>[items.ts]"]
  node_recurrence["Recurrence rules<br/>[recurrence.ts]"]
  node_reminder_time["Reminder timing<br/>[reminder-time.ts]"]
  node_status["Reminder status<br/>[reminder-status.ts]"]
end

subgraph group_platform["Device features"]
  node_notifications["Device notifications<br/>[notifications.ts]"]
  node_widget["Home widget<br/>[home-widget.ts]"]
  node_widget_model["Widget data model<br/>[widget-model.ts]"]
  node_appearance["Appearance preferences<br/>[appearance.tsx]"]
  node_theme["Theme palette<br/>[theme.ts]"]
end

subgraph group_data["Local data"]
  node_database[("SQLite database<br/>[index.ts]")]
  node_schema["Reminder schema<br/>[schema.ts]"]
  node_migrations["Startup migrations"]
end

subgraph group_extensions["Optional extensions"]
  node_backup["Backup and restore<br/>[backup.ts]"]
  node_calendar_export["Calendar export<br/>[calendar-export.ts]"]
  node_cloud_sync["Optional cloud sync<br/>[cloud-sync.ts]"]
end

node_user(("User"))
node_cloud_service{{"Cloud service"}}

node_user -->|"opens app"| node_dashboard
node_user -->|"creates reminder"| node_form
node_user -->|"manages reminders"| node_library
node_user -->|"views dates"| node_calendar
node_dashboard -->|"opens form"| node_form
node_dashboard -->|"opens reminder"| node_details
node_form -->|"creates item"| node_items
node_details -->|"manages item"| node_items
node_library -->|"lists reminders"| node_items
node_calendar -->|"previews occurrences"| node_recurrence
node_items -->|"delegates mutations"| node_operations
node_operations -->|"reads and writes"| node_database
node_database -->|"uses schema"| node_schema
node_operations -->|"schedules alerts"| node_notifications
node_operations -->|"advances repeats"| node_recurrence
node_notifications -->|"calculates alert time"| node_reminder_time
node_details -->|"shows alert status"| node_status
node_dashboard -->|"queries reminders"| node_database
node_migrations -->|"migrates storage"| node_database
node_user -->|"restores or archives"| node_archive
node_user -->|"backs up data"| node_backup
node_backup -->|"exports and restores"| node_database
node_user -.->|"exports dates"| node_calendar_export
node_user -->|"adds widget"| node_widget
node_widget -->|"builds display data"| node_widget_model
node_user -->|"sets appearance"| node_appearance
node_appearance -->|"selects palette"| node_theme
node_user -->|"enables sync"| node_cloud_sync
node_cloud_sync -.->|"syncs remotely"| node_cloud_service

click node_dashboard "https://github.com/bryantanjy/duewise/blob/master/src/app/(tabs)/index.tsx"
click node_library "https://github.com/bryantanjy/duewise/blob/master/src/app/(tabs)/items.tsx"
click node_calendar "https://github.com/bryantanjy/duewise/blob/master/src/app/(tabs)/calendar.tsx"
click node_form "https://github.com/bryantanjy/duewise/blob/master/src/app/item/new.tsx"
click node_details "https://github.com/bryantanjy/duewise/blob/master/src/components/items/ItemDetailsContent.tsx"
click node_archive "https://github.com/bryantanjy/duewise/blob/master/src/app/archived.tsx"
click node_operations "https://github.com/bryantanjy/duewise/blob/master/src/services/item-operations.ts"
click node_items "https://github.com/bryantanjy/duewise/blob/master/src/services/items.ts"
click node_recurrence "https://github.com/bryantanjy/duewise/blob/master/src/utils/recurrence.ts"
click node_reminder_time "https://github.com/bryantanjy/duewise/blob/master/src/utils/reminder-time.ts"
click node_status "https://github.com/bryantanjy/duewise/blob/master/src/utils/reminder-status.ts"
click node_notifications "https://github.com/bryantanjy/duewise/blob/master/src/services/notifications.ts"
click node_widget "https://github.com/bryantanjy/duewise/blob/master/src/services/home-widget.ts"
click node_widget_model "https://github.com/bryantanjy/duewise/blob/master/src/utils/widget-model.ts"
click node_appearance "https://github.com/bryantanjy/duewise/blob/master/src/contexts/appearance.tsx"
click node_theme "https://github.com/bryantanjy/duewise/blob/master/src/constants/theme.ts"
click node_database "https://github.com/bryantanjy/duewise/blob/master/src/db/index.ts"
click node_schema "https://github.com/bryantanjy/duewise/blob/master/src/db/schema.ts"
click node_migrations "https://github.com/bryantanjy/duewise/blob/master/src/hooks/use-database-migrations.ts"
click node_backup "https://github.com/bryantanjy/duewise/blob/master/src/services/backup.ts"
click node_calendar_export "https://github.com/bryantanjy/duewise/blob/master/src/services/calendar-export.ts"
click node_cloud_sync "https://github.com/bryantanjy/duewise/blob/master/src/services/cloud-sync.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_dashboard,node_library,node_calendar,node_form,node_details,node_archive,node_user toneBlue
class node_operations,node_items,node_recurrence,node_reminder_time,node_status toneAmber
class node_notifications,node_widget,node_widget_model,node_appearance,node_theme toneMint
class node_database,node_schema,node_migrations toneRose
class node_backup,node_calendar_export,node_cloud_sync,node_cloud_service toneIndigo
```

## Components

### App experience

- [Home dashboard](https://github.com/bryantanjy/duewise/blob/master/src/app/(tabs)/index.tsx): `src/app/(tabs)/index.tsx`
- [Reminder library](https://github.com/bryantanjy/duewise/blob/master/src/app/(tabs)/items.tsx): `src/app/(tabs)/items.tsx`
- [Calendar](https://github.com/bryantanjy/duewise/blob/master/src/app/(tabs)/calendar.tsx): `src/app/(tabs)/calendar.tsx`
- [Reminder form](https://github.com/bryantanjy/duewise/blob/master/src/app/item/new.tsx): `src/app/item/new.tsx`
- [Reminder details](https://github.com/bryantanjy/duewise/blob/master/src/components/items/ItemDetailsContent.tsx): `src/components/items/ItemDetailsContent.tsx`
- [Archive](https://github.com/bryantanjy/duewise/blob/master/src/app/archived.tsx): `src/app/archived.tsx`

### Reminder lifecycle

- [Reminder operations](https://github.com/bryantanjy/duewise/blob/master/src/services/item-operations.ts): `src/services/item-operations.ts`
- [Item service](https://github.com/bryantanjy/duewise/blob/master/src/services/items.ts): `src/services/items.ts`
- [Recurrence rules](https://github.com/bryantanjy/duewise/blob/master/src/utils/recurrence.ts): `src/utils/recurrence.ts`
- [Reminder timing](https://github.com/bryantanjy/duewise/blob/master/src/utils/reminder-time.ts): `src/utils/reminder-time.ts`
- [Reminder status](https://github.com/bryantanjy/duewise/blob/master/src/utils/reminder-status.ts): `src/utils/reminder-status.ts`

### Device features

- [Device notifications](https://github.com/bryantanjy/duewise/blob/master/src/services/notifications.ts): `src/services/notifications.ts`
- [Home widget](https://github.com/bryantanjy/duewise/blob/master/src/services/home-widget.ts): `src/services/home-widget.ts`
- [Widget data model](https://github.com/bryantanjy/duewise/blob/master/src/utils/widget-model.ts): `src/utils/widget-model.ts`
- [Appearance preferences](https://github.com/bryantanjy/duewise/blob/master/src/contexts/appearance.tsx): `src/contexts/appearance.tsx`
- [Theme palette](https://github.com/bryantanjy/duewise/blob/master/src/constants/theme.ts): `src/constants/theme.ts`

### Local data

- [SQLite database](https://github.com/bryantanjy/duewise/blob/master/src/db/index.ts): `src/db/index.ts`
- [Reminder schema](https://github.com/bryantanjy/duewise/blob/master/src/db/schema.ts): `src/db/schema.ts`
- [Startup migrations](https://github.com/bryantanjy/duewise/blob/master/src/hooks/use-database-migrations.ts): `src/hooks/use-database-migrations.ts`

### Optional extensions

- [Backup and restore](https://github.com/bryantanjy/duewise/blob/master/src/services/backup.ts): `src/services/backup.ts`
- [Calendar export](https://github.com/bryantanjy/duewise/blob/master/src/services/calendar-export.ts): `src/services/calendar-export.ts`
- [Optional cloud sync](https://github.com/bryantanjy/duewise/blob/master/src/services/cloud-sync.ts): `src/services/cloud-sync.ts`

### Other components

- **User**
- **Cloud service**

## Connections

- User → Home dashboard: opens app
- User → Reminder form: creates reminder
- User → Reminder library: manages reminders
- User → Calendar: views dates
- Home dashboard → Reminder form: opens form (evidence: `src/app/(tabs)/index.tsx`)
- Home dashboard → Reminder details: opens reminder (evidence: `src/app/(tabs)/index.tsx`)
- Reminder form → Item service: creates item (evidence: `src/app/item/new.tsx`)
- Reminder details → Item service: manages item
- Reminder library → Item service: lists reminders
- Calendar → Recurrence rules: previews occurrences
- Item service → Reminder operations: delegates mutations (evidence: `src/services/items.ts`)
- Reminder operations → SQLite database: reads and writes (evidence: `src/services/items.ts`)
- SQLite database → Reminder schema: uses schema (evidence: `src/services/items.ts`)
- Reminder operations → Device notifications: schedules alerts (evidence: `src/services/items.ts`)
- Reminder operations → Recurrence rules: advances repeats (evidence: `src/services/item-operations.ts`)
- Device notifications → Reminder timing: calculates alert time (evidence: `src/services/notifications.ts`)
- Reminder details → Reminder status: shows alert status (evidence: `src/components/items/ItemDetailsContent.tsx`)
- Home dashboard → SQLite database: queries reminders (evidence: `src/app/(tabs)/index.tsx`)
- Startup migrations → SQLite database: migrates storage (evidence: `src/hooks/use-database-migrations.ts`)
- User → Archive: restores or archives
- User → Backup and restore: backs up data
- Backup and restore → SQLite database: exports and restores
- User → Calendar export: exports dates
- User → Home widget: adds widget
- Home widget → Widget data model: builds display data
- User → Appearance preferences: sets appearance
- Appearance preferences → Theme palette: selects palette
- User → Optional cloud sync: enables sync
- Optional cloud sync → Cloud service: syncs remotely
