# ytani01/ytsched architecture

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

- Interactive diagram: https://gitdiagram.com/ytani01/ytsched
- Repository: https://github.com/ytani01/ytsched

## Overview

YtSched is a single-user personal scheduler: a browser user views and edits weekly schedules, while a CLI user can run utility commands such as holiday import, migration, and text notifications. The web request handler coordinates schedule loading, display construction, updates, settings, attachments, and trash; the browser provides week navigation and schedule controls. The README documents additional features whose detailed wiring was not sampled, so those links are marked unverified rather than inferred from module names.

Main entry points: [`src/ytsched/main_handler.py`](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/main_handler.py) (Main request handler), [`src/ytsched/ytsched.py`](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/ytsched.py) (Schedule data and JSONL), [`src/ytsched/trash_handler.py`](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/trash_handler.py) (Trash handler), [`src/ytsched/webapp.py`](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/webapp.py) (Web server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_web_server["Web server<br/>[webapp.py]"]
  node_main_request["Main request handler<br/>[main_handler.py]"]
  node_edit_request["Edit handler<br/>[edit_handler.py]"]
  node_trash_request["Trash handler<br/>[trash_handler.py]"]
  node_week_ui["Weekly schedule UI<br/>[week.js]"]
  node_main_ui["Schedule controls<br/>[main-page.js]"]
  node_navigation_ui["Week navigation<br/>[nav.js]"]
  node_gauge_ui["Date gauge<br/>[gauge.js]"]
  node_swipe_ui["Swipe navigation<br/>[swipe.js]"]
end

subgraph group_core["Schedule core"]
  node_binder["Display and settings binder<br/>[main_binder.py]"]
  node_view_builder["Schedule view builder<br/>[main_view.py]"]
  node_schedule_loader["Schedule loader<br/>[sched_load.py]"]
  node_schedule_updater["Schedule updater<br/>[sched_update.py]"]
  node_schedule_data[("Schedule data and JSONL<br/>[ytsched.py]")]
end

subgraph group_records["Records and recovery"]
  node_attachments[("Attachment store<br/>[attach.py]")]
  node_trash_store[("Trash archive<br/>[trash.py]")]
  node_configuration[("Configuration<br/>[conf.py]")]
end

subgraph group_commands["CLI commands"]
  node_holiday_command["Holiday registration<br/>[holiday.py]"]
  node_notify_command["Text notifications<br/>[notify.py]"]
  node_migration_command["Legacy migration<br/>[migrate.py]"]
end

node_browser_user(("Browser user"))
node_cli_user(("CLI user"))

node_browser_user -.->|"requests pages"| node_web_server
node_web_server -.->|"routes requests"| node_main_request
node_main_request -->|"updates settings"| node_binder
node_main_request -->|"gets display arguments"| node_binder
node_main_request -->|"builds display"| node_view_builder
node_main_request -->|"initializes updater"| node_schedule_updater
node_main_request -->|"initializes loader"| node_schedule_loader
node_main_request -->|"counts entries"| node_trash_store
node_main_request -->|"reads cache size"| node_schedule_data
node_edit_request -->|"renders schedule entry"| node_schedule_data
node_trash_request -->|"reads and deletes"| node_trash_store
node_trash_request -->|"restores entry"| node_schedule_data
node_week_ui -.->|"displays weekly schedule"| node_main_request
node_main_ui -.->|"submits schedule actions"| node_main_request
node_navigation_ui -.->|"changes displayed week"| node_main_request
node_gauge_ui -.->|"jumps to week"| node_main_request
node_swipe_ui -.->|"changes displayed week"| node_main_request
node_cli_user -->|"registers holidays"| node_holiday_command
node_cli_user -->|"requests notification text"| node_notify_command
node_cli_user -->|"converts legacy data"| node_migration_command

click node_web_server "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/webapp.py"
click node_main_request "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/main_handler.py"
click node_edit_request "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/edit_handler.py"
click node_trash_request "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/trash_handler.py"
click node_week_ui "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/webroot/static/js/week.js"
click node_main_ui "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/webroot/static/js/main-page.js"
click node_navigation_ui "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/webroot/static/js/nav.js"
click node_gauge_ui "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/webroot/static/js/gauge.js"
click node_swipe_ui "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/webroot/static/js/swipe.js"
click node_binder "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/main_binder.py"
click node_view_builder "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/main_view.py"
click node_schedule_loader "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/sched_load.py"
click node_schedule_updater "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/sched_update.py"
click node_schedule_data "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/ytsched.py"
click node_attachments "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/attach.py"
click node_trash_store "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/trash.py"
click node_configuration "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/conf.py"
click node_holiday_command "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/holiday.py"
click node_notify_command "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/notify.py"
click node_migration_command "https://github.com/ytani01/ytsched/blob/develop/src/ytsched/migrate.py"

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_web_server,node_main_request,node_edit_request,node_trash_request,node_week_ui,node_main_ui,node_navigation_ui,node_gauge_ui,node_swipe_ui,node_browser_user,node_cli_user toneBlue
class node_binder,node_view_builder,node_schedule_loader,node_schedule_updater,node_schedule_data toneAmber
class node_attachments,node_trash_store,node_configuration toneMint
class node_holiday_command,node_notify_command,node_migration_command toneRose
```

## Components

### Web experience

- [Web server](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/webapp.py): `src/ytsched/webapp.py`
- [Main request handler](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/main_handler.py): `src/ytsched/main_handler.py`
- [Edit handler](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/edit_handler.py): `src/ytsched/edit_handler.py`
- [Trash handler](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/trash_handler.py): `src/ytsched/trash_handler.py`
- [Weekly schedule UI](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/webroot/static/js/week.js): `src/ytsched/webroot/static/js/week.js`
- [Schedule controls](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/webroot/static/js/main-page.js): `src/ytsched/webroot/static/js/main-page.js`
- [Week navigation](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/webroot/static/js/nav.js): `src/ytsched/webroot/static/js/nav.js`
- [Date gauge](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/webroot/static/js/gauge.js): `src/ytsched/webroot/static/js/gauge.js`
- [Swipe navigation](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/webroot/static/js/swipe.js): `src/ytsched/webroot/static/js/swipe.js`

### Schedule core

- [Display and settings binder](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/main_binder.py): `src/ytsched/main_binder.py`
- [Schedule view builder](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/main_view.py): `src/ytsched/main_view.py`
- [Schedule loader](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/sched_load.py): `src/ytsched/sched_load.py`
- [Schedule updater](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/sched_update.py): `src/ytsched/sched_update.py`
- [Schedule data and JSONL](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/ytsched.py): `src/ytsched/ytsched.py`

### Records and recovery

- [Attachment store](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/attach.py): `src/ytsched/attach.py`
- [Trash archive](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/trash.py): `src/ytsched/trash.py`
- [Configuration](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/conf.py): `src/ytsched/conf.py`

### CLI commands

- [Holiday registration](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/holiday.py): `src/ytsched/holiday.py`
- [Text notifications](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/notify.py): `src/ytsched/notify.py`
- [Legacy migration](https://github.com/ytani01/ytsched/blob/develop/src/ytsched/migrate.py): `src/ytsched/migrate.py`

### Other components

- **Browser user**
- **CLI user**

## Connections

- Browser user → Web server: requests pages (evidence: `README.md`)
- Web server → Main request handler: routes requests
- Main request handler → Display and settings binder: updates settings (evidence: `src/ytsched/main_handler.py`)
- Main request handler → Display and settings binder: gets display arguments (evidence: `src/ytsched/main_handler.py`)
- Main request handler → Schedule view builder: builds display (evidence: `src/ytsched/main_handler.py`)
- Main request handler → Schedule updater: initializes updater (evidence: `src/ytsched/main_handler.py`)
- Main request handler → Schedule loader: initializes loader (evidence: `src/ytsched/main_handler.py`)
- Main request handler → Trash archive: counts entries (evidence: `src/ytsched/main_handler.py`)
- Main request handler → Schedule data and JSONL: reads cache size (evidence: `src/ytsched/main_handler.py`)
- Edit handler → Schedule data and JSONL: renders schedule entry (evidence: `src/ytsched/edit_handler.py`)
- Trash handler → Trash archive: reads and deletes (evidence: `src/ytsched/trash_handler.py`)
- Trash handler → Schedule data and JSONL: restores entry (evidence: `src/ytsched/trash_handler.py`)
- Weekly schedule UI → Main request handler: displays weekly schedule (evidence: `README.md`)
- Schedule controls → Main request handler: submits schedule actions (evidence: `README.md`)
- Week navigation → Main request handler: changes displayed week (evidence: `README.md`)
- Date gauge → Main request handler: jumps to week (evidence: `README.md`)
- Swipe navigation → Main request handler: changes displayed week (evidence: `README.md`)
- CLI user → Holiday registration: registers holidays (evidence: `README.md`)
- CLI user → Text notifications: requests notification text (evidence: `README.md`)
- CLI user → Legacy migration: converts legacy data (evidence: `README.md`)
