# rahulbharti0106/mywidgets architecture

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

- Interactive diagram: https://gitdiagram.com/rahulbharti0106/mywidgets
- Repository: https://github.com/rahulbharti0106/mywidgets

## Overview

1. **Overall shape**
   - This is a small Windows desktop productivity suite built in Python with PyQt6.
   - It contains two independent UI applications: a **to-do widget** and a **calendar widget**.
   - The codebase is organized as a single repository, but the widgets can be run separately or together.

2. **Primary runtime entry points**
   - `desktop_widget.py` is the main To-Do app entry point.
   - `calendar_widget.py` is the main Calendar app entry point.
   - `launch_all.py` is a launcher that starts both widgets in one process/session so users get the full suite at once.

3. **Functional split between widgets**
   - The To-Do widget is the system of record for user tasks, due dates, reminders, and persistent settings.
   - The Calendar widget is a read-oriented companion view that visualizes due dates from the task data and adds indicator dots.
   - This creates a one-way dependency in practice: task data originates in the To-Do side and is consumed by the Calendar side.

4. **Shared configuration layer**
   - `theme_config.py` holds shared visual and behavioral configuration.
   - The two widgets likely consume the same theme definitions and UI constants so their appearance stays consistent across dark/light modes, sizing, opacity, and general widget styling.
   - This shared module is the main cross-cutting boundary in the repo.

5. **Persistence and local data flow**
   - Runtime data is stored outside the repository under `%APPDATA%\MyWidgets\`.
   - The key persisted files are `tasks.json`, `settings.json`, and `calendar_settings.json`.
   - Data flow is local and file-based: widgets read/write JSON state on the Windows machine rather than using a remote database or service.

6. **Reminder and notification path**
   - The To-Do widget supports due-date reminders through Windows toast notifications.
   - `winotify` is an optional dependency used only for this notification path.
   - This feature is Windows-specific and sits at the boundary between task scheduling logic and the OS notification system.

7. **Desktop UI model**
   - The widgets are frameless and always-on-top desktop overlays intended to stay in the background layer.
   - They support drag-to-move and resize behavior, plus right-click or similar widget-level interaction for settings/customization.
   - The architecture is therefore not a traditional windowed app with navigation; each widget is a self-contained floating surface.

8. **Startup and launch behavior**
   - The app supports automatic launch on Windows startup.
   - Startup can be handled either by the app’s own settings or by placing the executable in the Windows Startup folder.
   - This affects deployment and execution flow more than application logic: the suite is designed to be resident after login.

9. **Packaging and distribution**
   - `DesktopTodo.spec` is the PyInstaller build specification used to package the app into a standalone `.exe`.
   - `assets/icon.ico` is the packaged application icon.
   - The intended distribution model is a single downloadable executable for end users, with Python only required for development.

10. **Architectural boundaries to draw**
   - Draw three main boundaries: **UI widgets**, **shared config/theme**, and **local persisted state**.
   - Show the To-Do widget as the source of task data and reminders.
   - Show the Calendar widget as a consumer of task due dates.
   - Show the OS boundary for Windows toast notifications, startup integration, and filesystem persistence under `%APPDATA%`.

Main entry points: [`desktop_widget.py`](https://github.com/rahulbharti0106/mywidgets/blob/main/desktop_widget.py) (To-Do widget), [`calendar_widget.py`](https://github.com/rahulbharti0106/mywidgets/blob/main/calendar_widget.py) (Calendar widget), [`DesktopTodo.spec`](https://github.com/rahulbharti0106/mywidgets/blob/main/DesktopTodo.spec) (PyInstaller spec), [`launch_all.py`](https://github.com/rahulbharti0106/mywidgets/blob/main/launch_all.py) (Launch all)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["UI widgets"]
  node_launch_all["Launch all<br/>launcher<br/>[launch_all.py]"]
  node_todo_widget["To-Do widget<br/>desktop app<br/>[desktop_widget.py]"]
  node_calendar_widget["Calendar widget<br/>companion view<br/>[calendar_widget.py]"]
  node_reminders{{"Reminders<br/>scheduler"}}
end

subgraph group_shared["Shared config"]
  node_theme_config["Theme config<br/>shared module<br/>[theme_config.py]"]
end

subgraph group_state["Local persisted state"]
  node_tasks_data[("Tasks data<br/>json state")]
  node_settings_data[("Settings data<br/>json state")]
  node_calendar_settings[("Calendar settings<br/>json state")]
  node_appdata_store[("App data folder<br/>windows storage")]
  node_filesystem_io{{"File I/O<br/>local persistence"}}
end

subgraph group_os["OS integration"]
  node_toast_notify["Toast alerts<br/>windows notifications"]
  node_startup_launch["Startup launch<br/>windows startup"]
  node_pyinstaller_spec["PyInstaller spec<br/>build spec<br/>[DesktopTodo.spec]"]
  node_app_icon["App icon<br/>asset"]
end

node_launch_all -->|"starts"| node_todo_widget
node_launch_all -->|"starts"| node_calendar_widget
node_todo_widget -->|"uses"| node_theme_config
node_calendar_widget -->|"uses"| node_theme_config
node_todo_widget -->|"owns"| node_tasks_data
node_todo_widget -->|"persists"| node_settings_data
node_calendar_widget -->|"persists"| node_calendar_settings
node_tasks_data -->|"feeds"| node_calendar_widget
node_tasks_data -->|"drives"| node_reminders
node_reminders -->|"notifies"| node_toast_notify
node_appdata_store -->|"backing store"| node_filesystem_io
node_filesystem_io -->|"reads/writes"| node_tasks_data
node_filesystem_io -->|"reads/writes"| node_settings_data
node_filesystem_io -->|"reads/writes"| node_calendar_settings
node_pyinstaller_spec -->|"packages"| node_launch_all
node_pyinstaller_spec -->|"packages"| node_todo_widget
node_pyinstaller_spec -->|"packages"| node_calendar_widget
node_pyinstaller_spec -->|"embeds"| node_app_icon
node_startup_launch -.->|"opens"| node_launch_all

click node_launch_all "https://github.com/rahulbharti0106/mywidgets/blob/main/launch_all.py"
click node_todo_widget "https://github.com/rahulbharti0106/mywidgets/blob/main/desktop_widget.py"
click node_calendar_widget "https://github.com/rahulbharti0106/mywidgets/blob/main/calendar_widget.py"
click node_theme_config "https://github.com/rahulbharti0106/mywidgets/blob/main/theme_config.py"
click node_pyinstaller_spec "https://github.com/rahulbharti0106/mywidgets/blob/main/DesktopTodo.spec"

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_launch_all,node_todo_widget,node_calendar_widget,node_reminders toneBlue
class node_theme_config toneAmber
class node_tasks_data,node_settings_data,node_calendar_settings,node_appdata_store,node_filesystem_io toneMint
class node_toast_notify,node_startup_launch,node_pyinstaller_spec,node_app_icon toneRose
```

