{"id":19667416,"url":"https://github.com/pfan123/electron-react-boilerplate","last_synced_at":"2025-10-16T09:17:13.767Z","repository":{"id":37198727,"uuid":"61935270","full_name":"pfan123/electron-react-boilerplate","owner":"pfan123","description":"electron-react-boilerplate","archived":false,"fork":false,"pushed_at":"2023-01-05T02:06:03.000Z","size":2572,"stargazers_count":77,"open_issues_count":26,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-28T23:42:41.888Z","etag":null,"topics":["electron-boilerplate","react","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pfan123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-25T09:00:41.000Z","updated_at":"2025-03-12T14:12:18.000Z","dependencies_parsed_at":"2023-02-03T05:16:44.267Z","dependency_job_id":null,"html_url":"https://github.com/pfan123/electron-react-boilerplate","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pfan123/electron-react-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfan123%2Felectron-react-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfan123%2Felectron-react-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfan123%2Felectron-react-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfan123%2Felectron-react-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pfan123","download_url":"https://codeload.github.com/pfan123/electron-react-boilerplate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfan123%2Felectron-react-boilerplate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261846089,"owners_count":23218710,"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":["electron-boilerplate","react","typescript"],"created_at":"2024-11-11T16:32:07.379Z","updated_at":"2025-10-16T09:17:13.678Z","avatar_url":"https://github.com/pfan123.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# electron-react-boilerplate\n\n`electron-react-boilerplate` --  Electron App 开发的 react 模板。\n\n[Electron Official Documentation](https://electronjs.org/)\n\n[electron-builder Official Documentation](https://www.electron.build/)\n\n# Usage\n\n### clone 仓库\n\n```\ngit@github.com:pfan123/electron-react-boilerplate.git\n```\n\n### 安装\n\n```\nyarn start\n```\n\n### 开发\n\n``` \nyarn dev // 开发调试\n\nyarn build  // 打包 electron、webview 文件\n\nyarn postinstall // 正式环境同步依赖\n\nyarn start // 预览\n\nyarn dist // 打包安装包\n```\n\n### 构建打包\n\n`electron-builder` A complete solution to package and build a ready for distribution Electron app for macOS, Windows and Linux with “auto update” support out of the box.\n\n- [Icons](https://www.electron.build/icons)\n- [Auto Update](https://www.electron.build/auto-update)\n- [Code Signing](https://www.electron.build/code-signing)\n- [Multi Platform Build](https://www.electron.build/code-signing)\n\n\n\u003e\n\n\n## Electron开发桌面应用\n\nElectron 是一款可以利用 Web技术 开发跨平台桌面应用的框架，最初是 Github 发布的 Atom 编辑器衍生出的 Atom Shell，后更名为 Electron。Electron 提供了一个能通过 JavaScript 和 HTML 创建桌面应用的平台，同时集成 Node 来授予网页访问底层系统的权限。目前常见的有[NW](http://nwjs.io/)、[heX](http://hex.youdao.com/zh-cn/index.html)、[Electron](http://electron.atom.io/)、[MacGap](http://macgapproject.github.io/)、[MacGap案例switchhost](https://github.com/oldj/SwitchHosts)，可以打造桌面应用。\n\n\n\n![electron结构](http://img.pfan123.com/electron-construct.jpg)\n\n## electron项目\n\n[electronic-wechat](https://github.com/geeeeeeeeek/electronic-wechat/blob/master/README_zh.md?hmsr=toutiao.io\u0026utm_medium=toutiao.io\u0026utm_source=toutiao.io)\n\n[WeFlow](https://github.com/weixin/WeFlow)\n\n[Hozz](https://github.com/ppoffice/Hozz)\n\n[hummingbird](https://github.com/stormtea123/hummingbird)\n\n[ElectronOCR](https://github.com/wxyyxc1992/ElectronOCR)\n\n[N1](https://github.com/nylas/N1)\n\n\n\n## Electron 运行流程\n\n![Electron 运行流程](http://img.pfan123.com/electron_process.jpg)\n\n## Electron 主进程和渲染进程\n\n- `Electron` 运行 `package.json` 的 `main` 脚本的进程被称为主进程。\n\n- 在主进程中运行的脚本通过创建 `web` 页面来展示用户界面。 一个 `Electron` 应用总是有且只有一个主进程。\n\n- 由于 `Electron` 使用了 `Chromium`来展示 `web` 页面，所以 `Chromium` 的多进程架构也被使用到。 每个 `Electron` 中的 `web` 页面运行在它自己的渲染进程中。\n\n- 主进程使用 `BrowserWindow` 实例创建页面。每个 `BrowserWindow` 实例都在自己的渲染进程里运行页面。 当一个 `BrowserWindow`实例被销毁后，相应的渲染进程也会被终止\n\n![electron 主进程](http://img.pfan123.com/electron_main.jpg)\n\n\n\n## Electron 主进程和渲染进程中的模块\n\n![electron 模块](http://img.pfan123.com/electron_api.jpg)\n\n## Electron remote 模块\n\n`remote` 模块提供了一种在渲染进程(网页)和主进程之间进行进程间通讯 (`IPC`) 的简便途径\n\n`Electron` 中, 与 `GUI` 相关的模块(如 `dialog`, `menu` 等)只存在于主进程，而不在渲染进程中 。为了能从渲染进程中使用它们，需要用`ipc`模块来给主进程发送进程间消息。使用 `remote` 模块，可以调用主进程对象的方法，而无需显式地发送进程间消息，这类似于 `Java` 的 `RMI`\n\n## Electron快速上手demo\n\n[electron-boilerplate](https://github.com/chuyik/electron-boilerplate)\n\n[electron-connect](https://github.com/Quramy/electron-connect)\n\n\n## 参考资料：\n\n- [用 Electron 开发桌面应用](http://gold.xitu.io/entry/5603549660b20d2d666cf0d2)\n\n- [Electron API文档](https://github.com/electron/electron/tree/master/docs/api)\n\n- [Awesome Electron 大全](https://github.com/sindresorhus/awesome-electron)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfan123%2Felectron-react-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpfan123%2Felectron-react-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfan123%2Felectron-react-boilerplate/lists"}