{"id":20154659,"url":"https://github.com/hichemfantar/ShutdownScheduler","last_synced_at":"2025-05-06T22:31:08.202Z","repository":{"id":262254829,"uuid":"886682923","full_name":"hichemfantar/ShutdownScheduler","owner":"hichemfantar","description":"Shutdown Scheduler - Windows, MacOS, Linux","archived":false,"fork":false,"pushed_at":"2024-12-08T13:00:44.000Z","size":4842,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T22:53:46.665Z","etag":null,"topics":["desktop-app","electron","javascript","learn","react","student-vscode","tailwindcss","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hichemfantar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-11T12:19:33.000Z","updated_at":"2025-04-11T06:39:21.000Z","dependencies_parsed_at":"2025-04-13T22:51:47.451Z","dependency_job_id":"071be731-2aa0-4405-9b4b-226e47e23e17","html_url":"https://github.com/hichemfantar/ShutdownScheduler","commit_stats":null,"previous_names":["hichemfantar/shutdown-scheduler","hichemfantar/shutdownscheduler"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hichemfantar%2FShutdownScheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hichemfantar%2FShutdownScheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hichemfantar%2FShutdownScheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hichemfantar%2FShutdownScheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hichemfantar","download_url":"https://codeload.github.com/hichemfantar/ShutdownScheduler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252778968,"owners_count":21802859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["desktop-app","electron","javascript","learn","react","student-vscode","tailwindcss","typescript"],"created_at":"2024-11-13T23:27:51.914Z","updated_at":"2025-05-06T22:31:08.182Z","avatar_url":"https://github.com/hichemfantar.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shutdown Scheduler\n\nAn Electron-powered desktop app for scheduling automated shutdown and reboot tasks. Built with Vite, React, and TypeScript, it supports Windows, Linux, macOS, and Unix-like systems. The app uses Task Scheduler on Windows and Cron jobs on Linux/Unix for seamless, platform-specific automation.\n\n## Screenshots\n\n![Main Screen](demo.png)\n_Main interface._\n\n## Features\n\n- **Flexible Scheduling**: Set shutdowns or reboots to occur once, daily, or weekly.\n- **Task Management**: Enable, disable, delete individual or all tasks.\n- **Cross-Platform**: Compatible with Windows, Linux, Unix-like systems, and macOS.\n- **User-Friendly**: Tasks managed via JSON, keeping a record of all scheduled activities.\n\n## Technologies\n\n- **Electron** for cross-platform desktop functionality\n- **Vite** for fast development and bundling\n- **Tailwind** for a modern responsive UI\n- **TypeScript** for type safety\n- **React** for a fast UI\n\n## Prerequisites\n\n- **Node.js** and **npm**\n- **Electron**\n\n## Setup\n\n1. Clone the repository and install dependencies:\n\n   ```bash\n   git clone https://github.com/hichemfantar/ShutdownScheduler\n   cd ShutdownScheduler\n   npm install\n   ```\n\n2. **Run the app in development mode**:\n\n   ```bash\n   npm run dev\n   ```\n\n3. **Package application**:\n\n   ```bash\n   npm run package\n   ```\n\n4. **Generate platform specific distributables**:\n\n   ```bash\n   npm run make\n   ```\n\n## Usage\n\n- **Set up tasks**:\n  - Define your task schedule type (once, daily, or weekly), action (shutdown/reboot), and timing options.\n- **Enable/Disable**: Manage tasks through the app, adjusting schedules as needed.\n\n## Platform-Specific Details\n\n- **Windows**: Utilizes Windows Task Scheduler to set up shutdown/reboot tasks.\n- **Linux/Unix/macOS**: Uses Cron jobs for scheduling tasks.\n\n## Architecture\n\nWhen building a shutdown timer across Windows, Linux, and Mac in an Electron app, you have two main options:\n\n1. **Using OS-Specific Schedulers** (e.g., Task Scheduler on Windows, Cron on Unix-based systems)\n2. **Using a Node.js Scheduler** (e.g., `node-schedule` or `node-cron`)\n\nEach approach has its advantages and trade-offs. Here’s a breakdown to help you choose the best approach.\n\n## 1. (current approach) Using OS-Specific Schedulers (Task Scheduler on Windows, Cron on Unix)\n\n### Pros\n\n- **Reliability and Consistency**: OS schedulers are designed specifically for managing scheduled tasks like shutdowns, making them more reliable, especially if the system sleeps or restarts.\n- **Persistence**: These schedules will remain active even if your app closes or the computer restarts.\n- **Low Resource Usage**: OS schedulers consume fewer resources than a continuously running Node.js process.\n\n### Cons\n\n- **Complex Cross-Platform Code**: Managing OS-specific schedulers increases code complexity, requiring separate logic for Windows (Task Scheduler) and Unix-based systems (Cron).\n- **Permissions**: Setting up and modifying tasks in Task Scheduler and Cron may require elevated permissions, adding complexity to installation and operation.\n\n### Recommended for\n\nApplications needing high reliability for shutdown scheduling across various OS platforms, especially where persistence is key and where managing platform-specific configurations is acceptable.\n\n---\n\n## 2. Using a Node.js Scheduler (e.g., `node-schedule` or `node-cron`)\n\n### Pros\n\n- **Cross-Platform Code**: Node.js schedulers allow you to write unified code that works across all platforms, reducing the need for platform-specific logic.\n- **Easy Integration in Electron**: Scheduling logic is directly within your Node.js code, making it straightforward to integrate with your Electron app's UI.\n- **Fine-Grained Control**: Node.js schedulers allow custom intervals, task cancellation, or timing adjustments directly in your app.\n\n### Cons\n\n- **App Must Remain Running**: For the shutdown task to execute, the Node.js process must keep running, which can be problematic if the app closes or the user manually exits.\n- **Potential Reliability Issues**: If the system sleeps, hibernates, or reboots, Node.js schedulers may not reliably trigger the shutdown.\n\n### Recommended for\n\nSituations where simplicity and cross-platform support in the codebase are priorities, and where the app will stay open (e.g., minimized to the system tray) to keep the Node.js process active.\n\n---\n\n## Conclusion\n\nIf you need a reliable, persistent shutdown scheduler that works even when the app isn’t running, **using OS-specific schedulers (Task Scheduler and Cron) is generally the better choice**. However, if you prefer a unified codebase and can ensure the app remains open, **a Node.js scheduler would be simpler to implement and maintain**.\n\n### Hybrid Approach\n\nConsider a hybrid approach: use a Node.js scheduler within the app for simplicity, and optionally set up OS-specific tasks if the user needs shutdown persistence outside of the app's runtime.\n\n---\n\nEnjoy automated scheduling with customizable options across platforms!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhichemfantar%2FShutdownScheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhichemfantar%2FShutdownScheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhichemfantar%2FShutdownScheduler/lists"}