feat: add WonderQ admin backend

Add FastAPI admin/public API service, database setup, Docker deployment files, docs, and tests.
This commit is contained in:
duanshuwen
2026-06-30 13:56:45 +08:00
parent 90496fd300
commit 75f5a5a48b
34 changed files with 2208 additions and 25 deletions

25
docs/backend/README.md Normal file
View File

@@ -0,0 +1,25 @@
# 后台 API 服务
`WonderQ-Admin` 当前是独立的 Python + FastAPI API 服务,使用 PostgreSQL 保存业务数据,通过 Docker Compose 启动 `api``postgres``redis`
## 本地 API 启动
```bash
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
docker compose up -d postgres redis
alembic upgrade head
python -m app.seed
uvicorn app.main:app --host 0.0.0.0 --port 4000 --reload
```
健康检查:`http://localhost:4000/health`
## 前端联调
后台管理前端位于 `D:\www\znkj\WonderQ-Admin-UI`。如需连接本服务,在前端 `.env` 或环境变量中配置:
```text
VITE_API_BASE_URL="http://localhost:4000"
```