Skip to content

Commit aabb721

Browse files
authored
Update the usage documentation in README (#449)
1 parent 0a1f0a9 commit aabb721

File tree

2 files changed

+5
-126
lines changed

2 files changed

+5
-126
lines changed

README.md

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ pattern, use templates to transform it to your heart's content!
3939
You can view some of the preview screenshots
4040
in [fastapi_best_architecture_ui](https://github.com/fastapi-practices/fastapi_best_architecture_ui)
4141

42-
Luckily, we now have a demo site: [FBA UI](https://fba.xwboy.top/)
42+
For the demo entrance, please refer
43+
to [Official documentation](https://fastapi-practices.github.io/fastapi_best_architecture_docs/)
4344

4445
> tester: test / 123456
4546
>
@@ -75,72 +76,11 @@ Luckily, we now have a demo site: [FBA UI](https://fba.xwboy.top/)
7576
- [x] Timed tasks: automated tasks, asynchronous tasks, support for function calls
7677
- [x] Interface Documentation: Automatically generate online interactive API interface documentation.
7778

78-
## Project structure
79-
80-
```
81-
├─📁 backend--------------- # Backend
82-
│ ├─📁 alembic------------- # DB migration
83-
│ ├─📁 app----------------- # Application
84-
│ │ ├─📁 admin------------- # System admin
85-
│ │ │ ├─📁 api------------- # Interface
86-
│ │ │ ├─📁 crud------------ # CRUD
87-
│ │ │ ├─📁 model----------- # SQLA model
88-
│ │ │ ├─📁 schema---------- # Data transmit
89-
│ │ │ ├─📁 service--------- # Service
90-
│ │ │ └─📁 tests----------- # Pytest
91-
│ │ ├─📁 generator--------- # Code generate
92-
│ │ └─📁 task-------------- # Celery task
93-
│ ├─📁 common-------------- # public resources
94-
│ ├─📁 core---------------- # Core configuration
95-
│ ├─📁 database------------ # Database connection
96-
│ ├─📁 log----------------- # Log
97-
│ ├─📁 middleware---------- # Middlewares
98-
│ ├─📁 scripts------------- # Scripts
99-
│ ├─📁 sql----------------- # SQL files
100-
│ ├─📁 static-------------- # Static files
101-
│ ├─📁 templates----------- # Template files
102-
│ └─📁 utils--------------- # Toolkit
103-
└─📁 deploy---------------- # Server deployment
104-
```
105-
106-
## Local development / Docker deployment
79+
## Development and deployment
10780

10881
For more details, please check
10982
the [official documentation](https://fastapi-practices.github.io/fastapi_best_architecture_docs/)
11083

111-
## Test data
112-
113-
Initialize the test data using the `backend/sql/init_test_data.sql` file.
114-
115-
## Development Process
116-
117-
(For reference only)
118-
119-
1. define the database model (model)
120-
2. define the data validation model (schema)
121-
3. define the view (api) and routing (router)
122-
4. write business (service)
123-
5. write database operations (crud)
124-
125-
## Testing
126-
127-
Execute unit tests through `pytest`.
128-
129-
1. create a test database `fba_test` with utf8mb4 encoding
130-
2. create database tables using the `backend/sql/create_tables.sql` file
131-
3. initialize the test data using the `backend/sql/init_pytest_data.sql` file
132-
4. Go to the `backend` directory and execute the test commands.
133-
134-
```shell
135-
cd backend/
136-
137-
pytest -vs --disable-warnings
138-
```
139-
140-
## Status
141-
142-
![Alt](https://repobeats.axiom.co/api/embed/b2174ef1abbebaea309091f1c998fc97d0c1536a.svg "Repo beats analytics image")
143-
14484
## Contributors
14585

14686
<a href="https://github.com/fastapi-practices/fastapi_best_architecture/graphs/contributors">

README.zh-CN.md

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ mvc 架构作为常规设计模式,在 python web 中也很常见,但是三
3434

3535
你可以在 [fastapi_best_architecture_ui](https://github.com/fastapi-practices/fastapi_best_architecture_ui) 中查看部分预览截图
3636

37-
幸运的是,我们现在有一个演示站点: [FBA UI](https://fba.xwboy.top/)
37+
演示入口请查看 [官方文档](https://fastapi-practices.github.io/fastapi_best_architecture_docs/)
3838

3939
> 测试员:tester / 123456
4040
>
@@ -70,71 +70,10 @@ mvc 架构作为常规设计模式,在 python web 中也很常见,但是三
7070
- [x] 定时任务:自动化任务,异步任务,支持函数调用
7171
- [x] 接口文档:自动生成在线交互式 API 接口文档
7272

73-
## 项目结构
74-
75-
```
76-
├─📁 backend--------------- # 后端
77-
│ ├─📁 alembic------------- # 数据库迁移
78-
│ ├─📁 app----------------- # 应用
79-
│ │ ├─📁 admin------------- # 系统后台
80-
│ │ │ ├─📁 api------------- # 接口
81-
│ │ │ ├─📁 crud------------ # CRUD
82-
│ │ │ ├─📁 model----------- # 模型
83-
│ │ │ ├─📁 schema---------- # 数据传输
84-
│ │ │ ├─📁 service--------- # 服务
85-
│ │ │ └─📁 tests----------- # 测试
86-
│ │ ├─📁 generator--------- # 代码生成
87-
│ │ └─📁 task-------------- # 任务
88-
│ ├─📁 common-------------- # 公共资源
89-
│ ├─📁 core---------------- # 核心配置
90-
│ ├─📁 database------------ # 数据库连接
91-
│ ├─📁 log----------------- # 日志
92-
│ ├─📁 middleware---------- # 中间件
93-
│ ├─📁 scripts------------- # 脚本
94-
│ ├─📁 sql----------------- # SQL文件
95-
│ ├─📁 static-------------- # 静态文件
96-
│ ├─📁 templates----------- # 模版文件
97-
│ └─📁 utils--------------- # 工具包
98-
└─📁 deploy---------------- # 服务器部署
99-
```
100-
101-
## 本地开发 / Docker 部署
73+
## 开发部署
10274

10375
更多详情请查看 [官方文档](https://fastapi-practices.github.io/fastapi_best_architecture_docs/)
10476

105-
## 测试数据
106-
107-
使用 `backend/sql/init_test_data.sql` 文件初始化测试数据
108-
109-
## 开发流程
110-
111-
(仅供参考)
112-
113-
1. 定义数据库模型(model)
114-
2. 定义数据验证模型(schema)
115-
3. 定义视图(api)和路由(router)
116-
4. 编写业务(service)
117-
5. 编写数据库操作(crud)
118-
119-
## 测试
120-
121-
通过 `pytest` 执行单元测试
122-
123-
1. 创建测试数据库 `fba_test`,选择 utf8mb4 编码
124-
2. 使用 `backend/sql/create_tables.sql` 文件创建数据库表
125-
3. 使用 `backend/sql/init_pytest_data.sql` 文件初始化测试数据
126-
4. 进入 `backend` 目录,执行测试命令
127-
128-
```shell
129-
cd backend/
130-
131-
pytest -vs --disable-warnings
132-
```
133-
134-
## 状态
135-
136-
![Alt](https://repobeats.axiom.co/api/embed/b2174ef1abbebaea309091f1c998fc97d0c1536a.svg "Repo beats analytics image")
137-
13877
## 贡献者
13978

14079
<a href="https://github.com/fastapi-practices/fastapi_best_architecture/graphs/contributors">

0 commit comments

Comments
 (0)