How rahulbharti0106/mywidgets works
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 To-Do widget · calendar_widget.py Calendar widget · DesktopTodo.spec PyInstaller spec · launch_all.py Launch all
Components 14
UI widgets
Self-contained desktop overlays for tasks and calendar views.
- Launch all · Starts both widgets together in one session.
launch_all.py - To-Do widget · Primary task surface for editing tasks, reminders, and settings.
desktop_widget.py - Calendar widget · Read-oriented calendar surface that visualizes task due dates.
calendar_widget.py - Reminders · Due-date reminder flow driven from task state.
Shared config
Common theme and application constants consumed by both widgets.
- Theme config · 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 · Persistent task records and due dates.
- Settings data · Persistent To-Do widget preferences and behavior settings.
- Calendar settings · Persistent calendar-specific preferences.
- App data folder · %APPDATA%\MyWidgets\ local storage location on Windows.
- File I/O · Read/write access to JSON state on disk.
OS integration
Windows-specific behavior for notifications, startup, and packaging.
- Toast alerts · Windows toast notification boundary used for reminders.
- Startup launch · Automatic launch path via app settings or the Windows Startup folder.
- PyInstaller spec · Packaging definition for producing a standalone executable.
DesktopTodo.spec - App icon · Packaged application icon used by the built executable.
Connections 19
- 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.