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:
45
README.md
45
README.md
@@ -220,7 +220,7 @@ external_dbs/bt_toxin/
|
|||||||
├── db/ # BLAST index files (required)
|
├── db/ # BLAST index files (required)
|
||||||
│ ├── bt_toxin.phr
|
│ ├── bt_toxin.phr
|
||||||
│ ├── bt_toxin.pin
|
│ ├── bt_toxin.pin
|
||||||
│ ├── bt_toxin.psq
|
│ ├── bt_toxin.ps
|
||||||
│ └── ...
|
│ └── ...
|
||||||
└── seq/ # Source sequences (optional, for reference)
|
└── seq/ # Source sequences (optional, for reference)
|
||||||
└── bt_toxin*.fas
|
└── bt_toxin*.fas
|
||||||
@@ -274,6 +274,41 @@ Common insect orders in predictions:
|
|||||||
|
|
||||||
## Development
|
## 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
|
### Python Development Environment
|
||||||
|
|
||||||
For development work outside pixi:
|
For development work outside pixi:
|
||||||
@@ -287,8 +322,14 @@ uv pip install -e .
|
|||||||
### Running Tests
|
### Running Tests
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Run property-based tests
|
# Run property-based tests for pipeline
|
||||||
pixi run -e pipeline python -m pytest tests/test_pixi_runner.py -v
|
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
|
### Project Structure
|
||||||
|
|||||||
39
pixi.toml
39
pixi.toml
@@ -24,12 +24,34 @@ pandas = ">=2.0.0"
|
|||||||
matplotlib = ">=3.7.0"
|
matplotlib = ">=3.7.0"
|
||||||
seaborn = ">=0.12.2"
|
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]
|
[environments]
|
||||||
digger = ["digger"]
|
digger = ["digger"]
|
||||||
pipeline = ["pipeline"]
|
pipeline = ["pipeline"]
|
||||||
|
frontend = ["frontend"]
|
||||||
|
webbackend = ["webbackend"]
|
||||||
|
|
||||||
# =========================
|
# =========================
|
||||||
# pixi tasks
|
# pixi tasks
|
||||||
@@ -41,3 +63,20 @@ pipeline = "python scripts/run_single_fna_pipeline.py"
|
|||||||
digger-only = "python scripts/run_digger_stage.py"
|
digger-only = "python scripts/run_digger_stage.py"
|
||||||
shotter = "python scripts/bttoxin_shoter.py"
|
shotter = "python scripts/bttoxin_shoter.py"
|
||||||
plot = "python scripts/plot_shotter.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"
|
||||||
|
|||||||
Reference in New Issue
Block a user