feat: 添加 frontend 和 webbackend 开发环境配置

- 新增 frontend 环境:Vue 3 + Vite + Element Plus
- 新增 webbackend 环境:FastAPI
- 更新 README 开发文档

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-01-08 22:29:37 +08:00
parent 665506e1a5
commit 4267bda227
3 changed files with 932 additions and 2 deletions

View File

@@ -220,7 +220,7 @@ external_dbs/bt_toxin/
├── db/ # BLAST index files (required)
│ ├── bt_toxin.phr
│ ├── bt_toxin.pin
│ ├── bt_toxin.psq
│ ├── bt_toxin.ps
│ └── ...
└── seq/ # Source sequences (optional, for reference)
└── bt_toxin*.fas
@@ -274,6 +274,41 @@ Common insect orders in predictions:
## Development
### Frontend Development
The frontend is a Vue 3 + Vite + Element Plus application located in `frontend/`.
```bash
# Install dependencies
pixi run fe-install
# Start development server (http://localhost:5173)
pixi run fe-dev
# Build for production
pixi run fe-build
# Run unit tests
pixi run fe-test
# Lint and fix code
pixi run fe-lint
```
### Web Backend Development
The web backend is a FastAPI application located in `web/backend/`.
```bash
# Start development server with hot reload (http://localhost:8000)
pixi run api-dev
# Run tests
pixi run api-test
# API documentation available at http://localhost:8000/api/docs (when DEBUG=true)
```
### Python Development Environment
For development work outside pixi:
@@ -287,8 +322,14 @@ uv pip install -e .
### Running Tests
```bash
# Run property-based tests
# Run property-based tests for pipeline
pixi run -e pipeline python -m pytest tests/test_pixi_runner.py -v
# Run frontend tests
pixi run fe-test
# Run backend tests
pixi run api-test
```
### Project Structure

850
pixi.lock

File diff suppressed because it is too large Load Diff

View File

@@ -24,12 +24,34 @@ pandas = ">=2.0.0"
matplotlib = ">=3.7.0"
seaborn = ">=0.12.2"
# =========================
# frontend 环境Node.js 前端依赖
# =========================
[feature.frontend.dependencies]
nodejs = ">=20"
pnpm = ">=10"
# =========================
# webbackend 环境FastAPI 后端依赖
# =========================
[feature.webbackend.dependencies]
python = ">=3.11"
fastapi = "*"
uvicorn = "*"
pydantic = "*"
pydantic-settings = "*"
python-dotenv = "*"
httpx = "*"
pytest = "*"
# =========================
# 环境定义
# =========================
[environments]
digger = ["digger"]
pipeline = ["pipeline"]
frontend = ["frontend"]
webbackend = ["webbackend"]
# =========================
# pixi tasks
@@ -41,3 +63,20 @@ pipeline = "python scripts/run_single_fna_pipeline.py"
digger-only = "python scripts/run_digger_stage.py"
shotter = "python scripts/bttoxin_shoter.py"
plot = "python scripts/plot_shotter.py"
# =========================
# frontend tasks
# =========================
[feature.frontend.tasks]
fe-install = { cmd = "pnpm install", cwd = "frontend" }
fe-dev = { cmd = "pnpm dev", cwd = "frontend" }
fe-build = { cmd = "pnpm build", cwd = "frontend" }
fe-test = { cmd = "pnpm test:unit --run", cwd = "frontend" }
fe-lint = { cmd = "pnpm lint", cwd = "frontend" }
# =========================
# webbackend tasks
# =========================
[feature.webbackend.tasks]
api-dev = "uvicorn web.backend.main:app --reload --host 0.0.0.0 --port 8000"
api-test = "pytest web/backend/ -v"