# omsai29-ctrl/daycraft architecture

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

- Interactive diagram: https://gitdiagram.com/omsai29-ctrl/daycraft
- Repository: https://github.com/omsai29-ctrl/daycraft

## Overview

My Planner is an offline-first personal planner, usable as a web app or installable PWA, with optional Supabase account sync and an Android file plugin. The main user workflow is to manage schedules and study-life records in the planner, keep changes locally, and optionally sign in to sync across devices. The JavaScript source index identifies the main domain modules, but excerpts do not show most of their call wiring; edges are limited to relationships documented in the README or visible in excerpts.

Main entry points: [`src/js/08-sync.js`](https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/08-sync.js) (Cloud sync and auth), [`android/app/src/main/java/com/omsai/daycraft/DaycraftFilesPlugin.java`](https://github.com/omsai29-ctrl/daycraft/blob/main/android/app/src/main/java/com/omsai/daycraft/DaycraftFilesPlugin.java) (Android file access), [`src/js/01-core.js`](https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/01-core.js) (State and persistence), [`src/js/06-forms.js`](https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/06-forms.js) (Forms and attachments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Planner app"]
  node_shell["Navigation and events<br/>[07-events.js]"]
  node_core["State and persistence<br/>[01-core.js]"]
  node_logic["Scheduling logic<br/>[02-logic.js]"]
  node_views["Dashboard and views<br/>[03-views-a.js]"]
  node_forms["Forms and attachments<br/>[06-forms.js]"]
  node_pwa["PWA install and offline shell<br/>[sw.js]"]
  node_manifest["PWA manifest"]
end

subgraph group_planning["Planning"]
  node_planner_views["Planner and task views<br/>[04-views-b.js]"]
  node_timetable["Timetable<br/>[09-timetable.js]"]
end

subgraph group_tracking["Study and tracking"]
  node_study_views["Study and review views<br/>[05-views-c.js]"]
  node_flashcards["Flashcards<br/>[09-flashcards.js]"]
end

subgraph group_sync["Storage and sync"]
  node_local[("Browser local storage")]
  node_sync_module["Cloud sync and auth<br/>[08-sync.js]"]
  node_supabase[("Supabase")]
end

subgraph group_device["Device files"]
  node_android_entry["Android app entry<br/>[MainActivity.java]"]
  node_files_plugin["Android file access"]
end

node_user(("Planner user"))

node_user -->|"uses planner"| node_shell
node_user -->|"signs in"| node_sync_module
node_sync_module -->|"syncs data"| node_supabase
node_core -->|"caches changes"| node_local
node_android_entry -->|"registers plugin"| node_files_plugin
node_forms -.->|"requests device files"| node_files_plugin

click node_shell "https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/07-events.js"
click node_core "https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/01-core.js"
click node_logic "https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/02-logic.js"
click node_views "https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/03-views-a.js"
click node_planner_views "https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/04-views-b.js"
click node_study_views "https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/05-views-c.js"
click node_forms "https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/06-forms.js"
click node_timetable "https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/09-timetable.js"
click node_flashcards "https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/09-flashcards.js"
click node_sync_module "https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/08-sync.js"
click node_pwa "https://github.com/omsai29-ctrl/daycraft/blob/main/dist/sw.js"
click node_manifest "https://github.com/omsai29-ctrl/daycraft/blob/main/dist/manifest.webmanifest"
click node_android_entry "https://github.com/omsai29-ctrl/daycraft/blob/main/android/app/src/main/java/com/omsai/daycraft/MainActivity.java"
click node_files_plugin "https://github.com/omsai29-ctrl/daycraft/blob/main/android/app/src/main/java/com/omsai/daycraft/DaycraftFilesPlugin.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_shell,node_core,node_logic,node_views,node_forms,node_pwa,node_manifest,node_user toneBlue
class node_planner_views,node_timetable toneAmber
class node_study_views,node_flashcards toneMint
class node_local,node_sync_module,node_supabase toneRose
class node_android_entry,node_files_plugin toneIndigo
```

## Components

### Planner app

- [Navigation and events](https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/07-events.js): `src/js/07-events.js`
- [State and persistence](https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/01-core.js): `src/js/01-core.js`
- [Scheduling logic](https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/02-logic.js): `src/js/02-logic.js`
- [Dashboard and views](https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/03-views-a.js): `src/js/03-views-a.js`
- [Forms and attachments](https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/06-forms.js): `src/js/06-forms.js`
- [PWA install and offline shell](https://github.com/omsai29-ctrl/daycraft/blob/main/dist/sw.js): `dist/sw.js`
- [PWA manifest](https://github.com/omsai29-ctrl/daycraft/blob/main/dist/manifest.webmanifest): `dist/manifest.webmanifest`

### Planning

- [Planner and task views](https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/04-views-b.js): `src/js/04-views-b.js`
- [Timetable](https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/09-timetable.js): `src/js/09-timetable.js`

### Study and tracking

- [Study and review views](https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/05-views-c.js): `src/js/05-views-c.js`
- [Flashcards](https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/09-flashcards.js): `src/js/09-flashcards.js`

### Storage and sync

- **Browser local storage**
- [Cloud sync and auth](https://github.com/omsai29-ctrl/daycraft/blob/main/src/js/08-sync.js): `src/js/08-sync.js`
- **Supabase**

### Device files

- [Android app entry](https://github.com/omsai29-ctrl/daycraft/blob/main/android/app/src/main/java/com/omsai/daycraft/MainActivity.java): `android/app/src/main/java/com/omsai/daycraft/MainActivity.java`
- [Android file access](https://github.com/omsai29-ctrl/daycraft/blob/main/android/app/src/main/java/com/omsai/daycraft/DaycraftFilesPlugin.java): `android/app/src/main/java/com/omsai/daycraft/DaycraftFilesPlugin.java`

### Other components

- **Planner user**

## Connections

- Planner user → Navigation and events: uses planner (evidence: `README.md`)
- Planner user → Cloud sync and auth: signs in (evidence: `README.md`)
- Cloud sync and auth → Supabase: syncs data (evidence: `README.md`)
- State and persistence → Browser local storage: caches changes (evidence: `README.md`)
- Android app entry → Android file access: registers plugin (evidence: `android/app/src/main/java/com/omsai/daycraft/MainActivity.java`)
- Forms and attachments → Android file access: requests device files
