Skip to content

Commit 8e39042

Browse files
committed
update docs
1 parent 522d019 commit 8e39042

32 files changed

+172
-225
lines changed

docs/.vuepress/navbar.ts

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import {defineNavbarConfig} from "vuepress-theme-plume";
1+
import { defineNavbarConfig } from "vuepress-theme-plume";
22

33
export const myNavbar = defineNavbarConfig([
44
{
5-
text: 'UI 效果',
5+
text: '后端',
6+
link: '/backend/summary/quick-start.md'
7+
},
8+
{
9+
text: '前端',
610
items: [
711
{
8-
text: 'GitHub',
9-
icon: 'mdi:git',
12+
text: '文档',
13+
icon: 'material-symbols:docs',
1014
items: [
1115
{
12-
text: 'Arco Design Vue 实验性实施',
13-
link: 'https://github.com/fastapi-practices/fastapi_best_architecture_ui'
14-
},
15-
{
16-
text: 'Vben Admin Antd 下一代实施',
17-
link: 'https://github.com/fastapi-practices/fba_admin'
16+
text: 'Gi Admin Pro 官方适配实施',
17+
link: '/frontend/project'
1818
}
1919
]
2020
},
@@ -23,11 +23,29 @@ export const myNavbar = defineNavbarConfig([
2323
icon: 'mdi:web',
2424
items: [
2525
{
26-
text: 'Arco Design Vue 实验性实施',
26+
text: 'Arco Design Pro 实验性实施',
2727
link: 'https://fba.wu-clan.site/'
2828
}
2929
]
30-
}
30+
},
31+
{
32+
text: '文档',
33+
icon: 'mdi:git',
34+
items: [
35+
{
36+
text: 'Gi Admin Pro 官方适配实施',
37+
link: 'https://github.com/fastapi-practices/fastapi_best_architecture_ui'
38+
},
39+
{
40+
text: 'Vben Admin Antd 社区适配实施',
41+
link: 'https://github.com/fastapi-practices/fastapi_best_architecture_ui_vben'
42+
},
43+
{
44+
text: 'Arco Design Pro 实验性实施',
45+
link: 'https://github.com/fastapi-practices/fastapi_best_architecture_ui_arco'
46+
}
47+
]
48+
},
3149
]
3250
},
3351
{
@@ -68,7 +86,7 @@ export const myNavbar = defineNavbarConfig([
6886
{
6987
text: '授权',
7088
icon: 'fluent:person-key-20-filled',
71-
link: '/guide/summary/why.md#承诺'
89+
link: '/backend/summary/why.md#承诺'
7290
},
7391
{
7492
text: '赞助',

docs/.vuepress/sidebar.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { text } from "mermaid/dist/rendering-util/rendering-elements/shapes/text.js";
2-
import { SidebarMulti } from "vuepress-theme-plume/lib/shared";
2+
import { ThemeSidebarMulti } from "vuepress-theme-plume";
33

44

5-
export const mySidebar: SidebarMulti = {
6-
'/guide/': [
5+
export const mySidebar: ThemeSidebarMulti = {
6+
'/backend/': [
77
{
88
text: '介绍',
99
collapsed: false,
@@ -32,11 +32,11 @@ export const mySidebar: SidebarMulti = {
3232
{ text: '路由', link: 'router' },
3333
{ text: 'CRUD', link: 'CRUD' },
3434
{ text: 'Schema', link: 'schema' },
35-
{ text: '接口响应', link: 'response' },
35+
{ text: '操作人信息', link: '/planet', icon: 'fluent-color:receipt-16' },
3636
{ text: '分页', link: 'pagination' },
37+
{ text: '接口响应', link: 'response' },
3738
{ text: '自定义异常', link: '/planet', icon: 'fluent-color:receipt-16' },
3839
{ text: '切换数据库', link: 'db' },
39-
{ text: '鉴权', link: 'permission' },
4040
{ text: 'JWT', link: 'jwt' },
4141
{ text: 'RBAC', link: 'RBAC' },
4242
{ text: '数据规则', link: '/planet', icon: 'fluent-color:video-16' },
@@ -49,15 +49,6 @@ export const mySidebar: SidebarMulti = {
4949
{ text: 'SocketIo', link: '/planet', icon: 'fluent-color:receipt-16' },
5050
]
5151
},
52-
{
53-
text: 'Mixin',
54-
collapsed: false,
55-
prefix: 'mixin/',
56-
items: [
57-
{ text: 'CRUD', link: 'CRUD' },
58-
{ text: '操作人信息', link: '/planet', icon: 'fluent-color:receipt-16' },
59-
]
60-
},
6152
{
6253
text: '部署',
6354
collapsed: false,
@@ -79,5 +70,14 @@ export const mySidebar: SidebarMulti = {
7970
{ text: '插件市场', link: 'market' },
8071
]
8172
}
73+
],
74+
'/frontend/': [
75+
{
76+
text: '参考',
77+
collapsed: false,
78+
items: [
79+
{ text: '项目', link: 'project' },
80+
]
81+
}
8282
]
8383
}

docs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ config:
1212
actions:
1313
- theme: brand
1414
text: 快速开始 ->
15-
link: /guide/summary/quick-start
15+
link: /backend/summary/quick-start
1616
- theme: alt
1717
text: 伪三层架构?
18-
link: /guide/summary/intro#伪三层架构
18+
link: /backend/summary/intro#伪三层架构
1919
- theme: alt
2020
text: 为什么选择我们?
21-
link: /guide/summary/why
21+
link: /backend/summary/why
2222
- type: features
2323
features:
2424
- title: 最新技术栈

docs/guide/deploy/Docker.md renamed to docs/backend/deploy/Docker.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ title: Docker 部署
1010

1111
本地部署是为了能够快捷的提供本地 API 服务
1212

13-
### 后端
14-
1513
:::: steps
1614

1715
1. env
@@ -53,12 +51,14 @@ title: Docker 部署
5351

5452
## 服务器部署
5553

56-
> [!TIP]
57-
> 此教程以 https 为例,如果你没有相关经验,请自行 Google 进行了解
54+
::: tip
55+
此教程以 https 为例,如果你没有相关经验,请自行 Google 进行了解
56+
:::
5857

59-
> [!NOTE]
60-
> 免费 SSL 证书推荐使用 [httpsok-SSL 证书自动续期](https://httpsok.com/p/4Qjd),一行命令,轻松搞定 SSL
61-
> 证书自动续签,支持:nginx、通配符证书、七牛云、腾讯云、阿里云、CDN、OSS、LB(负载均衡)
58+
::: info
59+
免费 SSL 证书推荐使用 [httpsok-SSL 证书自动续期](https://httpsok.com/p/4Qjd),一行命令,轻松搞定 SSL
60+
证书自动续签,支持:nginx、通配符证书、七牛云、腾讯云、阿里云、CDN、OSS、LB(负载均衡)
61+
:::
6262

6363
### 后端
6464

@@ -126,14 +126,14 @@ title: Docker 部署
126126
::::: steps
127127

128128
1. 拉取代码到服务器
129+
130+
```shell:no-line-numbers
131+
git clone https://github.com/fastapi-practices/fastapi_best_architecture_ui_arco.git
132+
```
133+
129134
2. env
130-
::: tabs
131-
@tab <Icon name="icon-park-outline:new-lark" />Arco Desgin Vue
132-
修改 `.env.production` 中的 `VITE_API_BASE_URL` 为域名地址
133135

134-
@tab <Icon name="devicon:antdesign" />Vben Admin Antd
135-
生产中...
136-
:::
136+
修改 `.env.production` 中的 `VITE_API_BASE_URL` 为域名地址
137137

138138
3. 更新 nginx 配置
139139

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/guide/mixin/CRUD.md renamed to docs/backend/reference/CRUD.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,30 @@
22
title: CRUD
33
---
44

5-
CRUD Mixin 位于 `common/model.py` 文件中
5+
我们在 fba 中使用 sqlalchemy-crud-plus 作为数据库操作基类,
6+
它是一款由我们自主构建的基于 SQLAlchemy 2.0 的高级异步 CRUD SDK,它可适用于任何 FastAPI + SQLAlchemy 项目
67

7-
## 主键
8+
<RepoCard repo="fastapi-practices/sqlalchemy-crud-plus" />
9+
10+
## 函数命名
11+
12+
fba 遵循以下命名规范:
13+
14+
- 获取/查询详情: `get()`
15+
- 通过 xxx 获取/查询详情:`get_by_xxx()`
16+
- 获取/查询列表:`get_list()`
17+
- 获取/查询所有:`get_all()`
18+
- 字查询:`get_children()`
19+
- 关系查询:`get_with_relation()`
20+
- 创建:`create()`
21+
- 更新:`update()`
22+
- 删除:`delete()`
23+
24+
## Mixin
25+
26+
CRUD Mixin 位于 `backend/common/model.py` 文件中
27+
28+
### 主键
829

930
我们未提供自动主键模式,而是必须通过手动定义的方式进行主键声明
1031

@@ -17,7 +38,7 @@ id_key = Annotated[
1738
]
1839
```
1940

20-
## 日期时间
41+
### 日期时间
2142

2243
日期时间 Mixin 将自动集成到 Base 类中,如果模型父类为 Base,将自动应用
2344

@@ -33,18 +54,18 @@ class DateTimeMixin(MappedAsDataclass):
3354
)
3455
```
3556

36-
## 数据类基类
57+
### 数据类基类
3758

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

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

4263
```python
4364
class DataClassBase(MappedAsDataclass, MappedBase):
4465
__abstract__ = True
4566
```
4667

47-
## Base 基类
68+
### Base 基类
4869

4970
包含基础表结构的数据类基类;此基类适用于大多数模型
5071

File renamed without changes.

0 commit comments

Comments
 (0)