Skip to content

Commit 46aa125

Browse files
committed
update docs
1 parent 4aee569 commit 46aa125

File tree

9 files changed

+91
-108
lines changed

9 files changed

+91
-108
lines changed

docs/.vuepress/navbar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const myNavbar = defineNavbarConfig([
7979
]
8080
},
8181
{
82-
text: '插件市场',
82+
text: '插件系统',
8383
icon: 'unjs:unplugin',
8484
link: '/plugin/before'
8585
},

docs/.vuepress/sidebar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export const mySidebar: ThemeSidebarMulti = {
6868
{ text: '前言', link: 'before' },
6969
{ text: '插件开发', link: 'dev' },
7070
{ text: '插件发布', link: 'publish' },
71+
{ text: '安装使用', link: 'install' },
7172
{ text: '插件市场', link: 'market' },
7273
]
7374
}

docs/.vuepress/styles/custom.css

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,6 @@
1818
--vp-c-brand-3: rgba(0, 148, 133, 1);
1919
}
2020

21-
/* 文档式首页 name */
22-
.vp-home-doc-hero .container .main .heading .name {
23-
font-size: 48px !important;
24-
}
25-
26-
27-
/* 文档式首页 text */
28-
.vp-home-doc-hero .container .main .heading .text {
29-
font-size: 48px !important;
30-
}
31-
32-
.vp-repo-card,
33-
.vp-link-card,
34-
.vp-card-wrapper {
35-
/* 卡片阴影效果 */
36-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.27), 0 1px 2px rgba(255, 255, 255, 0.22) !important;
37-
}
38-
3921
.vp-swiper .swiper-slide-img {
4022
/* 轮播图图片拉伸效果 */
4123
object-fit: fill;

docs/backend/summary/quick-start.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ fba 仅适用于资深 Python 后端开发人员,如果您是非资深用户
6666
6767
2. 插件依赖
6868
69-
::: warning
70-
为了实现插件 0 耦合,插件依赖并未使用 uv 进行管理。执行以下脚本后,后期如果仍需同步环境依赖,请务必使用命令:
71-
`uv sync --frozen --inexact`
72-
:::
73-
7469
执行 `backend/scripts/init_plugin.py` 文件安装插件依赖
7570
7671
::: details 报错:ModuleNotFoundError: No module named 'backend'
@@ -94,6 +89,11 @@ fba 仅适用于资深 Python 后端开发人员,如果您是非资深用户
9489
9590
:::
9691
92+
::: caution
93+
为了实现插件 0 耦合,插件依赖并未使用 uv 进行管理。执行上面脚本文件后,如果后期您仍需同步环境依赖,请务必使用命令:
94+
`uv sync --frozen --inexact`,否则插件依赖将被 uv 自动清理!
95+
:::
96+
9797
4. 创建数据库:`fba`,选择 utf8mb4 编码;PostgreSQL 用户可忽略编码
9898
5. 启动 Redis
9999
6. env
@@ -134,7 +134,7 @@ fba 仅适用于资深 Python 后端开发人员,如果您是非资深用户
134134
执行 `backend/sql/` 目录下对应数据库的 `create_tables.sql` 脚本
135135
:::
136136

137-
9. 启动 celery worker, beat 和 flower <Badge type="warning" text="此步骤为可选" />
137+
9. 启动 celery worker, beat 和 flower <Badge type="warning" text="此步骤为可选,三个都可以不执行" />
138138

139139
`backend` 目录打开终端,执行以下命令启动 celery 相关服务
140140

@@ -165,12 +165,8 @@ fba 仅适用于资深 Python 后端开发人员,如果您是非资深用户
165165

166166
11. 启动 fastapi 服务
167167

168-
::: info
169-
此项目默认使用 CLI 启动服务,为了方便本地调试,你仍然可以选择在 IDE 中右键运行 `run.py` 文件
170-
:::
171-
172168
::: warning
173-
如果你在项目中安装了 [应用级插件](../../plugin/dev.md#插件分类),请务必使用 `run.py`
169+
如果你在项目中安装了 [应用级插件](../../plugin/market.md),请务必使用 `run.py`
174170
文件启动项目,否则,您将收到启动错误
175171

176172
详情:[fastapi/fastapi#13372 (comment)](https://github.com/fastapi/fastapi/discussions/13372#discussioncomment-12211232)

docs/group.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 社区
2+
title: 互动
33
---
44

55
您可以通过此链接 [null](https://wu-clan.github.io/homepage/) 中的任意联系方式与 fba 作者互动

docs/plugin/dev.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,23 @@ title: 插件开发
66

77
:::: steps
88

9-
1. clone 最新 fba 项目到本地并配置好开发环境
10-
2. 根据 [插件目录结构](#插件目录结构)
11-
开发插件,在开始前,开发者还需了解 [插件分类](#插件分类)[插件路由结构](#插件路由结构)[插件配置](#插件配置)
12-
3. 完成插件开发
13-
4. 插件分享 <Badge type="warning" text="可选" />
9+
1. 拉取最新的 fba 项目到本地并配置好开发环境
10+
2. 通过 [插件分类](#插件分类)[插件路由结构](#插件路由结构)[插件配置](#插件配置) 了解插件系统的运作机制
11+
3. 根据 [插件目录结构](#插件目录结构) 进行插件开发
12+
4. 完成插件开发
13+
5. 插件分享 <Badge type="warning" text="可选" />
1414

1515
使用插件模板仓库 [fba_plugin_template](https://github.com/fastapi-practices/fba_plugin_template)
1616
创建个人仓库,并将插件代码上传到个人仓库
1717

1818
::: warning
19-
请不要将插件代码以 PR 的方式进行提交!它永远不会被接受!
19+
请不要将插件代码以 PR 的方式进行提交!
2020
:::
2121

22-
5. [申请发布插件](publish.md) <Badge type="warning" text="可选" />
22+
6. [申请发布插件](publish.md) <Badge type="warning" text="可选" />
2323

2424
::::
2525

26-
### 插件目录结构
27-
28-
::: file-tree
29-
30-
- backend 固定目录 <Badge type="danger" text="必须" />
31-
- plugin 固定目录 <Badge type="danger" text="必须" />
32-
- xxx 插件名 <Badge type="danger" text="必须" />
33-
- api/ 接口 <Badge type="danger" text="必须" />
34-
- crud/ CRUD <Badge type="warning" text="非必须" />
35-
- model/ 模型 <Badge type="warning" text="非必须" />
36-
- \_\_init__.py 在此文件内导入所有模型类 <Badge type="danger" text="必须" />
37-
- …
38-
- schema/ 数据传输 <Badge type="warning" text="非必须" />
39-
- service/ 服务 <Badge type="warning" text="非必须" />
40-
- utils/ 工具包 <Badge type="warning" text="非必须" />
41-
- \_\_init__.py 作为 python 包保留 <Badge type="danger" text="必须" />
42-
- ...
43-
- conf.py 常量配置 <Badge type="warning" text="非必须" />
44-
- plugin.toml 插件配置文件 <Badge type="danger" text="必须" />
45-
- README.md 插件使用说明 <Badge type="danger" text="必须" />
46-
- requirements.txt 依赖包文件 <Badge type="warning" text="非必须" />;
47-
如果插件需要安装依赖,则为 <Badge type="danger" text="必须" />
48-
49-
:::
50-
5126
### 插件分类
5227

5328
与插件相关的部分文档中,可能高频次出现以下两个词
@@ -110,6 +85,31 @@ tags = ''
11085

11186
:::
11287

88+
### 插件目录结构
89+
90+
::: file-tree
91+
92+
- backend 固定目录 <Badge type="danger" text="必须" />
93+
- plugin 固定目录 <Badge type="danger" text="必须" />
94+
- xxx 插件名 <Badge type="danger" text="必须" />
95+
- api/ 接口 <Badge type="danger" text="必须" />
96+
- crud/ CRUD <Badge type="warning" text="非必须" />
97+
- model/ 模型 <Badge type="warning" text="非必须" />
98+
- \_\_init\_\_.py 在此文件内导入所有模型类 <Badge type="danger" text="必须" />
99+
-
100+
- schema/ 数据传输 <Badge type="warning" text="非必须" />
101+
- service/ 服务 <Badge type="warning" text="非必须" />
102+
- utils/ 工具包 <Badge type="warning" text="非必须" />
103+
- \_\_init\_\_.py 作为 python 包保留 <Badge type="danger" text="必须" />
104+
- ...
105+
- conf.py 插件配置 <Badge type="warning" text="非必须" />
106+
- plugin.toml 插件配置文件 <Badge type="danger" text="必须" />
107+
- README.md 插件使用说明 <Badge type="danger" text="必须" />
108+
- requirements.txt 依赖包文件 <Badge type="warning" text="非必须" />;
109+
如果插件需要安装依赖,则为 <Badge type="danger" text="必须" />
110+
111+
:::
112+
113113
## 前端
114114

115115
暂无此计划...

docs/plugin/install.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: 安装使用
3+
---
4+
5+
插件安装方式包含以下两种:
6+
7+
:::: tabs
8+
@tab 1. 手动
9+
10+
1. 获取插件仓库源码并下载
11+
2. 将源码中的插件目录直接拷贝到 fba 项目对应的目录下
12+
13+
::: tabs
14+
@tab 后端
15+
16+
将插件源码 `backend/plugin/` 目录下的一级文件夹拷贝到 fba 项目 `backend/plugin/` 目录下
17+
18+
@tab 前端
19+
20+
暂无此计划...
21+
:::
22+
23+
3. 如果插件包含依赖(requirements.txt),执行 `backend/scripts/init_plugin.py` 文件安装依赖
24+
4. 根据插件使用说明完成安装
25+
26+
@tab 2. 自动
27+
28+
1. 获取打包好的插件 zip 压缩包 <Badge type="warning" text="二选一" />
29+
30+
- 下载插件 GitHub 仓库为 zip 压缩包
31+
32+
::: details 示例
33+
![cg1](/images/plugin_zip.png)
34+
:::
35+
36+
- 通过 fba 插件打包接口创建的 zip 压缩包
37+
38+
2. 将压缩包通过 fba 插件安装接口进行安装
39+
3. 根据插件使用说明完成安装
40+
41+
::::
42+
43+
::: warning
44+
无论采用哪种安装方式,插件都不会实时加载,您必须重新启动 fba,插件才能被正确加载到当前系统中
45+
:::

docs/plugin/market.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
title: 插件市场
33
---
44

5-
::: warning
6-
插件功能目前处于测试阶段,如有任何建议,请立即和我们 [反馈](https://discord.com/channels/1185035164577972344/1349951379560599572)
7-
8-
:::
9-
105
::: info 标签说明
116

127
- <Badge type="info" text="free" /> - 免费插件
@@ -88,35 +83,3 @@ title: 插件市场
8883
<Card title="">
8984
</Card>
9085
</CardGrid>
91-
92-
## 安装
93-
94-
插件安装方式包含以下两种:
95-
96-
::: tabs
97-
@tab 1. 手动
98-
99-
1. 获取插件仓库源码并下载,将源码中的插件目录直接拷贝到 fba 项目对应的目录下
100-
2. 如果插件包含依赖,执行 `backend/scripts/init_plugin.py` 文件安装依赖
101-
3. 根据插件使用说明完成安装
102-
103-
@tab 2. 自动
104-
105-
1. 获取打包好的插件 zip 压缩包 <Badge type="warning" text="二选一" />
106-
107-
- 下载插件 GitHub 仓库为 zip 压缩包
108-
109-
::: details 示例
110-
![cg1](/images/plugin_zip.png)
111-
:::
112-
113-
- 通过 fba 插件打包接口创建的 zip 压缩包
114-
115-
2. 将压缩包通过插件安装接口进行安装
116-
3. 根据插件使用说明完成安装
117-
118-
:::
119-
120-
::: warning
121-
无论采用哪种安装方式,插件都不会实时加载,您必须重新启动 fba,插件才能被正确加载到当前系统中
122-
:::

docs/plugin/publish.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
title: 发布
33
---
44

5-
我们为插件打造了一个统一的 [插件市场](market.md),用于展示和导航。如果您开发的插件与 fba 兼容,欢迎在 Discord
5+
我们为插件创建了一个 [插件市场](market.md),用于展示和导航。如果您开发的插件与 fba 兼容,欢迎在 Discord
66
社区的 [插件系统](https://discord.com/channels/1185035164577972344/1349951379560599572)
7-
频道与我们分享。我会第一时间将您的插件更新至插件市场,让更多开发者能够便捷地使用和享受。
7+
频道与我们分享。
88

99
> [!IMPORTANT]
1010
> 发布插件需满足以下要求:
1111
>
12-
> - 必须提供插件 GitHub 仓库
13-
> - 必须在插件仓库内提供至少一种(任意)联系方式
14-
15-
::: note
16-
插件数量 >= 2 的插件作者,我们将提供知识星球永久免费入驻名额
17-
:::
12+
> - 必须提供插件 GitHub 仓库地址
13+
> - 必须在插件仓库内提供至少一种您的(任意)联系方式

0 commit comments

Comments
 (0)