## Components

### UI widgets

Self-contained desktop overlays for tasks and calendar views.

- [Launch all](https://github.com/rahulbharti0106/mywidgets/blob/main/launch_all.py): launcher · Starts both widgets together in one session. · `launch_all.py`
- [To-Do widget](https://github.com/rahulbharti0106/mywidgets/blob/main/desktop_widget.py): desktop app · Primary task surface for editing tasks, reminders, and settings. · `desktop_widget.py`
- [Calendar widget](https://github.com/rahulbharti0106/mywidgets/blob/main/calendar_widget.py): companion view · Read-oriented calendar surface that visualizes task due dates. · `calendar_widget.py`
- **Reminders**: scheduler · Due-date reminder flow driven from task state.

### Shared config

Common theme and application constants consumed by both widgets.

- [Theme config](https://github.com/rahulbharti0106/mywidgets/blob/main/theme_config.py): shared module · Shared visual and behavioral configuration used by both widgets. · `theme_config.py`

### Local persisted state

JSON files stored under the user profile and used as the local system of record.

- **Tasks data**: json state · Persistent task records and due dates.
- **Settings data**: json state · Persistent To-Do widget preferences and behavior settings.
- **Calendar settings**: json state · Persistent calendar-specific preferences.
- **App data folder**: windows storage · %APPDATA%\MyWidgets\ local storage location on Windows.
- **File I/O**: local persistence · Read/write access to JSON state on disk.

### OS integration

Windows-specific behavior for notifications, startup, and packaging.

- **Toast alerts**: windows notifications · Windows toast notification boundary used for reminders.
- **Startup launch**: windows startup · Automatic launch path via app settings or the Windows Startup folder.
- [PyInstaller spec](https://github.com/rahulbharti0106/mywidgets/blob/main/DesktopTodo.spec): build spec · Packaging definition for producing a standalone executable. · `DesktopTodo.spec`
- **App icon**: asset · Packaged application icon used by the built executable.

## Connections

- Launch all → To-Do widget: starts · Launches the To-Do widget in the combined session.
- Launch all → Calendar widget: starts · Launches the Calendar widget in the combined session.
- To-Do widget → Theme config: uses · Consumes shared theme and widget constants.
- Calendar widget → Theme config: uses · Consumes shared theme and widget constants.
- To-Do widget → Tasks data: owns · Maintains the source task records and due dates.
- To-Do widget → Settings data: persists · Reads and writes widget preferences.
- Calendar widget → Calendar settings: persists · Reads and writes calendar preferences.
- Tasks data → Calendar widget: feeds · Task due dates flow one-way into the calendar view.
- Tasks data → Reminders: drives · Due dates are used to schedule reminder checks.
- Reminders → Toast alerts: notifies · Dispatches Windows toast alerts for upcoming or overdue tasks.
- App data folder → File I/O: backing store · Provides the local folder used for JSON persistence.
- File I/O → Tasks data: reads/writes · Serializes task state to disk.
- File I/O → Settings data: reads/writes · Serializes To-Do preferences to disk.
- File I/O → Calendar settings: reads/writes · Serializes calendar preferences to disk.
- PyInstaller spec → Launch all: packages · Includes the launcher in the standalone build.
- PyInstaller spec → To-Do widget: packages · Includes the To-Do widget in the standalone build.
- PyInstaller spec → Calendar widget: packages · Includes the Calendar widget in the standalone build.
- PyInstaller spec → App icon: embeds · Bundles the application icon into the executable.
- Startup launch → Launch all: opens · Represents automatic startup behavior for the suite.
