How traves-theberge/tasky works
Project type and purpose
• This is a full-stack Electron desktop application (Tasky) whose purpose is to run quietly in the user’s system tray, schedule recurring reminders, play notification sounds, and display an animated desktop assistant.
• The README confirms core features: recurring reminders (via node-cron), tray integration, customizable notifications, and an interactive “assistant” overlay.
File structure
Top-level
• package.json, package-lock.json – npm dependencies and scripts
• build, vite.electron.config.js, vite.renderer.config.js – build/distribution artifacts and configs
• postcss.config.mjs, tailwind.config.js – CSS tooling
src/
• main.js – Electron main process entry point
• preload.js – Secure IPC bridge exposing safe APIs to the renderer
• electron/ – Backend modules for scheduling, storage, and assistant logic
– scheduler.js (node-cron job setup)
– storage.js (electron-store persistence)
– assistant.js (assistant control logic)
– assistant-script.js (front-end script injected into assistant overlay)
• renderer/ – React/Vite frontend
– index.html, renderer.jsx (app bootstrap)
– App.jsx, App.css
• components/ & components/ui/ – React UI components (settings, controls)
• assets/ – media files (notification.mp3)
• lib/utils.js – shared utilities
README for additional insights
• Confirms Electron + React + Vite + Tailwind CSS + node-cron + electron-store
• Describes config file locations (OS-specific)
• Highlights features: tray interactions, notification delivery, assistant avatars, settings UI
a. Main components
1. Electron Main Process
• Entry: main.js
• Scheduling orchestration (scheduler.js)
• Data persistence (storage.js using electron-store)
• IPC channels to/from Preload & Renderer
2. Preload Script (preload.js)
• Exposes a limited set of IPC methods (e.g., getConfig, scheduleReminder, playSound)
• Ensures renderer security
3. Renderer (React App)
• UI for settings and assistant display
• Components (SettingSection, CustomSwitch, etc.)
• Invokes IPC APIs via window.api
4. Assistant Overlay
• assistant.js controls avatar positioning & animations
• assistant-script.js injected into a transparent BrowserWindow for the assistant
5. Scheduler (node-cron)
• Runs in main process
• Fires reminder events at configured times/days
6. Notification subsystem
• Plays audio (notification.mp3)
• Displays system notifications or custom popup windows
7. Data Store (electron-store)
• Config JSON persisted per OS
8. OS Integration
• Auto-start registration
• Native notifications (optional)
b. Relationships & interactions
• Main spawns Renderer window (settings UI) via BrowserWindow
• Renderer ↔ Preload via IPC for read/write config and control toggles
• Main → Scheduler (reads config, schedules jobs) → emits “reminder” events
• On “reminder” event: Main → plays sound, triggers assistant overlay window, and/or native notification → Renderer may display custom notification bubble
• Assistant overlay window loads assistant-script.js which calls back to assistant.js for animation and speech bubbles
c. Architectural patterns & design principles
• Separation of concerns: Main process handles OS-level operations, scheduling, storage; Renderer handles UI/UX
• Secure IPC: use of preload.js to whitelist only necessary APIs
• Modularization: electron/ folder isolates backend modules; components/ui isolates reusable React controls
• Configuration as code: All settings persisted in JSON with a clear schema
d. Key technologies & frameworks
• Electron (main, preload, BrowserWindow, Tray)
• React + Vite (renderer UI)
• Tailwind CSS (styling)
• node-cron (scheduling)
• electron-store (persistent config)