Files
ocean/backend/README.md
T
2026-01-31 11:02:59 +08:00

42 lines
871 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 项目管理系统后端
依据《产品文档》与《API 文档》,Python + FastAPI 实现,TDD 开发。
## 目录结构
```
backend/
├── src/ # 后端源码
│ ├── __init__.py
│ └── app.py # FastAPI 应用与路由
├── tests/ # 测试用例
├── pytest.ini # pytest 配置(pythonpath = src
├── requirements.txt
└── API.md
```
## 运行测试
```bash
cd backend
source .venv/bin/activate
pytest tests/ -v
```
pytest 会通过 `pytest.ini``pythonpath = src` 自动把 `src` 加入 Python 路径,无需手动设置 PYTHONPATH。
## 启动服务
```bash
cd backend
source .venv/bin/activate
PYTHONPATH=src uvicorn app:app --reload --host 0.0.0.0 --port 8000
```
或进入 `src` 再启动:
```bash
cd backend/src
uvicorn app:app --reload --host 0.0.0.0 --port 8000
```