# ronynn/karui architecture

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

- Interactive diagram: https://gitdiagram.com/ronynn/karui
- Repository: https://github.com/ronynn/karui

## Overview

Karui ToDo is an offline Android notes and task app whose browser-based UI manages notes and specialized features, with native Android services and receivers providing system entry points. The README describes markdown-file sync, widgets, reminders, calendar, QR sharing, customization, and quick capture. Sampled excerpts establish the frontend module wiring and several native interactions; unsampled widget and integration links are therefore left unasserted.

Main entry points: [`app/src/main/java/io/github/ronynn/karui/MainActivity.java`](https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/MainActivity.java) (App Activity), [`src/notes.js`](https://github.com/ronynn/karui/blob/master/src/notes.js) (Notes and Tasks), [`src/extras.js`](https://github.com/ronynn/karui/blob/master/src/extras.js) (Sounds and Games), [`app/src/main/java/io/github/ronynn/karui/PomodoroFloatingService.java`](https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/PomodoroFloatingService.java) (Timer Overlay)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Notes and UI"]
  node_notes["Notes and Tasks<br/>[notes.js]"]
  node_sync["Markdown Sync<br/>[datasync.js]"]
end

subgraph group_features["App Features"]
  node_calendar["Calendar<br/>[calendar.js]"]
  node_settings["Themes and Settings<br/>[settings.js]"]
  node_fonts["Custom Fonts<br/>[fonts.js]"]
  node_dragdrop["Drag and Drop<br/>[dragdrop.js]"]
  node_qr["QR Notes<br/>[qr.js]"]
  node_pomodoro["Pomodoro Timer<br/>[pomodoro.js]"]
  node_extras["Sounds and Games<br/>[extras.js]"]
  node_flap["Flappy Game<br/>[flap.js]"]
  node_lander["Lander Game<br/>[lander.js]"]
  node_snake["Snake Game<br/>[snake.js]"]
  node_crypto["Note Encryption<br/>[crypto.js]"]
end

subgraph group_android["Android Integration"]
  node_activity["App Activity<br/>[MainActivity.java]"]
  node_webbridge["Web Bridge"]
  node_floating["Quick Note Overlay"]
  node_process["Share Text Capture"]
  node_reminders["Calendar Reminders"]
  node_timeroverlay["Timer Overlay"]
end

subgraph group_system["System Surfaces"]
  node_widgets["Notes Widgets"]
  node_widgetdata["Widget Views"]
  node_scanner["QR Scanner"]
  node_tile["Quick Settings Tile"]
  node_scan_tile["Scanner Tile"]
end

node_user(("User"))
node_calendar_actor(("Android Scheduler"))

node_user -->|"opens"| node_activity
node_activity -->|"exposes"| node_webbridge
node_activity -->|"starts overlay"| node_floating
node_activity -->|"schedules"| node_reminders
node_user -->|"edits notes"| node_notes
node_notes -->|"encrypts notes"| node_crypto
node_notes -->|"checks game codes"| node_extras
node_extras -->|"runs games"| node_flap
node_extras -->|"runs games"| node_lander
node_extras -->|"runs games"| node_snake
node_calendar -->|"reads notes"| node_notes
node_settings -->|"initializes fonts"| node_fonts
node_activity -.->|"hosts interface"| node_notes
node_user -->|"configures sync"| node_sync
node_user -->|"uses widgets"| node_widgets
node_widgets -.->|"provides views"| node_widgetdata
node_calendar_actor -.->|"triggers reminders"| node_reminders
node_user -->|"activates"| node_tile
node_tile -->|"starts overlay"| node_floating
node_user -->|"shares selected text"| node_process
node_user -->|"scans QR"| node_scanner
node_scan_tile -->|"launches scanner"| node_scanner
node_pomodoro -.->|"starts timer"| node_timeroverlay
node_timeroverlay -->|"opens app"| node_activity

click node_activity "https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/MainActivity.java"
click node_webbridge "https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/WebAppInterface.java"
click node_notes "https://github.com/ronynn/karui/blob/master/src/notes.js"
click node_sync "https://github.com/ronynn/karui/blob/master/src/datasync.js"
click node_calendar "https://github.com/ronynn/karui/blob/master/src/calendar.js"
click node_settings "https://github.com/ronynn/karui/blob/master/src/settings.js"
click node_fonts "https://github.com/ronynn/karui/blob/master/src/fonts.js"
click node_dragdrop "https://github.com/ronynn/karui/blob/master/src/dragdrop.js"
click node_qr "https://github.com/ronynn/karui/blob/master/src/qr.js"
click node_pomodoro "https://github.com/ronynn/karui/blob/master/src/pomodoro.js"
click node_extras "https://github.com/ronynn/karui/blob/master/src/extras.js"
click node_flap "https://github.com/ronynn/karui/blob/master/src/flap.js"
click node_lander "https://github.com/ronynn/karui/blob/master/src/lander.js"
click node_snake "https://github.com/ronynn/karui/blob/master/src/snake.js"
click node_crypto "https://github.com/ronynn/karui/blob/master/src/crypto.js"
click node_floating "https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/FloatingWindowService.java"
click node_process "https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/ProcessTextActivity.java"
click node_reminders "https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/CalendarNotificationReceiver.java"
click node_timeroverlay "https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/PomodoroFloatingService.java"
click node_widgets "https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/NotesWidgetProvider.java"
click node_widgetdata "https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/NotesRemoteViewsFactory.java"
click node_scanner "https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/ScannerActivity.java"
click node_tile "https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/KaruiTileService.java"
click node_scan_tile "https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/KaruiScanTileService.java"

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_notes,node_sync,node_user toneBlue
class node_calendar,node_settings,node_fonts,node_dragdrop,node_qr,node_pomodoro,node_extras,node_flap,node_lander,node_snake,node_crypto toneAmber
class node_activity,node_webbridge,node_floating,node_process,node_reminders,node_timeroverlay toneMint
class node_widgets,node_widgetdata,node_scanner,node_tile,node_scan_tile,node_calendar_actor toneRose
```

## Components

### Notes and UI

- [Notes and Tasks](https://github.com/ronynn/karui/blob/master/src/notes.js): `src/notes.js`
- [Markdown Sync](https://github.com/ronynn/karui/blob/master/src/datasync.js): `src/datasync.js`

### App Features

- [Calendar](https://github.com/ronynn/karui/blob/master/src/calendar.js): `src/calendar.js`
- [Themes and Settings](https://github.com/ronynn/karui/blob/master/src/settings.js): `src/settings.js`
- [Custom Fonts](https://github.com/ronynn/karui/blob/master/src/fonts.js): `src/fonts.js`
- [Drag and Drop](https://github.com/ronynn/karui/blob/master/src/dragdrop.js): `src/dragdrop.js`
- [QR Notes](https://github.com/ronynn/karui/blob/master/src/qr.js): `src/qr.js`
- [Pomodoro Timer](https://github.com/ronynn/karui/blob/master/src/pomodoro.js): `src/pomodoro.js`
- [Sounds and Games](https://github.com/ronynn/karui/blob/master/src/extras.js): `src/extras.js`
- [Flappy Game](https://github.com/ronynn/karui/blob/master/src/flap.js): `src/flap.js`
- [Lander Game](https://github.com/ronynn/karui/blob/master/src/lander.js): `src/lander.js`
- [Snake Game](https://github.com/ronynn/karui/blob/master/src/snake.js): `src/snake.js`
- [Note Encryption](https://github.com/ronynn/karui/blob/master/src/crypto.js): `src/crypto.js`

### Android Integration

- [App Activity](https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/MainActivity.java): `app/src/main/java/io/github/ronynn/karui/MainActivity.java`
- [Web Bridge](https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/WebAppInterface.java): `app/src/main/java/io/github/ronynn/karui/WebAppInterface.java`
- [Quick Note Overlay](https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/FloatingWindowService.java): `app/src/main/java/io/github/ronynn/karui/FloatingWindowService.java`
- [Share Text Capture](https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/ProcessTextActivity.java): `app/src/main/java/io/github/ronynn/karui/ProcessTextActivity.java`
- [Calendar Reminders](https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/CalendarNotificationReceiver.java): `app/src/main/java/io/github/ronynn/karui/CalendarNotificationReceiver.java`
- [Timer Overlay](https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/PomodoroFloatingService.java): `app/src/main/java/io/github/ronynn/karui/PomodoroFloatingService.java`

### System Surfaces

- [Notes Widgets](https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/NotesWidgetProvider.java): `app/src/main/java/io/github/ronynn/karui/NotesWidgetProvider.java`
- [Widget Views](https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/NotesRemoteViewsFactory.java): `app/src/main/java/io/github/ronynn/karui/NotesRemoteViewsFactory.java`
- [QR Scanner](https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/ScannerActivity.java): `app/src/main/java/io/github/ronynn/karui/ScannerActivity.java`
- [Quick Settings Tile](https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/KaruiTileService.java): `app/src/main/java/io/github/ronynn/karui/KaruiTileService.java`
- [Scanner Tile](https://github.com/ronynn/karui/blob/master/app/src/main/java/io/github/ronynn/karui/KaruiScanTileService.java): `app/src/main/java/io/github/ronynn/karui/KaruiScanTileService.java`

### Other components

- **User**
- **Android Scheduler**

## Connections

- User → App Activity: opens
- App Activity → Web Bridge: exposes (evidence: `app/src/main/java/io/github/ronynn/karui/MainActivity.java`)
- App Activity → Quick Note Overlay: starts overlay (evidence: `app/src/main/java/io/github/ronynn/karui/MainActivity.java`)
- App Activity → Calendar Reminders: schedules (evidence: `app/src/main/java/io/github/ronynn/karui/MainActivity.java`)
- User → Notes and Tasks: edits notes
- Notes and Tasks → Note Encryption: encrypts notes (evidence: `src/notes.js`)
- Notes and Tasks → Sounds and Games: checks game codes (evidence: `src/notes.js`)
- Sounds and Games → Flappy Game: runs games (evidence: `src/extras.js`)
- Sounds and Games → Lander Game: runs games (evidence: `src/extras.js`)
- Sounds and Games → Snake Game: runs games (evidence: `src/extras.js`)
- Calendar → Notes and Tasks: reads notes (evidence: `src/calendar.js`)
- Themes and Settings → Custom Fonts: initializes fonts (evidence: `src/settings.js`)
- App Activity → Notes and Tasks: hosts interface
- User → Markdown Sync: configures sync
- User → Notes Widgets: uses widgets
- Notes Widgets → Widget Views: provides views
- Android Scheduler → Calendar Reminders: triggers reminders
- User → Quick Settings Tile: activates (evidence: `app/src/main/java/io/github/ronynn/karui/KaruiTileService.java`)
- Quick Settings Tile → Quick Note Overlay: starts overlay (evidence: `app/src/main/java/io/github/ronynn/karui/KaruiTileService.java`)
- User → Share Text Capture: shares selected text
- User → QR Scanner: scans QR
- Scanner Tile → QR Scanner: launches scanner (evidence: `app/src/main/java/io/github/ronynn/karui/KaruiScanTileService.java`)
- Pomodoro Timer → Timer Overlay: starts timer
- Timer Overlay → App Activity: opens app (evidence: `app/src/main/java/io/github/ronynn/karui/PomodoroFloatingService.java`)
