Skip to content

Commit ce9c939

Browse files
committed
update docs
1 parent 47ba418 commit ce9c939

File tree

11 files changed

+77
-62
lines changed

11 files changed

+77
-62
lines changed

docs/.vuepress/navbar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const myNavbar = defineNavbarConfig([
55
text: 'UI 效果',
66
items: [
77
{
8-
text: 'Git 仓库',
8+
text: 'GitHub',
99
icon: 'mdi:git',
1010
items: [
1111
{
@@ -14,7 +14,7 @@ export const myNavbar = defineNavbarConfig([
1414
},
1515
{
1616
text: 'Vben Admin Antd 下一代实施',
17-
link: 'https://github.com/fastapi-practices/fba_ui'
17+
link: 'https://github.com/fastapi-practices/fba_admin'
1818
}
1919
]
2020
},

docs/guide/deploy/Docker.md

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,40 @@ title: Docker 部署
2020

2121
::: steps
2222

23-
1. 确保你位于项目根目录
24-
2. 运行以下命令构建容器
23+
1. env
24+
25+
`backend` 目录中,创建环境变量文件
26+
27+
```shell
28+
touch .env
29+
```
30+
31+
将初始化环境变量配置拷贝到环境变量文件中
32+
33+
```shell
34+
cp .env.example .env
35+
```
36+
37+
2. 按需修改配置文件 `backend/core/conf.py``.env`
38+
3. 确保你位于项目根目录
39+
4. 运行以下命令构建容器
40+
41+
如果容器要在本地启动,需要将 `.env` 中的 `127.0.0.1` 更改为 `host.docker.internal`
2542

2643
```shell
2744
docker build -f backend/Dockerfile -t fba_backend_independent .
2845
```
2946

30-
3. 启动容器
47+
5. 启动容器
3148

32-
本机启动需要将 `.env` 中的 `127.0.0.1` 更改为 `host.docker.internal`
49+
由于构建不包含数据库,请确保本地已安装并启动相关数据库(mysql / postgresql、redis)
3350

3451
```shell
3552
docker run -d -p 8000:8000 --name fba_server fba_backend_independent
3653
```
3754

3855
:::
3956

40-
### 前端
41-
42-
无前端本地部署方案,请转至文档 [本地开发](../summary/quick-start.md#本地开发)
43-
4457
## 服务器部署
4558

4659
> [!TIP]
@@ -67,7 +80,7 @@ title: Docker 部署
6780

6881
::: note
6982
我们在 docker-compose 脚本内通过挂载的方式直接使用此文件作为 fba 环境变量文件,因此,本地修改此文件,将同步更新至 docker
70-
容器,这意味着,修改环境变量将无需重新 build
83+
容器,这意味着,修改环境变量将无需重新 build
7184
:::
7285

7386
::: warning
@@ -85,7 +98,7 @@ title: Docker 部署
8598

8699
4. 更新脚本文件
87100

88-
```yaml :collapsed-lines
101+
```yaml :collapsed-lines=6
89102
services:
90103
fba_server:
91104
build:
@@ -187,7 +200,7 @@ title: Docker 部署
187200
# 如果你选择单独构建,务必注释或删除此容器脚本
188201
fba_ui: # [!code warning:30]
189202
build:
190-
context: /root/fastapi_best_architecture_ui # 根据 fba_ui 项目存放目录修改此路径
203+
context: /root/fastapi_best_architecture_ui # 根据 Arco Desgin Vue 项目存放目录修改此路径
191204
dockerfile: Dockerfile
192205
image: fba_ui:latest
193206
ports:
@@ -300,23 +313,18 @@ title: Docker 部署
300313
2. env
301314

302315
:::: details Arco Desgin Vue
303-
304-
::: caution
305-
这是一个实验性实施,它仅用作效果演示,而不是用于生产!
306-
:::
307-
308316
修改 `.env.production` 中的 `VITE_API_BASE_URL` 为域名地址
309317
::::
310318

311319
:::: details Vben Admin Antd
312-
我知道你很急,但你先别急...
320+
即将到来...
313321
::::
314322

315323
3. 更新 nginx 配置
316324

317325
进入 deploy 目录,修改 `nginx.conf` 文件
318326

319-
```nginx :collapsed-lines
327+
```nginx :collapsed-lines=6
320328
# For more information on configuration, see:
321329
# * Official English Documentation: http://nginx.org/en/docs/
322330
# * Official Russian Documentation: http://nginx.org/ru/docs/
@@ -409,7 +417,7 @@ title: Docker 部署
409417
如果你已通过后端 docker-compose 构建前端项目,此步骤和后面的剩余步骤直接跳过即可
410418
:::
411419

412-
```yaml :collapsed-lines
420+
```yaml :collapsed-lines=6
413421
networks:
414422
fba_network:
415423
external: true
@@ -442,7 +450,7 @@ title: Docker 部署
442450
# local_ssl_key_path: 你在服务器存放 ssl key 证书文件的路径,自行修改
443451
# /etc/ssl/xxx.pem:挂载到容器内 ssl pem 证书文件的路径,自行修改
444452
# /etc/ssl/xxx.key:挂载到容器内 ssl key 证书文件的路径,自行修改
445-
- local_ssl_pem_path:/etc/ssl/xxx.pem # [!code warning:3]
453+
- local_ssl_pem_path:/etc/ssl/xxx.pem # [!code warning:2]
446454
- local_ssl_key_path:/etc/ssl/xxx.key
447455
- fba_static:/www/fba_server/backend/static
448456
networks:
@@ -477,6 +485,10 @@ title: Docker 部署
477485
不建议频繁使用 `docker-compose up -d --build` 命令,此命令每次执行都会重新构建容器,并将原容器自动本地备份保留,这会导致硬盘空间迅速锐减
478486
:::
479487

488+
::: info
489+
[15 个 Docker 容器自动化管理的脚本](https://www.yuque.com/fcant/devops/itkfyytisf9z84y6)
490+
:::
491+
480492
清理未使用的镜像
481493

482494
```shell

docs/guide/reference/db.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ title: 切换数据库
33
---
44

55
::: tip
6-
此教程仅适用于 pg 用户
6+
此教程仅适用于 PostgreSQL 用户
77
:::
88

99
fba 支持 MySQL、PostgreSQL 两种数据库,默认配置使用 MySQL
1010

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

1313
```shell
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

1717
## 默认配置
1818

19-
pg 与 MySQL 在用户名、端口号等方面有所不同,如果你使用上面的命令创建了 Docker 镜像,需修改 `.env` 部分配置如下,否则,请根据
20-
pg 配置进行修改
19+
PostgreSQL 与 MySQL 在用户名、端口号等方面有所不同,如果你使用上面的命令创建了 Docker 镜像,需修改 `.env` 部分配置如下,否则,请根据
20+
PostgreSQL 配置进行修改
2121

2222
```env
2323
# Database

docs/guide/reference/router.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fba 中的路由遵循 Restful API 规范
1414

1515
- backend 后端
1616
- app 应用
17-
- xxx 自定义应用包含子包
17+
- xxx 自定义应用 <Badge type="warning" text="包含子包" />
1818
- api 接口
1919
- v1
2020
- xxx 子包
@@ -23,7 +23,7 @@ fba 中的路由遵循 Restful API 规范
2323
- ...
2424
- __init\_\_.py
2525
- router.py 在此文件内注册所有子包 __init\_\_.py 文件中的路由
26-
- xxx 自定义应用不包含子包
26+
- xxx 自定义应用 <Badge type="warning" text="不包含子包" />
2727
- api 接口
2828
- v1
2929
- _\_init\_\_.py 不做任何操作

docs/guide/summary/intro.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
title: 简介
33
---
44

5-
> [!TIP]
6-
> 此仓库作为模板库公开,任何个人或企业均可免费使用!
7-
85
## 伪三层架构
96

107
mvc 架构作为常规设计模式,在 python web 中很常见,但是三层架构更令人着迷

docs/guide/summary/quick-start.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ title: 快速开始
6868

6969
执行 `backend/scripts/init_plugin.py` 文件安装插件依赖
7070

71-
4. 创建数据库:`fba`,选择 utf8mb4 编码,postgres 用户可忽略编码
71+
4. 创建数据库:`fba`,选择 utf8mb4 编码,PostgreSQL 用户可忽略编码
7272
5. 启动 Redis
7373
6. env
7474

@@ -84,7 +84,7 @@ title: 快速开始
8484
cp .env.example .env
8585
```
8686

87-
7. 按需修改配置文件 `core/conf.py``.env`
87+
7. 按需修改配置文件 `backend/core/conf.py``.env`
8888
8. 创建数据库表(三选一)
8989

9090
- 直接启动后端项目(自动创建)
@@ -159,15 +159,15 @@ title: 快速开始
159159

160160
### 前端
161161

162-
::: tip
162+
::: warning
163163
前端项目并不是我们发展的重心,我们创建的所有前端实施,均用于 UI
164164
效果演示,它们不一定适用于生产环境,您可以点击查看我们的 [目标](./why.md#目标)
165165
:::
166166

167167
::::: details Arco Desgin Vue
168168

169169
::: caution
170-
这是一个实验性实施,它仅用作效果演示,而不是用于生产
170+
这是一个实验性实施,仅用于效果演示,此版本即将存档,请勿将其用于生产
171171
:::
172172

173173
:::: steps
@@ -207,8 +207,8 @@ title: 快速开始
207207

208208
::::: details Vben Admin Antd
209209

210-
::: warning
211-
这是下一代实施,目前正处于积极开发阶段
210+
::: tip
211+
这是下一代实施,目前正处于积极开发阶段,未来将完全适配 fba
212212
:::
213213

214214
1. 准备本地环境
@@ -219,7 +219,7 @@ title: 快速开始
219219
2. 拉取 Git 项目
220220

221221
```shell
222-
git clone https://github.com/fastapi-practices/fba_ui.git
222+
git clone https://github.com/fastapi-practices/fba_admin.git
223223
```
224224

225225
3. 安装和启动

docs/guide/summary/why.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ title: 为什么选择我们?
66
import NpmBadge from 'vuepress-theme-plume/features/NpmBadge.vue'
77
</script>
88

9+
> [!TIP]
10+
> 此仓库作为模板库公开,任何个人或企业均可免费使用!
11+
912
::: note
10-
我们不会去对比其他架构,我们认为每个架构都有自己的特点,适合不同的场景
13+
我们不会去对比任何其他架构,我们认为每个架构都有自己的特点,适用于不同的场景
1114

1215
但 fba 绝对是开源架构中代码最干净,最规范且最令人赏心悦目的项目之一
1316
:::
@@ -168,8 +171,8 @@ fba
168171
169172
我们有十分严格的 CI
170173
代码质量检测和[规则](https://github.com/fastapi-practices/fastapi_best_architecture/blob/master/backend/.ruff.toml)
171-
,使用非常流行且强大的 ruff 作为支撑,为每次 PR 的代码质量做到严格把控
174+
,使用非常流行且强大的 Ruff 作为支撑,为每次 PR 的代码质量做到严格把控
172175
173176
- 持续的认可
174177
175-
在此我们不做任何宣传引导,您可以在交流群发出疑问,我们静待用户真实反馈
178+
在此我们不做任何宣传引导,您可以在任意社区/交流群发出疑问,我们静待用户真实反馈

docs/plugin/dev.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,19 @@ title: 插件开发
4848
- plugin 固定目录
4949
- xxx 插件名
5050
- api/ 接口,务必查看下方 [接口路由](#插件路由)
51-
- crud/ CRUD(非必须项)
52-
- model 模型(非必须项)
51+
- crud/ CRUD <Badge type="warning" text="非必须" />
52+
- model 模型 <Badge type="warning" text="非必须" />
5353
- \_\_init__.py 必须在此文件内导入所有模型类
5454
- …
55-
- schema/ 数据传输(非必须项)
56-
- service/ 服务(非必须项)
57-
- utils/ 工具包(非必须项)
58-
- \_\_init__.py 作为 python 包保留(必须项)
59-
- conf.py 常量配置(非必须项)
60-
- plugin.toml 插件配置文件(必须项)
61-
- README.md 插件使用说明(必须项)
62-
- requirements.txt 依赖包文件(非必须项)如果插件需要安装依赖,则必须
55+
- schema/ 数据传输 <Badge type="warning" text="非必须" />
56+
- service/ 服务 <Badge type="warning" text="非必须" />
57+
- utils/ 工具包 <Badge type="warning" text="非必须" />
58+
- \_\_init__.py 作为 python 包保留 <Badge type="danger" text="必须" />
59+
- conf.py 常量配置 <Badge type="warning" text="非必须" />
60+
- plugin.toml 插件配置文件 <Badge type="danger" text="必须" />
61+
- README.md 插件使用说明 <Badge type="danger" text="必须" />
62+
- requirements.txt 依赖包文件 <Badge type="warning" text="非必须" />
63+
如果插件需要安装依赖,则为 <Badge type="danger" text="必须" />
6364

6465
:::
6566

docs/plugin/market.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ title: 插件市场
1313
- <Badge type="info" text="free" /> - 免费插件
1414
- <Badge type="danger" text="pay" /> - 付费插件
1515
- <Badge type="tip" text="fba" /> - 仅后端代码插件
16-
- <Badge text="fba-arco" color="#4582ff"/> - 包含前端 [fastapi_best_architecture_ui](https://github.com/fastapi-practices/fastapi_best_architecture_ui) 代码插件
17-
- <Badge text="fba-vben" color="#c178ec"/> - 包含前端 [fba_ui](https://github.com/fastapi-practices/fba_ui) 代码插件
16+
- <Badge text="fba + vben" color="#c178ec"/> - 包含前端 [fba_admin](https://github.com/fastapi-practices/fba_admin) 代码插件
1817
- <Badge text="app" color="#ff9900"/> - 应用级插件
19-
- <Badge text="app-extra" color="#11aa00"/> - 扩展级插件
18+
- <Badge text="extra" color="#11aa00"/> - 扩展级插件
2019

2120
:::
2221

@@ -30,23 +29,23 @@ title: 插件市场
3029
<span>
3130
<Badge type="info" text="free" />
3231
<Badge type="tip" text="fba" />
33-
<Badge text="app-extra" color="#11aa00"/>
32+
<Badge text="extra" color="#11aa00"/>
3433
</span>
3534
</LinkCard>
3635
<LinkCard icon="solar:user-check-bold" title="Casbin-RBAC" href="https://discord.com/channels/1185035164577972344/1340300371251302451">
3736
<p style="color: #898989;">添加基于 Casbin 实现的 RBAC 权限</p>
3837
<span>
3938
<Badge type="info" text="free" />
4039
<Badge type="tip" text="fba" />
41-
<Badge text="app-extra" color="#11aa00"/>
40+
<Badge text="extra" color="#11aa00"/>
4241
</span>
4342
</LinkCard>
4443
<LinkCard icon="ant-design:aliyun-outlined" title="阿里云 oss" href="https://discord.com/channels/1185035164577972344/1342478204400832593">
4544
<p style="color: #898989;">添加阿里云 oss 上传文件功能</p>
4645
<span>
4746
<Badge type="info" text="free" />
4847
<Badge type="tip" text="fba" />
49-
<Badge text="app-extra" color="#11aa00"/>
48+
<Badge text="extra" color="#11aa00"/>
5049
</span>
5150
</LinkCard>
5251
</CardGrid>

docs/plugin/publish.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: 发布
66
> 插件作者需符合以下几点要求
77
>
88
> - 必须加入 Discord 社区
9-
> - 必须提供插件仓库 github 地址
9+
> - 必须提供插件仓库 GitHub 地址
1010
> - 必须在插件仓库 README 文件内提供至少一种(任意)联系方式
1111
1212
::: warning

0 commit comments

Comments
 (0)