-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lmn_741
committed
Sep 4, 2024
1 parent
9a33a00
commit e9b87d4
Showing
15 changed files
with
150 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: crawler-client | ||
name: electron-react | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# 项目结构 | ||
|
||
使用者可以参考我的项目结构进行微调或者改造. | ||
|
||
## 项目结构 | ||
``` | ||
├── electron-react # 桌面应用 | ||
├── build # web包编译后资源目录 | ||
├── extraResources # 视窗额外打包文件(比如各种执行的cmd/python脚本) | ||
├── public # web包编译前资源目录 | ||
├── release # 视窗编译输出目录 | ||
├── scripts # 视窗安装/卸载脚本目录(包括nsis脚本等) | ||
├── src # web前端代码目录 | ||
│ ├── main/ # 视窗主进程相关 | ||
│ │ ├── main.js # 主进程代码 | ||
│ │ ├── preload.js # 预加载脚本(进程通信) | ||
│ ├── renderer/ # 视窗渲染进程相关 | ||
│ │ ├── entry/ # web项目根目录(比如根节点root入口文件) | ||
│ │ ├── components/ # 公共组件目录 | ||
│ │ ├── configs/ # 全局配置目录 | ||
│ │ ├── i18n/ # 国际化(暂时没用上) | ||
│ │ ├── layout/ # 布局文件目录 | ||
│ │ ├── models/ # 数据处理目录 | ||
│ │ ├── utils/ # 工具类目录 | ||
│ │ ├── redux/ # 状态机管理目录 | ||
│ │ ├── routers/ # 路由配置目录 | ||
│ │ ├── api/ # 请求服务目录 | ||
│ │ ├── statics/ # 渲染进程静态资源目录 | ||
│ │ ├── tests/ # e2e测试目录 | ||
│ │ ├── mock/ # 模拟数据目录 | ||
│ │ └── views/ # UI界面目录 | ||
│ ├── staic/ # 公共资源类 | ||
│ ├── utils/ # 公共工具类 | ||
├── env.development # 开发环境配置 | ||
├── env.production # 生产环境配置 | ||
├── env.test # 测试环境配置 | ||
├── static # 桌面应用静态资源 | ||
├── .gitignore # git忽略配置 | ||
├── craco.config.js # webpack配置 | ||
├── electron-builder.yml # electron生产编译配置 | ||
├── package.json # 依赖表 | ||
└── webstorm.config # webstorm配置 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 渲染进程 | ||
|
||
使用者可以参考我的项目结构进行微调或者改造. | ||
|
||
## 渲染进程相关 | ||
|
||
``` | ||
1、脚手架采用官方cli - create-react-app | ||
2、状态管理工具为redux 的 react适配版 react-redux 和 @reduxjs/toolkit | ||
3、异步工具为 redux-saga | ||
4、数据传递和控制渲染采用 @reduxjs/toolkit 下的 reselect | ||
5、路由采用 react-router-dom | ||
6、样式建议采用 styled-components 和 less | ||
7、开发调试日志采用 redux-logger | ||
8、项目配置采用 craco | ||
9、UI库建议 antd,图表 是 echarts | ||
10、环境变量从 process.env.REACT_APP_ENVIRONMENT 中获取(development - 开发, test - 测试, production - 生产), | ||
主要是 react 的 NODE_ENV无法像vue一样被脚本覆盖 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# 快速开始 | ||
|
||
通过这个教程,你的app将会打开一个浏览器窗口,来展示包含当前正在运行的 Chromium, Node.js与 Electronweb等版本信息的web界面 | ||
|
||
## 创建你的应用程序 | ||
|
||
```shell | ||
|
||
# 从仓库模版创建 | ||
git clone https://github.com/liumengniu/electron-react.git | ||
cd electron-react | ||
npm i | ||
npm run start | ||
|
||
#从 | ||
|
||
``` | ||
|
||
完成上述步骤后,您应该有一个功能齐全的Electron程序,如下所示: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 概要 | ||
|
||
`基于react + cra 来构造 electron 应用程序的样板代码.` | ||
|
||
该项目的目的,是为了要避免使用 react 手动建立起 electron 应用程序。electron-react 充分利用 creat-react-app 作为脚手架工具, | ||
加上拥有 creat-react-app 的 webpack, 生产编译即更新的 electron-builder,以及一些最常用的插件,如react-router-dom、redux、redux-saga 等等。 | ||
|
||
## 在这里查看其他文档 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters