Files
bttoxin-pipeline/scripts/start_web.sh
zly fe353fc0bc chore: 初始版本提交 - 简化架构 + 轮询改造
- 移除 Motia Streams 实时通信,改用 3 秒轮询
- 简化前端代码,移除冗余组件
- 简化后端架构,准备 FastAPI 重构
- 更新 pixi.toml 环境配置
- 保留 bttoxin_digger_v5_repro 作为参考文档

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-13 16:50:09 +08:00

45 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# Start both frontend and backend servers
# Usage: ./scripts/start_web.sh [frontend_port] [backend_port]
FRONTEND_PORT=${1:-5173}
BACKEND_PORT=${2:-8000}
echo "=========================================="
echo "BtToxin Pipeline Web Services"
echo "=========================================="
echo "Frontend: http://localhost:${FRONTEND_PORT}"
echo "Backend: http://localhost:${BACKEND_PORT}"
echo "=========================================="
echo ""
echo "Starting services..."
# Create jobs directory if it doesn't exist
mkdir -p jobs
echo "Jobs directory: $(pwd)/jobs"
# Start backend in background
echo "[Backend] Starting FastAPI server on port ${BACKEND_PORT}..."
uvicorn web.backend.main:app --reload --host 0.0.0.0 --port ${BACKEND_PORT} &
BACKEND_PID=$!
# Wait for backend to be ready
sleep 2
# Start frontend
echo "[Frontend] Starting Vite dev server on port ${FRONTEND_PORT}..."
cd frontend && pnpm dev --host --port ${FRONTEND_PORT} &
FRONTEND_PID=$!
echo ""
echo "=========================================="
echo "Services started:"
echo " - Backend (PID: ${BACKEND_PID}) on port ${BACKEND_PORT}"
echo " - Frontend (PID: ${FRONTEND_PID}) on port ${FRONTEND_PORT}"
echo "=========================================="
echo "Press Ctrl+C to stop all services"
echo ""
# Wait for any process to exit
wait