@@ -13,30 +13,31 @@ title: 快速开始
13
13
14
14
1 . 准备本地环境
15
15
16
- * Python 3.10+
17
- * Mysql 8.0+
18
- * Redis 推荐最新稳定版
16
+ * Python 3.10+
17
+ * Mysql 8.0+
18
+ * Redis 推荐最新稳定版
19
19
20
20
2 . 准备 Git 仓库
21
21
22
22
::: info
23
23
提供两种方案,选择其中一种即可
24
24
:::
25
25
26
- 1 . 拉取源代码仓库
26
+ 1 . 拉取源代码仓库
27
27
28
- 此方式需要你删除拉取项目后根目录下的 ` .git ` 文件夹,之后上传到你指定的仓库即可,具体请自行查阅你要上传平台的行为准则
28
+ 此方式需要你删除拉取项目后根目录下的 ` .git ` 文件夹,之后上传到你指定的仓库即可,具体请自行查阅你要上传平台的行为准则
29
29
30
- ``` shell
31
- git clone https://github.com/fastapi-practices/fastapi_best_architecture.git
32
- ```
30
+ ``` shell
31
+ git clone https://github.com/fastapi-practices/fastapi_best_architecture.git
32
+ ```
33
33
34
- 2. 拉取模板仓库
34
+ 2. 拉取模板仓库
35
35
36
- 此项目支持创建模板仓库,意味着,你可以直接创建一个非 fork(独立无绑定的关系)的个人账户仓库,如果所示,进入此项目 GitHub 首页,
37
- 使用 ` use this template` 按钮创建即可,创建完成之后,使用 ` git clone` 命令拉取你自己的仓库即可
38
-
39
- ! [use_this_template](/images/use_this_template.png)
36
+ 此项目支持创建模板仓库,意味着,你可以直接创建一个非 fork(独立无绑定的关系)的个人账户仓库,如果所示,进入此项目
37
+ GitHub 首页,
38
+ 使用 ` use this template` 按钮创建即可,创建完成之后,使用 ` git clone` 命令拉取你自己的仓库即可
39
+
40
+ ! [use_this_template](/images/use_this_template.png)
40
41
41
42
3. 安装依赖包
42
43
@@ -75,7 +76,7 @@ title: 快速开始
75
76
` ` ` shell
76
77
alembic revision --autogenerate
77
78
` ` `
78
-
79
+
79
80
执行迁移
80
81
81
82
` ` ` shell
@@ -129,21 +130,37 @@ title: 快速开始
129
130
# ## 前端
130
131
131
132
:::: steps
133
+
132
134
1. 准备本地环境
133
135
134
- * Nodejs 14.0+
136
+ * Nodejs 18.0+
137
+ * yarn 1.x
135
138
136
139
2. 安装和启动
137
140
138
141
::: caution
139
142
目前它仅作为效果演示,而不是用于生产!
140
-
143
+
141
144
如果你不想前端依赖安装问题带来困扰,请务必使用 ` yarn` v1.x 版本
142
145
:::
143
-
144
- 你可以跳转 [fastapi_best_architecture_ui](https://github.com/fastapi-practices/fastapi_best_architecture_ui) 查看详情
145
- ::::
146
146
147
+ 安装依赖
148
+
149
+ ` ` ` shell
150
+ yarn install
151
+ ` ` `
152
+
153
+ 启动
154
+
155
+ ` ` ` shell
156
+ yarn dev
157
+ ` ` `
158
+
159
+ ::: warning
160
+ 第一次启动可能会很慢,你可以查看此 [Issue](https://github.com/fastapi-practices/fastapi_best_architecture_ui/issues/72)
161
+ 查看详情
162
+ :::
163
+ ::::
147
164
148
165
# # 开发流程
149
166
@@ -152,6 +169,7 @@ title: 快速开始
152
169
:::
153
170
154
171
::: steps
172
+
155
173
1. 定义数据库模型(model)
156
174
157
175
2. 定义数据验证模型(schema)
@@ -161,7 +179,7 @@ title: 快速开始
161
179
4. 编写业务(service)
162
180
163
181
5. 编写数据库操作(crud)
164
- :::
182
+ :::
165
183
166
184
# # 单元测试
167
185
@@ -170,6 +188,7 @@ title: 快速开始
170
188
:::
171
189
172
190
::: steps
191
+
173
192
1. 创建测试数据库 ` fba_test` ,选择 utf8mb4 编码
174
193
2. 使用 ` backend/sql/create_tables.sql` 文件创建数据库表
175
194
3. 使用 ` backend/sql/init_pytest_data.sql` 文件初始化用于单元测试的测试数据
@@ -178,4 +197,5 @@ title: 快速开始
178
197
` ` ` shell
179
198
pytest -vs --disable-warnings
180
199
` ` `
200
+
181
201
:::
0 commit comments