Skip to content

Commit 48aebec

Browse files
committed
doc: fix readme.md
1 parent 4d41ae9 commit 48aebec

1 file changed

Lines changed: 20 additions & 229 deletions

File tree

README.md

Lines changed: 20 additions & 229 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414

1515
## 🚀 Pro React Admin
1616

17-
**Pro React Admin** 是一款基于 **React v19** 的高性能、企业级中后台前端解决方案。深度整合 **RBAC 动态权限****KeepAlive 缓存****多标签页****AI 智能助手**。提供开箱即用的国际化、暗黑模式、Mock 数据与 E2E 测试体系,助力开发者快速构建稳健、安全的 SaaS 平台与数据可视化系统。
17+
**Pro React Admin** 是一款基于 **React v19** 的高性能、企业级中后台前端解决方案。深度整合 **RBAC 动态权限****KeepAlive 缓存****多标签页****AI 智能助手**。提供开箱即用的国际化、暗黑模式、Mock 数据与 E2E 测试体系,助力开发者快速构建稳健、安全的 SaaS 平台与数据可视化系统。具备双重架构设计,既是完整的企业级应用,也是可发布的组件库 @w.ui/wui-react。
1818

1919
---
2020

2121
## 🌐 在线预览
2222

2323
- **主应用 (Main App)**: [https://wkylin.github.io/pro-react-admin/](https://wkylin.github.io/pro-react-admin/)
24+
- **主应用 (Vercel App)**: [https://pro-react-admin.vercel.app/](https://pro-react-admin.vercel.app/)
2425
- **组件文档 (Storybook)**: [https://wkylin.github.io/pro-react-admin/storybook/](https://wkylin.github.io/pro-react-admin/storybook/)
2526
- **导航页 (Portal)**: [https://wkylin.github.io/pro-react-admin/portal.html](https://wkylin.github.io/pro-react-admin/portal.html)
2627

@@ -36,6 +37,7 @@
3637
- **🧪 全链路质量保障**:集成 **Playwright** E2E 自动化测试,配合 Mock Service Worker (MSW) 实现真实的网络模拟与多角色权限切换测试。
3738
- **📱 极致移动端适配**:精心打磨的响应式布局,从 PC 到手机端提供一致的流畅体验。
3839

40+
- **📦 CI/CD 集成** :GitHub Actions:自动构建部署到 GitHub Pages. Sentry 集成:可选的错误监控与源码上传
3941
---
4042

4143
## 🔑 核心功能
@@ -136,32 +138,8 @@ npm run dev
136138

137139
---
138140

139-
## 🤝 贡献指南
140-
141-
欢迎 PR、Issue 与 Star!
142141

143-
1. Fork 本仓库
144-
2. 新建分支:`git checkout -b feature/xxx`
145-
3. 提交更改:`git commit -m 'feat: 新增 xxx 功能'`
146-
4. 推送分支:`git push origin feature/xxx`
147-
5. 新建 Pull Request
148-
149-
---
150-
151-
## 📄 License
152-
153-
Apache-2.0 © [wkylin](https://github.com/wkylin)
154-
155-
---
156-
157-
## 🌐 约定式提交
158-
159-
1. [约定式提交](https://www.conventionalcommits.org/zh-hans/v1.0.0/)
160-
2. [语义化版本 2.0.0](https://semver.org/lang/zh-CN/)
161-
162-
---
163-
164-
## 📄 技术架构
142+
## 🛡️ 技术架构
165143

166144
<img width="1903" height="387" alt="Snipaste_2025-12-31_09-14-38" src="https://github.com/user-attachments/assets/915ba91a-8852-4dc0-8a14-091e781d9f04" />
167145

@@ -193,233 +171,46 @@ Baize CLI 是一个轻量、规范且高效的前端项目脚手架工具,旨
193171

194172
---
195173

196-
## 🐳 Mac 本地部署 SonarQube
174+
## 🐳 本地部署 SonarQube
197175

198176
1. [SonarQube for Mac](https://juejin.cn/post/7210005376652886077)
199177
2. [Gitlab for Mac](https://juejin.cn/post/7210746685802397755)
200178
3. [Gitlab CI/CD for Mac](https://juejin.cn/post/7214686619097874491)
201179

202180
---
203181

204-
## 🌏 Nginx 配置指南
205-
206-
1. [Mac Nginx](https://newbedev.com/how-to-restart-nginx-on-mac-os-x)
207-
208-
```bash
209-
brew install nginx
210-
brew reinstall nginx
211-
212-
/usr/local/var/www
213-
/usr/local/etc/nginx/nginx.conf
214-
/usr/local/etc/nginx/servers/
215-
216-
brew services list
217-
brew services start nginx
218-
brew services stop nginx
219-
brew services restart nginx
220-
```
221-
222-
2. Nginx.conf
223-
224-
```bash
225-
server {
226-
listen 8081;
227-
#server_name localhost;
228-
server_name www.pro.react.admin.com;
229-
# 静态资源
230-
location / {
231-
root /usr/local/var/www/pro-react-admin;
232-
index index.html index.htm;
233-
try_files $uri $uri/ /index.html @rewrites;
234-
expires -1;
235-
add_header Cache-Control no-cache;
236-
# proxy_pass http://localhost:3000;
237-
}
238-
# API代理
239-
location /api/ {
240-
proxy_pass https://api.example.com/;
241-
proxy_set_header Host $host;
242-
proxy_set_header X-Real-IP $remote_addr;
243-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
244-
proxy_set_header X-Forwarded-Proto $scheme;
245-
# 允许跨域配置
246-
add_header Access-Control-Allow-Origin $http_origin;
247-
add_header Access-Control-Allow-Methods 'GET, POST, PUT, DELETE, OPTIONS';
248-
add_header Access-Control-Allow-Headers 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
249-
add_header Access-Control-Allow-Credentials 'true';
250-
if ($request_method = 'OPTIONS') {
251-
add_header Access-Control-Max-Age 86400;
252-
add_header Content-Length 0;
253-
add_header Content-Type text/plain;
254-
return 204;
255-
}
256-
}
257-
location @rewrites {
258-
rewrite ^(.+)$ /index.html break;
259-
}
260-
# 不缓存
261-
location ~ .*(htm|html|json)?$ {
262-
expires -1;
263-
}
264-
# 或者全部重定向
265-
# return 301 https://$server_name$request_uri;
266-
}
267-
268-
# SwitchHosts!
269-
192.168.1.101 www.pro.react.admin.com
270-
271-
# 第一个目录的配置
272-
# C:\nginx-1.27.5\html\var\www\html\
273-
# location /html/ {
274-
# root /var/www;
275-
# index index.html index.htm;
276-
# }
277-
278-
# 第二个目录的配置
279-
# C:\nginx-1.27.5\html\var\www\static\
280-
# location /static/ {
281-
# root /var/www;
282-
# index index.html index.htm;
283-
#}
284-
285-
```
286-
287-
3. Nginx for Windows
288-
289-
```bash
290-
1. start nginx
291-
2. nginx -s stop
292-
3. nginx -s quit
293-
4. nginx -s reload
294-
5. nginx -s reopen
295-
```
296-
297-
---
182+
## 🤝 贡献指南
298183

299-
## 🌳 Tree Node Cli
184+
欢迎 PR、Issue 与 Star!
300185

301-
1. npm install -g tree-node-cli
302-
2. Mac: tree -L 2 -I "node_modules" -r -F
303-
3. Win: treee -L 2 -I "node_modules" -r -F
186+
1. Fork 本仓库
187+
2. 新建分支:`git checkout -b feature/xxx`
188+
3. 提交更改:`git commit -m 'feat: 新增 xxx 功能'`
189+
4. 推送分支:`git push origin feature/xxx`
190+
5. 新建 Pull Request
304191

305192
---
306193

307-
## 📦 Webpack Analyse
308-
309-
1. [Webpack 官方分析工具](https://webpack.github.io/analyse/)
310-
311-
```bash
312-
npm run analyze:build
313-
```
314-
315-
2. 依赖分析
194+
## 📄 License
316195

317-
```bash
318-
1. npm run js-analyzer
319-
2. "standard": "standard src/\*_/_",
320-
3. "standard:fix": "standard --fix src/\*_/_",
321-
4. rm -rf package-lock.json
322-
```
196+
Apache-2.0 © [wkylin](https://github.com/wkylin)
323197

324198
---
325199

326-
## 🚀 GitHub Proxy
327-
328-
1. 首先确认自己 git 拉取代码的方式
329-
330-
```bash
331-
git remote -v
332-
```
333-
334-
2. 设置代理
335-
336-
```bash
337-
git config --global https.proxy 127.0.0.1:10808
338-
git config --global http.proxy 127.0.0.1:10808
339-
git config --global http.proxy 'socks5://127.0.0.1:10808'
340-
git config --global https.proxy 'socks5://127.0.0.1:10808'
341-
```
342-
343-
3. 查看代理是否成功
344-
345-
```bash
346-
git config --get --global http.proxy
347-
```
348-
349-
4. 查看 git 配置
200+
## 🧩 约定式提交
350201

351-
```bash
352-
git config --global --list
353-
```
354-
355-
5. 取消代理
356-
357-
```bash
358-
git config --global --unset http.proxy
359-
git config --global --unset https.proxy
360-
```
361-
362-
## 🤝 Show your support
202+
1. [约定式提交](https://www.conventionalcommits.org/zh-hans/v1.0.0/)
203+
2. [语义化版本 2.0.0](https://semver.org/lang/zh-CN/)
363204

364205
---
365206

366-
## ⚙️ CI / 部署
367-
368-
本项目在 CI/部署 环境中支持可选的 Sentry 集成(用于上传 release 与 source maps),且在未配置上传凭证时会自动跳过以避免构建警告。
369-
370-
- 目的:在需要时将 release/source maps 上传到 Sentry;在本地或未配置 token 时跳过上传,避免泄露凭证或出现不必要警告。
371-
- 关键环境变量:
372-
- `SENTRY_AUTH_TOKEN` — Sentry API token(CI secrets),用于 `sentry-webpack-plugin` 上传 artifacts。
373-
- `SENTRY_ORG` — Sentry 组织 slug。
374-
- `SENTRY_PROJECT` — Sentry 项目 slug。
375-
- `SENTRY_DSN` — 前端运行时使用的 DSN(可在部署时注入至运行时代码)。
376-
- `SENTRY_TRACES_SAMPLE_RATE` — 可选,transactions 采样率(例如 `0.2`)。
377-
378-
为什么会出现警告
379-
- `sentry-webpack-plugin` 在没有 `authToken` 时会打印警告并跳过上传;本仓库的 `webpack/webpack.prod.js` 已修改为:仅当 `SENTRY_AUTH_TOKEN` 存在时才注册该插件,否则构建继续并输出简短提示。
380-
381-
GitHub Actions 示例
382-
383-
```yaml
384-
name: Build
385-
on: [push]
386-
jobs:
387-
build:
388-
runs-on: ubuntu-latest
389-
steps:
390-
- uses: actions/checkout@v4
391-
- name: Use Node.js
392-
uses: actions/setup-node@v4
393-
with:
394-
node-version: '18'
395-
- name: Install
396-
run: npm ci
397-
- name: Build (production)
398-
env:
399-
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
400-
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
401-
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
402-
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
403-
SENTRY_TRACES_SAMPLE_RATE: 0.2
404-
run: npm run build:production
405-
```
406-
407-
Vercel / Netlify
408-
- 在项目的 Environment Variables / Build settings 中添加 `SENTRY_AUTH_TOKEN``SENTRY_ORG``SENTRY_PROJECT``SENTRY_DSN`,部署时这些变量会注入到构建与运行时环境。
409-
410-
本地开发
411-
- 不要在本地把 `SENTRY_AUTH_TOKEN` 写入源码或提交到仓库。可在本地 `.env` 或 CI 的 secrets 中临时添加 `SENTRY_DSN` 用于运行时错误上报测试,但将 `SENTRY_AUTH_TOKEN` 保持为空以跳过上传步骤。
412207

413-
如何创建 `SENTRY_AUTH_TOKEN`
414-
- 前往 https://sentry.io/settings/<ORG>/api/,创建一个具有 `project:releases``org:read` 权限的 token,并把它存入 CI 的 secrets。
415-
416-
注意
417-
- `SENTRY_DSN`(运行时)与 `SENTRY_AUTH_TOKEN`(CI 上传)用途不同,请勿混淆;本项目的运行时代码会优先使用 `process.env.SENTRY_DSN`,构建时的插件仅在 `SENTRY_AUTH_TOKEN` 存在时运行。
208+
## 🤝 Show your support
418209

210+
If you like the project, give it a star ⭐️, it will be a great encouragement to me.
419211

420-
<!-- Give a ⭐️ if this project helped you! -->
212+
---
421213

422-
If you like the project, give it a star ⭐️, it will be a great encouragement to me.
423214

424215
## ⭐️ Star History
425216

0 commit comments

Comments
 (0)