Skip to content

Commit da774c6

Browse files
committedMar 11, 2025··
update docs
1 parent 7378f89 commit da774c6

File tree

15 files changed

+164
-157
lines changed

15 files changed

+164
-157
lines changed
 

‎docs/.vuepress/bulletin.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import {BulletinOptions} from "vuepress-theme-plume";
22

33
export const myBulletin: BulletinOptions = {
4-
layout: 'bottom-right',
54
enablePage: true,
65
lifetime: 'session',
76
contentType: 'markdown',
8-
// title: 'Vben Admin Antd',
9-
content: '欢迎大家闲聊,分享,提供建议,高频艾特,你们的活跃度是我更新的动力',
7+
title: 'FasAPI 最佳架构',
8+
content: '欢迎大家闲聊,分享,提供建议,高频艾特,你们的活跃度是我更新的动力 🌹',
109
}

‎docs/.vuepress/sidebar.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export const mySidebar: SidebarMulti = {
2525
{text: '分页', link: 'pagination'},
2626
{text: '自定义异常', link: '/planet', icon: 'fluent-color:receipt-16'},
2727
{text: '切换数据库', link: 'db'},
28+
{text: '鉴权', link: 'permission'},
2829
{text: 'JWT', link: 'jwt'},
2930
{text: 'RBAC', link: 'RBAC'},
30-
{text: '鉴权', link: 'permission'},
3131
{text: '数据规则', link: '/planet', icon: 'fluent-color:video-16'},
3232
{text: '代码生成', link: 'code-generation'},
3333
{text: '跨域', link: 'CORS'},

‎docs/guide/deploy/Docker.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ title: Docker 部署
2424

2525
`backend` 目录中,创建环境变量文件
2626

27-
```shell
27+
```shell:no-line-numbers
2828
touch .env
2929
```
3030

3131
将初始化环境变量配置拷贝到环境变量文件中
3232

33-
```shell
33+
```shell:no-line-numbers
3434
cp .env.example .env
3535
```
3636

@@ -40,15 +40,15 @@ title: Docker 部署
4040

4141
如果容器要在本地启动,需要将 `.env` 中的 `127.0.0.1` 更改为 `host.docker.internal`
4242

43-
```shell
44-
docker build -f backend/Dockerfile -t fba_backend_independent .
43+
```shell:no-line-numbers
44+
docker build -f Dockerfile -t fba_backend_independent .
4545
```
4646

4747
5. 启动容器
4848

4949
由于构建不包含数据库,请确保本地已安装并启动相关数据库(mysql / postgresql、redis)
5050

51-
```shell
51+
```shell:no-line-numbers
5252
docker run -d -p 8000:8000 --name fba_server fba_backend_independent
5353
```
5454

@@ -85,7 +85,8 @@ title: Docker 部署
8585

8686
::: warning
8787
如果你需要使用 PostgreSQL 数据库,执行命令前,需修改 `.env.server` 部分配置如下:
88-
```env
88+
```env:no-line-numbers
89+
# Database
8990
DATABASE_TYPE='postgresql'
9091
DATABASE_HOST='fba_postgres'
9192
DATABASE_PORT=5432
@@ -102,8 +103,8 @@ title: Docker 部署
102103
services:
103104
fba_server:
104105
build:
105-
context: ../../../
106-
dockerfile: backend/Dockerfile
106+
context: .
107+
dockerfile: Dockerfile
107108
image: fba_server:latest
108109
container_name: fba_server
109110
restart: always
@@ -247,8 +248,8 @@ title: Docker 部署
247248

248249
fba_celery:
249250
build:
250-
context: ../../../
251-
dockerfile: backend/Dockerfile
251+
context: .
252+
dockerfile: Dockerfile
252253
args:
253254
- SERVER_TYPE=celery
254255
image: fba_celery:latest
@@ -298,7 +299,7 @@ title: Docker 部署
298299
299300
命令执行期间遇到镜像拉取问题请自行 Google
300301
301-
```shell
302+
```shell:no-line-numbers
302303
docker-compose up -d --build
303304
```
304305

@@ -311,14 +312,13 @@ title: Docker 部署
311312

312313
1. 拉取代码到服务器
313314
2. env
314-
315-
:::: details Arco Desgin Vue
315+
::: tabs
316+
@tab <Icon name="icon-park-outline:new-lark" />Arco Desgin Vue
316317
修改 `.env.production` 中的 `VITE_API_BASE_URL` 为域名地址
317-
::::
318318

319-
:::: details Vben Admin Antd
320-
即将到来...
321-
::::
319+
@tab <Icon name="devicon:antdesign" />Vben Admin Antd
320+
生产中...
321+
:::
322322

323323
3. 更新 nginx 配置
324324

@@ -461,19 +461,19 @@ title: Docker 部署
461461
462462
创建网络
463463
464-
```shell
464+
```shell:no-line-numbers
465465
docker network create fba_network
466466
```
467467

468468
构建
469469

470-
```shell
470+
```shell:no-line-numbers
471471
docker-compose build fba_ui
472472
```
473473

474474
启动
475475

476-
```shell
476+
```shell:no-line-numbers
477477
docker-compose run fba_ui
478478
```
479479

@@ -491,18 +491,18 @@ title: Docker 部署
491491

492492
清理未使用的镜像
493493

494-
```shell
494+
```shell:no-line-numbers
495495
docker image prune
496496
```
497497

498498
清理未使用的容器
499499

500-
```shell
500+
```shell:no-line-numbers
501501
docker container prune
502502
```
503503

504504
清理所有未使用的镜像、容器、网络和构建缓存
505505

506-
```shell
506+
```shell:no-line-numbers
507507
docker system prune
508508
```

‎docs/guide/mixin/CRUD.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class DateTimeMixin(MappedAsDataclass):
3737

3838
[MappedAsDataclass](https://docs.sqlalchemy.org/en/20/orm/dataclasses.html#orm-declarative-native-dataclasses)
3939

40-
声明性数据类基类, 它将带有数据类集成, 允许使用更高级配置;此基类适用于==不包含日期时间的模型==
40+
声明性数据类基类, 它将带有数据类集成, 允许使用更高级配置;此基类适用于==不包含日期时间的模型=={.warning}
4141

4242
```python
4343
class DataClassBase(MappedAsDataclass, MappedBase):

‎docs/guide/reference/CORS.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ CORS_ALLOWED_ORIGINS: list[str] = [
1515

1616
## 服务器
1717

18-
HTTP 部署
18+
::: code-tabs
19+
@tab <Icon name="arcticons:http-custom" />HTTP
1920

2021
```py
2122
# [!code word:http]
@@ -24,7 +25,7 @@ CORS_ALLOWED_ORIGINS: list[str] = [
2425
]
2526
```
2627

27-
HTTPS 部署
28+
@tab <Icon name="ic:outline-https" /> HTTPS
2829

2930
```py
3031
# [!code word:https]

‎docs/guide/reference/RBAC.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ fba 中默认使用此鉴权方式
9595
```
9696

9797
3. 了解策略
98-
99-
p 策略
98+
::: tabs
99+
@tab p 策略
100100
- 添加基于角色的访问权限(推荐)
101101

102102
需要配合添加 g 策略才能实现用户访问权限,适合配置所有用户接口访问策略,拥有此角色的用户便能拥有相应的访问权限<br>
@@ -109,10 +109,10 @@ fba 中默认使用此鉴权方式
109109

110110
格式:`用户 uuid + 访问路径 path + 访问方法 method`
111111

112-
g 策略(基于 p 策略):
113-
- 添加基于角色的访问权限
112+
@tab g 策略
113+
当 p 策略为【添加基于角色的访问权限】时,需要此策略
114114

115-
格式:`用户 uuid + 角色 role`
115+
格式:`用户 uuid + 角色 role`
116116

117117
4. 添加策略
118118

‎docs/guide/reference/apscheduler.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ FastAPI + APScheduler 现已作为独立仓库发行,它的优势在于其灵
1010
<RepoCard repo="fastapi-practices/fastapi_scheduler" />
1111

1212
::: warning
13-
此仓库 master 分支使用 APScheduler 4.x 版本进行开发,但由于 aps
14-
迟迟未发布 4.x 版本,所以请切换 apscheduler-3.x 分支,它是目前比较流行的版本分支,也相对比较稳定
13+
此仓库 master 分支使用 APScheduler 4.x 版本进行开发,但由于 APScheduler 迟迟未发布 4.x 版本,所以请切换 apscheduler-3.x
14+
分支,它是目前比较流行的版本分支,也相对比较稳定
1515
:::

‎docs/guide/reference/db.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fba 支持 MySQL、PostgreSQL 两种数据库,默认配置使用 MySQL
1010

1111
如果本地未安装 PostgreSQL,你可以使用以下命令创建 Docker 镜像
1212

13-
```shell
13+
```shell:no-line-numbers
1414
docker run -d --name fba_postgres --restart always -e POSTGRES_DB='fba' -e POSTGRES_PASSWORD='123456' -e TZ='Asia/Shanghai' -v fba_postgres:/var/lib/postgresql/data -p 5432:5432 postgres:16
1515
```
1616

@@ -19,7 +19,7 @@ docker run -d --name fba_postgres --restart always -e POSTGRES_DB='fba' -e POSTG
1919
PostgreSQL 与 MySQL 在用户名、端口号等方面有所不同,如果你使用上面的命令创建了 Docker 镜像,需修改 `.env` 部分配置如下,否则,请根据
2020
PostgreSQL 配置进行修改
2121

22-
```env
22+
```env:no-line-numbers
2323
# Database
2424
DATABASE_TYPE='postgresql'
2525
DATABASE_HOST='127.0.0.1'

‎docs/guide/reference/response.md

+12-9
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ class ResponseModel(BaseModel):
1919
以下是使用此模型进行返回的示例(遵循 FastAPI 官方教程),`response_model` 参数和 `->` 类型我们只需选择其中一种方式即可,因为
2020
FastAPI 会在内部自动解析并获取最终响应结构
2121

22-
`response_model` 参数
22+
`response_model` 参数
2323

2424
```python{1,3}
2525
@router.get('/test', response_model=ResponseModel)
2626
def test():
2727
return ResponseModel(data={'test': 'test'})
2828
```
2929

30-
`->` 类型
30+
`->` 类型
3131

3232
```python{2,3}
3333
@router.get('/test')
@@ -51,15 +51,15 @@ class ResponseSchemaModel(ResponseModel, Generic[SchemaT]):
5151

5252
这是我们创建的用于 Schema 模式的统一返回模型,它的用法与 `ResponseModel` 基本相似
5353

54-
`response_model` 参数
54+
`response_model` 参数
5555

5656
```python{1,3}
5757
@router.get('/test', response_model=ResponseSchemaModel[GetApiDetail])
5858
def test():
5959
return ResponseSchemaModel[GetApiDetail](data=GetApiDetail(...))
6060
```
6161

62-
`->` 类型
62+
`->` 类型
6363

6464
```python{2,3}
6565
@router.get('/test')
@@ -98,7 +98,8 @@ def test() -> ResponseSchemaModel[GetApiDetail]:
9898
它们都是同步方法,而不是异步。因为这些返回方法并不涉及 io 操作,所以,定义为异步,不但没有性能提升,反而增加了异步协程的开销
9999
:::
100100

101-
`success()`
101+
::: tabs
102+
@tab <Icon name="ix:success-filled" />`success()`
102103

103104
此方法通常作为默认响应方法使用,默认返回信息如下
104105

@@ -110,19 +111,19 @@ def test() -> ResponseSchemaModel[GetApiDetail]:
110111
}
111112
```
112113

113-
`fail()`
114+
@tab <Icon name="ix:namur-failure-filled" />`fail()`
114115

115116
此方法通常在接口响应信息为失败时使用,默认返回信息如下
116117

117118
```json
118119
{
119-
"code": 200,
120-
"msg": "请求成功",
120+
"code": 400,
121+
"msg": "请求错误",
121122
"data": null
122123
}
123124
```
124125

125-
`fast_success()`
126+
@tab <Icon name="ix:certificate-success-filled" />`fast_success()`
126127

127128
此方法通常仅用于接口返回大型 json 时,可为 json 解析性能带来质的提升,默认返回信息如下
128129

@@ -134,6 +135,8 @@ def test() -> ResponseSchemaModel[GetApiDetail]:
134135
}
135136
```
136137

138+
:::
139+
137140
## 响应状态码
138141

139142
在文件 `backend/common/response/response_code.py` 中内置了多种定义响应状态码的方式,我们可以根据 `CustomResponseCode`

‎docs/guide/reference/transaction.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ async def create(*, obj: CreateIns) -> None:
4747

4848
## 如何选择?
4949

50-
以上两种方法,我们更推荐第二种;
50+
以上两种方法,我们更推荐使用 `begin()`,理由如下:
5151

52-
对于 fba 来说,它更加符合架构风格,并且也能减少千篇一律的接口参数(纯作者强迫症)
53-
54-
而对于无需使用自动提交的事务,我们只需将 `begin()` 方法去掉,直接使用 `async_db_session()` 即可
52+
1. 对于 fba 来说,它更加符合架构风格,并且也能减少千篇一律的接口参数(纯作者强迫症)
53+
2. 而对于无需使用自动提交的事务,我们只需将 `begin()` 方法去掉,直接使用 `async_db_session()` 即可

‎docs/guide/summary/quick-start.md

+53-44
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ title: 快速开始
3838

3939
此方式需要你删除拉取项目后根目录下的 `.git` 文件夹,之后上传到你指定的仓库即可,具体请自行查阅你要上传平台的行为准则
4040

41-
```shell
41+
```shell:no-line-numbers
4242
git clone https://github.com/fastapi-practices/fastapi_best_architecture.git
4343
```
4444
@@ -52,17 +52,21 @@ title: 快速开始
5252
5353
3. 安装依赖包
5454
55-
::: note
56-
fba 内默认使用 pypi 官方源,如果您需要安装依赖加速,可选择 🪜 或 [替换 pypi 国内源](https://github.com/RubyMetric/chsrc)
57-
:::
58-
5955
- 架构依赖
6056
6157
拉取项目到本地后,在项目根目录,执行以下命令安装架构依赖
6258
63-
```shell
59+
::: code-tabs
60+
@tab <Icon name="material-icon-theme:uv" />uv
61+
```shell:no-line-numbers
62+
uv sync --frozen
63+
```
64+
65+
@tab <Icon name="material-icon-theme:python" />pip
66+
```shell:no-line-numbers
6467
pip install -r requirements.txt
6568
```
69+
:::
6670
6771
- 插件依赖
6872
@@ -74,55 +78,57 @@ title: 快速开始
7478
7579
在 `backend` 目录中,创建环境变量文件
7680
77-
```shell
81+
```shell:no-line-numbers
7882
touch .env
7983
```
8084

8185
将初始化环境变量配置拷贝到环境变量文件中
8286

83-
```shell
87+
```shell:no-line-numbers
8488
cp .env.example .env
8589
```
8690

8791
7. 按需修改配置文件 `backend/core/conf.py``.env`
8892
8. 创建数据库表(三选一)
8993

90-
- 直接启动后端项目(自动创建)
91-
- 数据库迁移 [alembic](https://alembic.sqlalchemy.org/en/latest/tutorial.html)
92-
93-
生成迁移文件
94+
::: tabs
95+
@tab 自动创建
96+
直接启动后端项目
9497

95-
```shell
96-
alembic revision --autogenerate
97-
```
98-
99-
执行迁移
100-
101-
```shell
102-
alembic upgrade head
103-
```
98+
@tab Alembic 迁移
99+
生成迁移文件
100+
```shell:no-line-numbers
101+
alembic revision --autogenerate
102+
```
104103

105-
- 执行 `backend/sql/` 目录下对应数据库的 `create_tables.sql` 脚本
104+
执行迁移
105+
```shell:no-line-numbers
106+
alembic upgrade head
107+
```
106108

107-
9. 启动 celery worker, beat 和 flower ==(可选)==
109+
@tab SQL 脚本
110+
执行 `backend/sql/` 目录下对应数据库的 `create_tables.sql` 脚本
111+
:::
108112

109-
Celery 应用程序
113+
9. 启动 celery worker, beat 和 flower <Badge type="warning" text="此步骤为可选" />
110114

111-
```shell
115+
::: code-tabs
116+
@tab Worker
117+
```shell:no-line-numbers
112118
celery -A app.task.celery worker -l info
113119
```
114120

115-
定时任务
116-
117-
```shell
121+
@tab Beat
122+
```shell:no-line-numbers
118123
celery -A app.task.celery beat -l info
119124
```
120-
121-
web 监控
122-
123-
```shell
125+
126+
@tab Flower
127+
```shell:no-line-numbers
124128
celery -A app.task.celery flower --port=8555 --basic-auth=admin:123456
125129
```
130+
:::
131+
126132

127133
10. 初始化测试数据
128134

@@ -143,13 +149,13 @@ title: 快速开始
143149

144150
帮助
145151

146-
```shell
152+
```shell:no-line-numbers
147153
fastapi --help
148154
```
149155
150156
开发模式
151157
152-
```shell
158+
```shell:no-line-numbers
153159
fastapi dev main.py
154160
```
155161
@@ -164,7 +170,8 @@ title: 快速开始
164170
效果演示,它们不一定适用于生产环境,您可以点击查看我们的 [目标](./why.md#目标)
165171
:::
166172
167-
::::: details Arco Desgin Vue
173+
::::: tabs
174+
@tab <Icon name="icon-park-outline:new-lark" />Arco Desgin Vue
168175
169176
::: caution
170177
这是一个实验性实施,仅用于效果演示,此版本即将存档,请勿将其用于生产!
@@ -179,7 +186,7 @@ title: 快速开始
179186
180187
2. 拉取 Git 项目
181188
182-
```shell
189+
```shell:no-line-numbers
183190
git clone https://github.com/fastapi-practices/fastapi_best_architecture_ui.git
184191
```
185192

@@ -192,50 +199,52 @@ title: 快速开始
192199

193200
进入项目根目录,安装依赖
194201

195-
```shell
202+
```shell:no-line-numbers
196203
yarn install
197204
```
198205

199206
启动
200207

201-
```shell
208+
```shell:no-line-numbers
202209
yarn dev
203210
```
204211

205212
::::
206-
:::::
207213

208-
::::: details Vben Admin Antd
214+
@tab <Icon name="devicon:antdesign" />Vben Admin Antd
209215

210216
::: tip
211217
这是下一代实施,目前正处于积极开发阶段,未来将完全适配 fba
212218
:::
213219

220+
:::: steps
221+
214222
1. 准备本地环境
215223

216224
* Nodejs 20.10.0+
217225
* pnpm 9.12.0+
218226

219227
2. 拉取 Git 项目
220228

221-
```shell
229+
```shell:no-line-numbers
222230
git clone https://github.com/fastapi-practices/fba_admin.git
223231
```
224232

225233
3. 安装和启动
226234

227235
进入项目根目录,安装依赖
228236

229-
```shell
237+
```shell:no-line-numbers
230238
pnpm install
231239
```
232240

233241
启动
234242

235-
```shell
243+
```shell:no-line-numbers
236244
pnpm dev
237245
```
238246

247+
::::
239248
:::::
240249

241250
## 开发流程
@@ -271,7 +280,7 @@ title: 快速开始
271280
3. 初始化测试数据,执行 `backend/sql/` 目录下对应数据库的 `init_test_data.sql` 脚本
272281
4. 在项目根目录,执行单元测试命令
273282

274-
```shell
283+
```shell:no-line-numbers
275284
pytest -vs --disable-warnings
276285
```
277286

‎docs/planet.md

-10
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,6 @@ title: 知识星球
8787
/>
8888
</CardGrid>
8989

90-
### TODO
91-
92-
<CardGrid>
93-
<LinkCard
94-
title="空"
95-
icon="fluent-color:receipt-16"
96-
description="..."
97-
/>
98-
</CardGrid>
99-
10090
## 插件
10191

10292
::: note

‎docs/plugin/dev.md

+47-44
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ title: 插件开发
3030

3131
与插件相关的部分文档中,可能高频次出现以下两个词
3232

33-
- ==应用级插件=={.note}
34-
35-
[项目结构](../guide/summary/intro.md#项目结构) 中,app
36-
目录下的一级文件夹被视为应用,此原理同样应用于插件系统。也就是说,如果插件被开发为应用,那么它们将会像应用一样被注入到系统中,我们称这类插件为【应用级插件】
37-
38-
- ==扩展级插件=={.note}
39-
40-
与【应用级插件】相反,如果插件不被开发为应用,那么它们将被开发为 app 目录下已存在应用的扩展功能,并做为扩展 API
41-
被注入应用中,我们称这类插件为【扩展级插件】
33+
::: tabs
34+
@tab <Icon name="carbon:app" />应用级插件
35+
[项目结构](../guide/summary/intro.md#项目结构) 中,app
36+
目录下的一级文件夹被视为应用,此原理同样应用于插件系统。也就是说,如果插件被开发为应用,那么它们将会像应用一样被注入到系统中,我们称这类插件为【应用级插件】
37+
38+
@tab <Icon name="fluent:table-simple-include-16-regular" />扩展级插件
39+
与【应用级插件】相反,如果插件不被开发为应用,那么它们将被开发为 app 目录下已存在应用的扩展功能,并做为扩展 API
40+
被注入应用中,我们称这类插件为【扩展级插件】
41+
:::
4242

4343
### 插件目录结构
4444

@@ -59,7 +59,7 @@ title: 插件开发
5959
- conf.py 常量配置 <Badge type="warning" text="非必须" />
6060
- plugin.toml 插件配置文件 <Badge type="danger" text="必须" />
6161
- README.md 插件使用说明 <Badge type="danger" text="必须" />
62-
- requirements.txt 依赖包文件 <Badge type="warning" text="非必须" />
62+
- requirements.txt 依赖包文件 <Badge type="warning" text="非必须" />
6363
如果插件需要安装依赖,则为 <Badge type="danger" text="必须" />
6464

6565
:::
@@ -69,46 +69,49 @@ title: 插件开发
6969
如果插件符合插件开发的要求,则插件中的所有路由都将自动注入到 FastAPI 应用中,无需任何其他操作,但值得注意的是,启动时间可能会随着插件数量的递增而增加,因为
7070
fba 会在启动前对所有插件进行解析
7171

72-
- 应用级插件
73-
74-
插件路由应完全遵循 [路由结构](../guide/reference/router.md#路由结构) 进行定义
72+
::: tabs
73+
@tab <Icon name="carbon:app" />应用级插件
74+
插件路由应完全遵循 [路由结构](../guide/reference/router.md#路由结构) 进行定义
7575

76-
- 扩展级插件
77-
78-
插件路由必须根据现有应用中的目录结构进行 1:1 复制,可参考 fba
79-
中的内置插件 [notice](https://github.com/fastapi-practices/fastapi_best_architecture/tree/master/backend/plugin/notice/api)
76+
@tab <Icon name="fluent:table-simple-include-16-regular" />扩展级插件
77+
插件路由必须根据现有应用中的目录结构进行 1:1 复制,可参考 fba
78+
中的内置插件 [notice](https://github.com/fastapi-practices/fastapi_best_architecture/tree/master/backend/plugin/notice/api)
79+
:::
8080

8181
### 插件配置
8282

8383
`plugin.toml` 是插件的配置文件,它必须存在,此配置文件需根据插件的属性进行定义
8484

85-
- 应用级插件
86-
87-
```toml
88-
# 应用配置
89-
[app]
90-
# 插件路由器版本,默认为 v1,可参考源码:backend/app/admin/api/router.py
91-
router = ['v1']
92-
```
93-
94-
- 扩展级插件
95-
96-
```toml
97-
# 应用配置
98-
[app]
99-
# 此插件属于哪个 app
100-
include = ''
101-
102-
# api 配置
103-
# xxx 对应的是插件 api 目录下的接口文件名(不包含后缀)
104-
# 例如接口文件名为 notice.py,则 xxx 应该为 notice
105-
# 如果包含多个接口文件,则应存在多个相应的 api 配置
106-
[api.xxx]
107-
# 路由前缀,必须以 '/' 开头
108-
prefix = ''
109-
# 标签,用于接口文档
110-
tags = ''
111-
```
85+
::: tabs
86+
@tab <Icon name="carbon:app" />应用级插件
87+
88+
```toml
89+
# 应用配置
90+
[app]
91+
# 插件路由器版本,默认为 v1,可参考源码:backend/app/admin/api/router.py
92+
router = ['v1']
93+
```
94+
95+
@tab <Icon name="fluent:table-simple-include-16-regular" />扩展级插件
96+
97+
```toml
98+
# 应用配置
99+
[app]
100+
# 此插件属于哪个 app
101+
include = ''
102+
103+
# api 配置
104+
# xxx 对应的是插件 api 目录下的接口文件名(不包含后缀)
105+
# 例如接口文件名为 notice.py,则 xxx 应该为 notice
106+
# 如果包含多个接口文件,则应存在多个相应的 api 配置
107+
[api.xxx]
108+
# 路由前缀,必须以 '/' 开头
109+
prefix = ''
110+
# 标签,用于接口文档
111+
tags = ''
112+
```
113+
114+
:::
112115

113116
## 前端
114117

‎docs/plugin/market.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ title: 插件市场
1313
- <Badge type="info" text="free" /> - 免费插件
1414
- <Badge type="danger" text="pay" /> - 付费插件
1515
- <Badge type="tip" text="fba" /> - 仅后端代码插件
16-
- <Badge text="fba + vben" color="#c178ec"/> - 包含前端 [fba_admin](https://github.com/fastapi-practices/fba_admin) 代码插件
16+
- <Badge text="fba + vben" color="#c178ec"/> - 包含前端 [fba_admin](https://github.com/fastapi-practices/fba_admin) 代码插件 <Badge type="warning" text="暂无此计划" />
1717
- <Badge text="app" color="#ff9900"/> - 应用级插件
1818
- <Badge text="extra" color="#11aa00"/> - 扩展级插件
1919

@@ -55,21 +55,22 @@ title: 插件市场
5555
这些插件由社区中的开发者提供和维护
5656

5757
<CardGrid>
58-
<Card title="空空如也">
58+
<Card title="">
5959
</Card>
6060
</CardGrid>
6161

6262
## 安装
6363

64-
插件安装方式可分为两种
64+
插件安装方式包含两种
6565

66-
### 手动
66+
::: tabs
67+
@tab 1. 手动
6768

6869
1. 获取插件仓库源码并下载,将源码中的插件目录直接拷贝到 fba 项目对应的目录下
6970
2. 如果插件包含依赖,执行 `backend/scripts/init_plugin.py` 文件安装依赖
7071
3. 根据插件使用说明完成安装
7172

72-
### 自动
73+
@tab 2. 自动
7374

7475
1. 获取打包好的插件 zip 压缩包
7576

@@ -83,3 +84,5 @@ title: 插件市场
8384

8485
2. 将压缩包通过插件安装接口进行安装
8586
3. 根据插件使用说明完成安装
87+
88+
:::

‎docs/sponsors.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fba 是一款基于 FastAPI 框架的后端架构解决方案,遵循伪三层
2424
您可以加入我们创建的 [知识星球](https://t.zsxq.com/PDk8b),获取星球内提供的独家内容,另外,我们会为您添加 Discord
2525
身份标签,以便将您加入专属频道,针对标签用户,我们还可以提供一对一线上指导,远程支持等...
2626

27-
请注意,我们不保证星球内容的更新频率,==您可以依据星球规则进行全额退款==,我们鼓励大家[参与贡献](https://github.com/fastapi-practices/fastapi_best_architecture/tree/master/backend#readme)
27+
请注意,我们不保证星球内容的更新频率,==您可以依据星球规则进行全额退款=={.warning},我们鼓励大家 [参与贡献](https://github.com/fastapi-practices/fastapi_best_architecture/tree/master/backend#readme)
2828
,如果您能为 Issues 提供 PR,并且被审核通过,我们将向您发送大额优惠券或免费邀请(基于 PR 质量)
2929

3030
## 展位赞助商
@@ -43,7 +43,7 @@ fba 是一款基于 FastAPI 框架的后端架构解决方案,遵循伪三层
4343
:::
4444

4545
::: warning 展位赞助说明
46-
选择==特别展位==赞助,可帮助您的产品在 Discord 交流群以公告的形式进行推广一次
46+
选择特别展位赞助,可帮助您的产品在 Discord 交流群以公告的形式进行推广一次
4747

4848
- 优先推广和程序员相关的互联网产品,比如:低代码开发平台、网课、开发软件、云服务器、个人博客等等,实体产品如键盘、显示器、耳机等等,如果是和程序员无关的产品,可酌情考虑是否推广
4949
- 拒绝接受违反法律法规、以及灰色相关的产品推广(GPT相关不包含在内)

0 commit comments

Comments
 (0)
Please sign in to comment.