Skip to content

Commit 1d3b0e7

Browse files
authored
Update official documentation link to README (#429)
1 parent 36a458b commit 1d3b0e7

File tree

2 files changed

+5
-196
lines changed

2 files changed

+5
-196
lines changed

README.md

Lines changed: 3 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -103,105 +103,10 @@ Luckily, we now have a demo site: [FBA UI](https://fba.xwboy.top/)
103103
└─📁 deploy---------------- # Server deployment
104104
```
105105

106-
## Local development
106+
## Local development / Docker deployment
107107

108-
* Python: 3.10+
109-
* Mysql: 8.0+
110-
* Redis: The latest stable version is recommended
111-
* Nodejs: 14.0+
112-
113-
### Backend
114-
115-
1. Enter the `backend` directory
116-
117-
```shell
118-
cd backend
119-
```
120-
121-
2. Install the dependencies
122-
123-
```shell
124-
pip install -r requirements.txt
125-
```
126-
127-
3. Create a database `fba` with utf8mb4 encoding.
128-
4. Install and start Redis
129-
5. Create a `.env` file in the `backend` directory.
130-
131-
```shell
132-
touch .env
133-
134-
cp .env.example .env
135-
```
136-
137-
6. Modify the configuration files `core/conf.py` and `.env` as needed.
138-
7. database migration [alembic](https://alembic.sqlalchemy.org/en/latest/tutorial.html)
139-
140-
```shell
141-
# Generate the migration file
142-
alembic revision --autogenerate
143-
144-
# Execute the migration
145-
alembic upgrade head
146-
```
147-
148-
8. Start celery worker, beat and flower
149-
150-
```shell
151-
celery -A app.task.celery worker -l info
152-
153-
# Scheduled tasks (optional)
154-
celery -A app.task.celery beat -l info
155-
156-
# Web monitor (optional)
157-
celery -A app.task.celery flower --port=8555 --basic-auth=admin:123456
158-
```
159-
160-
9. [Initialize test data](#test-data) (Optional)
161-
10. Start fastapi service
162-
```shell
163-
# Help
164-
fastapi --help
165-
166-
# Dev mode
167-
fastapi dev main.py
168-
```
169-
170-
11. Open a browser and visit: http://127.0.0.1:8000/api/v1/docs
171-
172-
### Front end
173-
174-
Jump to [fastapi_best_architecture_ui](https://github.com/fastapi-practices/fastapi_best_architecture_ui) View details
175-
176-
---
177-
178-
### Docker Deployment
179-
180-
> [!WARNING]
181-
>
182-
> Default port conflicts: 8000, 3306, 6379, 5672.
183-
>
184-
> It is recommended to shut down local services: mysql, redis, rabbitmq... before deployment.
185-
186-
1. Go to the `deploy/backend/docker-compose` directory, and create the environment variable file `.env`.
187-
188-
```shell
189-
cd deploy/backend/docker-compose
190-
191-
touch .env.server ../../../backend/.env
192-
193-
cp .env.server ../../../backend/.env
194-
```
195-
196-
2. Modify the configuration files `backend/core/conf.py` and `.env` as needed.
197-
3. Execute the one-click startup command
198-
199-
```shell
200-
docker-compose up -d --build
201-
```
202-
203-
4. Wait for the command to complete.
204-
5. Open a browser and visit: http://127.0.0.1:8000/api/v1/docs
108+
For more details, please check
109+
the [official documentation](https://fastapi-practices.github.io/fastapi_best_architecture_docs/)
205110

206111
## Test data
207112

README.zh-CN.md

Lines changed: 2 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -98,105 +98,9 @@ mvc 架构作为常规设计模式,在 python web 中也很常见,但是三
9898
└─📁 deploy---------------- # 服务器部署
9999
```
100100

101-
## 本地开发
101+
## 本地开发 / Docker 部署
102102

103-
* Python 3.10+
104-
* Mysql 8.0+
105-
* Redis 推荐最新稳定版
106-
* Nodejs 14.0+
107-
108-
### 后端
109-
110-
1. 进入 `backend` 目录
111-
112-
```shell
113-
cd backend
114-
```
115-
116-
2. 安装依赖包
117-
118-
```shell
119-
pip install -r requirements.txt
120-
```
121-
122-
3. 创建一个数据库 `fba`,选择 utf8mb4 编码
123-
4. 安装并启动 Redis
124-
5.`backend` 目录下创建 `.env` 文件
125-
126-
```shell
127-
touch .env
128-
129-
cp .env.example .env
130-
```
131-
132-
6. 按需修改配置文件 `core/conf.py``.env`
133-
7. 数据库迁移 [alembic](https://alembic.sqlalchemy.org/en/latest/tutorial.html)
134-
135-
```shell
136-
# 生成迁移文件
137-
alembic revision --autogenerate
138-
139-
# 执行迁移
140-
alembic upgrade head
141-
```
142-
143-
8. 启动 celery worker, beat 和 flower
144-
145-
```shell
146-
celery -A app.task.celery worker -l info
147-
148-
# 定时任务(可选)
149-
celery -A app.task.celery beat -l info
150-
151-
# web 监控(可选)
152-
celery -A app.task.celery flower --port=8555 --basic-auth=admin:123456
153-
```
154-
155-
9. [初始化测试数据](#测试数据)(可选)
156-
10. 启动 fastapi 服务
157-
```shell
158-
# 帮助
159-
fastapi --help
160-
161-
# 开发模式
162-
fastapi dev main.py
163-
```
164-
165-
11. 打开浏览器访问:http://127.0.0.1:8000/api/v1/docs
166-
167-
### 前端
168-
169-
跳转 [fastapi_best_architecture_ui](https://github.com/fastapi-practices/fastapi_best_architecture_ui) 查看详情
170-
171-
---
172-
173-
### Docker 部署
174-
175-
> [!WARNING]
176-
>
177-
> 默认端口冲突:8000,3306,6379,5672
178-
>
179-
> 建议在部署前关闭本地服务:mysql,redis,rabbitmq...
180-
181-
1. 进入 `deploy/backend/docker-compose` 目录,创建环境变量文件`.env`
182-
183-
```shell
184-
cd deploy/backend/docker-compose
185-
186-
touch .env.server ../../../backend/.env
187-
188-
cp .env.server ../../../backend/.env
189-
```
190-
191-
2. 按需修改配置文件 `backend/core/conf.py``.env`
192-
3. 执行一键启动命令
193-
194-
```shell
195-
docker-compose up -d --build
196-
```
197-
198-
4. 等待命令执行完成
199-
5. 打开浏览器访问:http://127.0.0.1:8000/api/v1/docs
103+
更多详情请查看 [官方文档](https://fastapi-practices.github.io/fastapi_best_architecture_docs/)
200104

201105
## 测试数据
202106

0 commit comments

Comments
 (0)