jiachenlong/backend/README.md

43 lines
663 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.

# 后端服务 - FastAPI
## 启动方式
### 开发环境
```bash
# 安装依赖
pip install -r requirements.txt
# 启动服务
python -m uvicorn app.main:app --port 3000 --host 0.0.0.0 --reload
```
### 生产环境
```bash
# 后台运行
nohup python -m uvicorn app.main:app --port 3000 --host 0.0.0.0 > /tmp/uvicorn.log 2>&1 &
# 或使用 systemd
sudo systemctl start zodiac-backend
```
## 配置说明
编辑 `.env` 文件:
```ini
# 数据库
DATABASE_URL=postgresql://postgres:密码@localhost:5432/zodiac
# JWT
SECRET_KEY=你的密钥
# OCR API
DASHSCOPE_API_KEY=sk-你的密钥
```
## API 文档
启动后访问http://localhost:3000/docs