{"id":23003103,"url":"https://github.com/programmerstevie/desktopprayertimes","last_synced_at":"2025-07-25T23:17:13.831Z","repository":{"id":257986652,"uuid":"868719542","full_name":"programmerstevie/desktopPrayerTimes","owner":"programmerstevie","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-21T11:08:56.000Z","size":431,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T20:56:38.741Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/programmerstevie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-10-07T04:06:02.000Z","updated_at":"2024-10-21T11:09:00.000Z","dependencies_parsed_at":"2025-02-08T05:34:58.336Z","dependency_job_id":null,"html_url":"https://github.com/programmerstevie/desktopPrayerTimes","commit_stats":null,"previous_names":["programmerstevie/desktopprayertimes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/programmerstevie%2FdesktopPrayerTimes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/programmerstevie%2FdesktopPrayerTimes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/programmerstevie%2FdesktopPrayerTimes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/programmerstevie%2FdesktopPrayerTimes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/programmerstevie","download_url":"https://codeload.github.com/programmerstevie/desktopPrayerTimes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246828856,"owners_count":20840536,"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":[],"created_at":"2024-12-15T07:13:23.730Z","updated_at":"2025-04-02T14:22:35.297Z","avatar_url":"https://github.com/programmerstevie.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prayer Times Electron App\r\n\r\nThis app is a desktop application built using Electron that displays the daily Islamic prayer times for a given location. The prayer times are dynamically updated, highlighting the current prayer based on the system clock. It also integrates with the system tray for easy access to upcoming prayer times.\r\n\r\n## Features\r\n\r\n- **Prayer Time Display**: Shows the five daily prayers (Fajr, Dhuhr, Asr, Maghrib, Isha) and additional key times (Sunrise, Midnight).\r\n- **Current Prayer Highlight**: The app automatically highlights the current prayer based on the time of day.\r\n- **Tray Integration**: Displays upcoming prayer times in the system tray for quick access.\r\n- **Dynamic Update**: Refreshes the prayer times in real-time every minute.\r\n- **Custom Window Dragging**: Enables dragging of the entire window using mouse events.\r\n\r\n## Technologies Used\r\n\r\n- **Electron**: Cross-platform desktop framework for building desktop apps using web technologies.\r\n- **JavaScript**: Core logic for the application.\r\n- **Tailwind CSS**: Utility-first CSS framework for styling.\r\n- **Prayer Times API**: Used to fetch accurate prayer times.\r\n\r\n\r\n## Installation\r\n\r\nTo run this application locally, follow the steps below:\r\n\r\n### Prerequisites\r\n\r\n- You must have [Node.js](https://nodejs.org/) and [npm](https://www.npmjs.com/) installed.\r\n- [Electron](https://www.electronjs.org/).\r\n\r\n### Setup\r\n\r\n1. Clone this repository:\r\n\r\n   ```bash\r\n   git clone https://github.com/yourusername/prayer-times-electron.git\r\n   ```\r\n\r\n2. Navigate into the project directory:\r\n\r\n   ```bash\r\n   cd prayer-times-electron\r\n   ```\r\n\r\n3. Install the dependencies:\r\n\r\n   ```bash\r\n   npm install\r\n   ```\r\n\r\n4. Run the app:\r\n\r\n   ```bash\r\n   npm start\r\n   ```\r\n\r\n## App Structure\r\n\r\n### main.js\r\n\r\nThe `main.js` file is responsible for managing the main Electron process. It creates the main application window, controls the system tray, and handles inter-process communication (IPC) between the main and renderer processes.\r\n\r\n- **Key Features**:\r\n  - **BrowserWindow**: Creates a frameless window for displaying prayer times.\r\n  - **Tray**: Displays the current and upcoming prayer times in the system tray.\r\n  - **Custom Context Menu**: Allows custom right-click context menus.\r\n  - **Window Dragging**: Implements custom window dragging logic, enabling movement of the app window through mouse events.\r\n  - **API Call**: Fetches prayer times from the Aladhan API based on the user's city and state.\r\n\r\n```js\r\n// Sample of tray integration\r\nipcMain.on(\"currentPrayerTime\", (event, { name, displayNames, displayTimes }) =\u003e {\r\n  let toolTipTimes = \"\";\r\n  for (let i = 0; i \u003c displayNames.length; i++) {\r\n    if (i \u003e 0) toolTipTimes += \"\\n\";\r\n    toolTipTimes += `${displayNames[i]} at ${displayTimes[i]}`;\r\n  }\r\n  tray.setToolTip(`Prayer Times \\n${name}\\n----\\n${toolTipTimes}`);\r\n});\r\n```\r\n\r\n### preload.js\r\n\r\nThe `preload.js` file bridges the gap between Electron's main and renderer processes. It exposes certain Electron features to the front-end while ensuring security by isolating access to specific APIs.\r\n\r\n- **Key Features**:\r\n  - **Prayer Times Fetching**: Bridges the API call for fetching prayer times from the backend to the frontend.\r\n  - **Custom Logging**: Logs messages from the front-end to the back-end.\r\n  - **Custom Window Dragging**: Implements logic to enable dragging of the window using mouse events in the renderer process.\r\n  - **Custom Context Menu**: Triggers the display of a custom context menu on right-click events.\r\n\r\n```js\r\n// Sample of exposing functionality in preload\r\ncontextBridge.exposeInMainWorld(\"indexBridge\", {\r\n  getPrayerTimes: async () =\u003e {\r\n    const result = await ipcRenderer.invoke(\"getPrayerTimes\");\r\n    return result;\r\n  },\r\n  log: (msg) =\u003e {\r\n    ipcRenderer.send(\"log\", msg);\r\n  },\r\n});\r\n```\r\n\r\n### Frontend Logic\r\n\r\n- The prayer times are fetched from an external API and cached to avoid redundant API calls.\r\n- The app dynamically updates the prayer times based on the current time, highlighting the current prayer in the UI.\r\n- The `index.js` file is responsible for parsing the fetched prayer times and updating the UI components accordingly.\r\n  \r\n```js\r\nsetInterval(() =\u003e {\r\n  getPrayerTimes();\r\n}, 1000);\r\n```\r\n\r\n### Custom Styling\r\n\r\nThe app is styled using Tailwind CSS and custom styles found in `styles.css` and `reset.css`. The UI is minimalist, focusing on clear and easily readable prayer times.\r\n\r\n```html\r\n\u003cheader class=\"relative pl-4 pt-3 bg-stone-900 h-[62px]\"\u003e\r\n  \u003ch1 class=\"text-3xl\"\u003eCurrent Prayer\u003c/h1\u003e\r\n\u003c/header\u003e\r\n\u003cul class=\"prayerList\"\u003e\r\n  \u003cli class=\"prayerList_elem prayerList_elem--fajr\"\u003e\r\n    \u003ch2\u003eFajr\u003c/h2\u003e\r\n    \u003cdiv class=\"time\"\u003e-:--\u003c/div\u003e\r\n  \u003c/li\u003e\r\n  \u003c!-- Additional prayers --\u003e\r\n\u003c/ul\u003e\r\n```\r\n\r\n## Prayer Times API\r\n\r\nThis app uses the [Aladhan Prayer Times API](https://aladhan.com/prayer-times-api) to fetch accurate prayer times for the hardcoded location of **Pembroke Pines, Florida**. The API is free to use and provides various prayer times based on different calculation methods.\r\n\r\nPlease note that the location is currently hardcoded and cannot be customized by the user in this version of the app.\r\n\r\n## Contributing\r\n\r\nFeel free to submit issues or contribute to the project by opening pull requests.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n### Acknowledgements\r\n\r\nThis project uses the [Aladhan Prayer Times API](https://aladhan.com/prayer-times-api), which provides accurate prayer times for different locations. The API is free to use, and is governed by its own terms of use as outlined by Aladhan.\r\n\r\nThe use of the Aladhan API does not affect the MIT License of the project code itself.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogrammerstevie%2Fdesktopprayertimes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogrammerstevie%2Fdesktopprayertimes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogrammerstevie%2Fdesktopprayertimes/lists"}