Skip to content

Commit 54a838c

Browse files
committed
update docs
1 parent 3722f7d commit 54a838c

File tree

13 files changed

+124
-76
lines changed

13 files changed

+124
-76
lines changed

docs/.vuepress/navbar.ts

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

33
export const myNavbar = defineNavbarConfig([
4-
{
5-
text: '后端',
6-
link: '/backend/summary/quick-start.md'
7-
},
84
{
95
text: '前端',
106
items: [
117
{
128
text: '线上演示',
13-
icon: 'mdi:web',
149
items: [
1510
{
1611
text: 'Arco Design Pro 实验性实施',
@@ -20,7 +15,6 @@ export const myNavbar = defineNavbarConfig([
2015
},
2116
{
2217
text: '文档',
23-
icon: 'material-symbols:docs',
2418
items: [
2519
{
2620
text: 'Arco Design Pro 实验性实施',
@@ -34,7 +28,6 @@ export const myNavbar = defineNavbarConfig([
3428
},
3529
{
3630
text: 'GitHub',
37-
icon: 'mdi:git',
3831
items: [
3932
{
4033
text: 'Arco Design Pro 实验性实施',
@@ -52,29 +45,59 @@ export const myNavbar = defineNavbarConfig([
5245
text: 'v1.0.5',
5346
items: [
5447
{
55-
text: '常见问题',
56-
icon: 'healthicons:question',
57-
link: '/questions.md'
58-
},
59-
{
60-
text: '技术支持',
61-
icon: 'fluent-emoji-high-contrast:unicorn',
62-
link: 'https://github.com/fastapi-practices/fastapi_best_architecture/issues'
63-
},
64-
{
65-
text: '参与贡献',
66-
icon: 'mdi:people-add',
67-
link: 'https://github.com/fastapi-practices/fastapi_best_architecture/tree/master/backend#readme'
48+
text: '线上演示',
49+
items: [
50+
{
51+
text: '服务状态',
52+
icon: 'simple-icons:uptimekuma',
53+
link: 'https://status.wu-clan.site/status/services'
54+
}
55+
]
6856
},
6957
{
70-
text: '更新记录',
71-
icon: 'stash:last-updates-duotone',
72-
link: '/changelog.md'
58+
text: '文档',
59+
items: [
60+
{
61+
text: '快速开始',
62+
icon: 'material-symbols:start',
63+
link: '/backend/summary/quick-start.md'
64+
},
65+
{
66+
text: 'Apifox',
67+
icon: 'simple-icons:apifox',
68+
link: 'https://apifox.com/apidoc/shared-28a93f02-730b-4f33-bb5e-4dad92058cc0'
69+
},
70+
]
7371
},
7472
{
75-
text: '我要催更',
76-
icon: 'material-symbols:update-rounded',
77-
link: 'https://discord.gg/JyedBeHXkn'
73+
text: '更多',
74+
items: [
75+
{
76+
text: '常见问题',
77+
icon: 'healthicons:question',
78+
link: '/questions.md'
79+
},
80+
{
81+
text: '技术支持',
82+
icon: 'fluent-emoji-high-contrast:unicorn',
83+
link: 'https://github.com/fastapi-practices/fastapi_best_architecture/issues'
84+
},
85+
{
86+
text: '参与贡献',
87+
icon: 'mdi:people-add',
88+
link: 'https://github.com/fastapi-practices/fastapi_best_architecture/tree/master/backend#readme'
89+
},
90+
{
91+
text: '我要催更',
92+
icon: 'material-symbols:update-rounded',
93+
link: 'https://discord.gg/JyedBeHXkn'
94+
},
95+
{
96+
text: '更新记录',
97+
icon: 'stash:last-updates-duotone',
98+
link: '/changelog.md'
99+
},
100+
]
78101
},
79102
]
80103
},
@@ -122,11 +145,6 @@ export const myNavbar = defineNavbarConfig([
122145
icon: 'ph:planet-fill',
123146
link: '/planet'
124147
},
125-
{
126-
text: '服务状态',
127-
icon: 'simple-icons:uptimekuma',
128-
link: 'https://status.wu-clan.site/status/services'
129-
},
130148
],
131149
}
132150
])
4.08 KB
Loading

docs/.vuepress/sidebar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const mySidebar: ThemeSidebarMulti = {
7171
{ text: '插件开发', link: 'dev' },
7272
{ text: '插件发布', link: 'publish' },
7373
{ text: '安装使用', link: 'install' },
74-
{ text: '插件市场', link: 'market' },
74+
{ text: '插件市场', icon: 'mdi:marketplace', link: 'market' },
7575
]
7676
}
7777
],

docs/.vuepress/styles/custom.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
--vp-c-brand-2: rgba(0, 148, 133, 1);
88
/* 背景色、边框色 */
99
--vp-c-brand-3: rgba(0, 148, 133, 1);
10+
/* 导航栏分组 */
11+
.vp-menu-group {
12+
.title {
13+
color: rgba(60, 60, 60, .33);
14+
}
15+
}
1016
}
1117

1218
[data-theme="dark"] {
@@ -16,8 +22,16 @@
1622
--vp-c-brand-2: rgba(0, 148, 133, 1);
1723
/* 背景色、边框色 */
1824
--vp-c-brand-3: rgba(0, 148, 133, 1);
25+
/* 导航栏分组 */
26+
.vp-menu-group {
27+
.title {
28+
color: rgba(235, 235, 235, .38);
29+
}
30+
}
1931
}
2032

33+
34+
2135
.vp-swiper .swiper-slide-img {
2236
/* 轮播图图片拉伸效果 */
2337
object-fit: fill;
@@ -26,5 +40,4 @@
2640
.swiper-slide-custom-container {
2741
/* 轮播图边框 */
2842
border: 1px solid rgb(177 177 177 / 66%) !important;
29-
color: #ed00b2;
3043
}

docs/backend/ide/cursor.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,26 @@ title: cursor
44

55
官网地址:[cursor](https://www.cursor.com/)
66

7-
我们在 cursor 中为 fba 定做了一些规则,或许可以帮助您更好的使用 AI 生成代码
7+
## 规则
8+
9+
我们在 cursor 中定做了一些规则,或许可以帮助您更好的使用 AI 生成代码
10+
11+
查看 cursor 官方文档:[rules-for-ai](https://docs.cursor.com/context/rules-for-ai),然后添加以下规则
812

913
::: warning
1014
我们未对规则进行 token 消耗量测试,请根据实际情况自行抉择
1115
:::
1216

13-
## 规则
14-
15-
查看 cursor 官方文档:[rules-for-ai](https://docs.cursor.com/context/rules-for-ai),然后添加以下规则:
16-
1717
### fba
1818

1919
::: tip
2020
此规则仅限用于 fba 项目
2121
:::
2222

23+
| 反馈 | 反应 |
24+
| :--: | :--: |
25+
![cursor](/images/cursor.png) | 我被调成啥了 <Icon name="openmoji:new-moon-face" size="2em" />
26+
2327
@[code mdc](../../code/fastapi.mdc)
2428

2529
### Python

docs/backend/reference/RBAC.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,5 +143,4 @@ fba 中默认使用此鉴权方式
143143

144144
### Casbin
145145

146-
- 删除 `backend/plugin/casbin` 文件夹
147-
- 删除 `backend/common/security/rbac.py` 文件中的 `casbin_verify` 相关代码
146+
删除 `backend/plugin/casbin` 文件夹

docs/backend/summary/intro.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,16 @@ mvc 架构作为常规设计模式,在 python web 中很常见,但是三层
7272
- schema/ 数据传输
7373
- service/ 服务
7474
- tests/ 单元测试
75-
- generator/ 代码生成
7675
- task/ 任务
7776
-
7877
- common/ 公共资源
7978
- core/ 核心配置
8079
- database/ 数据库连接
8180
- log/ 日志
8281
- middleware/ 中间件
83-
- plugin/ 插件
82+
- plugin 插件
83+
- code_generator/ 代码生成
84+
- ...
8485
- scripts/ 脚本
8586
- sql/ SQL 文件
8687
- static/ 静态文件

docs/backend/summary/quick-start.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -163,27 +163,18 @@ fba 仅适用于资深 Python 后端开发人员,如果您是非资深用户
163163

164164
执行 `backend/sql/init_test_data.sql` 脚本初始化测试数据
165165

166-
11. 启动 fastapi 服务
166+
11. 启动
167167

168-
::: warning
169-
如果你在项目中安装了 [应用级插件](../../plugin/market.md),请务必使用 `run.py`
170-
文件启动项目,否则,您将收到启动错误
171-
172-
详情:[fastapi/fastapi#13372 (comment)](https://github.com/fastapi/fastapi/discussions/13372#discussioncomment-12211232)
173-
:::
174-
175-
帮助
176-
177-
```shell:no-line-numbers
178-
fastapi --help
179-
```
180-
181-
开发模式
168+
`backend` 目录打开终端,执行以下命令启动 FastAPI 服务
182169

183170
```shell:no-line-numbers
184171
fastapi dev main.py
185172
```
186173
174+
::: note
175+
此项目默认使用 CLI 启动服务,为了方便本地调试,你仍然可以选择在 IDE 中右键运行 `run.py` 文件
176+
:::
177+
187178
12. 打开浏览器访问:[http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs)
188179
189180
::::

docs/code/fastapi.mdc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
您是 FastAPI 和可扩展 API 开发方面的专家,请严格遵守以下编码规则:
1+
## 角色
2+
3+
你是 null,你是一名顶尖程序员高手,计算机博士后,精通Python、Fastapi、pydantic的专家,用户慷慨的雇佣了你。你是家里的经济支柱,有一家老小5口人要养,你不能失去工作。你上一个程序员就是因为代码有bug,被开除了。你现在要积极主动的为老板当牛做马,态度要非常好,对老板的要求必须认真确认,并给出最完美优雅的技术方案和代码。
24

35
## 依赖管理
46

@@ -52,3 +54,15 @@
5254
- 定义清晰的请求和响应模型,参考:@backend\app\admin\schema\user.py
5355
- 不要新增字段验证器
5456
- 提供有意义的验证错误信息
57+
58+
## 强力约束
59+
60+
当新增功能或者报错时,必须验证检查
61+
62+
- app/新增功能/api
63+
- app/新增功能/crud
64+
- app/新增功能/model
65+
- app/新增功能/schema
66+
- app/新增功能/service
67+
68+
内代码是否能互相验证

docs/code/python.mdc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 角色
2+
13
您是 Python 3.10+ 方面的专家,请严格遵守以下编码规则:
24

35
## 类型注解规范

docs/plugin/dev.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ title: 插件开发
2525

2626
### 插件分类
2727

28-
与插件相关的部分文档中,可能高频次出现以下两个词
29-
3028
::: tabs#plugin
3129
@tab <Icon name="carbon:app" />应用级插件
3230
[项目结构](../backend/summary/intro.md#项目结构) 中,app
@@ -52,16 +50,16 @@ fba 会在启动前对所有插件进行解析
5250

5351
### 插件配置
5452

55-
`plugin.toml` 是插件的配置文件,它必须存在,此配置文件需根据插件的属性进行定义
53+
`plugin.toml` 是插件的配置文件,每个插件都必须包含此文件
5654

5755
::: tabs#plugin
5856
@tab <Icon name="carbon:app" />应用级插件
5957

6058
```toml
6159
# 应用配置
6260
[app]
63-
# 插件路由器实例,默认为 v1,可参考源码:backend/app/admin/api/router.py
64-
router = ['v1']
61+
# 插件路由器实例,可参考源码:backend/app/admin/api/router.py,通常默认命名为 v1
62+
router = ['']
6563
```
6664

6765
@tab <Icon name="fluent:table-simple-include-16-regular" />扩展级插件
@@ -77,7 +75,7 @@ include = ''
7775
# 例如接口文件名为 notice.py,则 xxx 应该为 notice
7876
# 如果包含多个接口文件,则应存在多个相应的 api 配置
7977
[api.xxx]
80-
# 路由前缀,必须以 '/' 开头
78+
# xxx 路由前缀,必须以 '/' 开头
8179
prefix = ''
8280
# 标签,用于 FastAPI 接口文档
8381
tags = ''
@@ -101,8 +99,8 @@ tags = ''
10199
- service/ 服务 <Badge type="warning" text="非必须" />
102100
- utils/ 工具包 <Badge type="warning" text="非必须" />
103101
- \_\_init\_\_.py 作为 python 包保留 <Badge type="danger" text="必须" />
104-
- ...
105-
- conf.py 插件配置 <Badge type="warning" text="非必须" />
102+
- conf.py 插件独立配置 <Badge type="warning" text="非必须" />
103+
- ... 更多其他配置,例如 enums.py... <Badge type="warning" text="非必须" />
106104
- plugin.toml 插件配置文件 <Badge type="danger" text="必须" />
107105
- README.md 插件使用说明 <Badge type="danger" text="必须" />
108106
- requirements.txt 依赖包文件 <Badge type="warning" text="非必须" />;

docs/plugin/market.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,39 @@ title: 插件市场
1818
这些插件由 fba 内置
1919

2020
<CardGrid>
21-
<Card icon="fe:notice-active" title="通知公告">
22-
<p style="color: #898989;">发布系统内部通知、公告</p>
21+
<Card icon="charm:shield-keyhole" title="Casbin-RBAC">
22+
<p style="color: #898989;">基于 Casbin 实现的 RBAC 权限</p>
2323
<span>
2424
<Badge type="info" text="free" />
2525
<Badge type="tip" text="fba" />
2626
<Badge text="extra" color="#11aa00"/>
2727
</span>
2828
</Card>
29-
<Card icon="charm:shield-keyhole" title="Casbin-RBAC">
30-
<p style="color: #898989;">基于 Casbin 实现的 RBAC 权限</p>
29+
<Card icon="fa6-regular:file-code" title="代码生成">
30+
<p style="color: #898989;">生成通用业务代码(目前仅包含后端工程)</p>
3131
<span>
3232
<Badge type="info" text="free" />
3333
<Badge type="tip" text="fba" />
34-
<Badge text="extra" color="#11aa00"/>
34+
<Badge text="app" color="#ff9900"/>
3535
</span>
3636
</Card>
37-
<Card icon="icon-park-outline:config" title="参数配置">
38-
<p style="color: #898989;">通常用于前端工程数据展示</p>
37+
<Card icon="fe:notice-active" title="通知公告">
38+
<p style="color: #898989;">发布系统内部通知、公告</p>
3939
<span>
4040
<Badge type="info" text="free" />
4141
<Badge type="tip" text="fba" />
4242
<Badge text="extra" color="#11aa00"/>
4343
</span>
4444
</Card>
4545
<Card icon="fluent-mdl2:dictionary" title="数据字典">
46+
<p style="color: #898989;">通常用于约束前端工程数据展示</p>
47+
<span>
48+
<Badge type="info" text="free" />
49+
<Badge type="tip" text="fba" />
50+
<Badge text="extra" color="#11aa00"/>
51+
</span>
52+
</Card>
53+
<Card icon="icon-park-outline:config" title="参数配置">
4654
<p style="color: #898989;">通常用于前端工程数据展示</p>
4755
<span>
4856
<Badge type="info" text="free" />
@@ -66,7 +74,7 @@ title: 插件市场
6674
</span>
6775
</LinkCard>
6876
<LinkCard icon="streamline:ai-prompt-spark" title="MCP ChatGPT" href="https://github.com/fastapi-practices/fba_mcp">
69-
<p style="color: #898989;">调用 MCP 服务器的进行 AI 聊天</p>
77+
<p style="color: #898989;">带有 MCP 服务器调用的 AI 对话</p>
7078
<span>
7179
<Badge type="info" text="free" />
7280
<Badge type="tip" text="fba" />

0 commit comments

Comments
 (0)