- 使用 React 18 + TypeScript + Vite + Tailwind CSS 构建前端 - 实现 WebSocket 实时通信(useWebSocket hook) - 添加聊天界面组件(MessageList, MessageBubble, MessageInput) - 集成 Topic 管理(新建、列出、切换) - 支持 Markdown 渲染(react-markdown + remark-gfm) - 添加工具调用展示面板 - 实现深色科技主题(Tech Dark) - 后端集成静态文件服务(tower-http) - 添加 Makefile 和 build.sh 构建脚本 - 更新 .gitignore 忽略前端构建产物 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
71 lines
1.6 KiB
Makefile
71 lines
1.6 KiB
Makefile
# PicoBot Web UI Makefile
|
|
|
|
.PHONY: dev dev-backend dev-frontend build clean install
|
|
|
|
# Default target
|
|
all: build
|
|
|
|
# Install dependencies
|
|
install:
|
|
@echo "Installing frontend dependencies..."
|
|
cd web && npm install
|
|
|
|
# Development - start both backend and frontend
|
|
dev:
|
|
@echo "Starting development servers..."
|
|
@make dev-backend &
|
|
@sleep 3
|
|
@make dev-frontend
|
|
@wait
|
|
|
|
# Start backend only
|
|
dev-backend:
|
|
@echo "Starting Rust backend..."
|
|
cargo run -- gateway
|
|
|
|
# Start frontend only
|
|
dev-frontend:
|
|
@echo "Starting frontend dev server..."
|
|
cd web && npm run dev
|
|
|
|
# Build for production
|
|
build:
|
|
@echo "Building PicoBot Web UI..."
|
|
cd web && npm run build
|
|
cargo build --release
|
|
@echo "Build complete!"
|
|
|
|
# Run production build
|
|
run:
|
|
cargo run --release -- gateway
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
@echo "Cleaning build artifacts..."
|
|
rm -rf static/*
|
|
cd web && rm -rf dist node_modules
|
|
cargo clean
|
|
|
|
# Check code formatting and linting
|
|
check:
|
|
@echo "Checking frontend..."
|
|
cd web && npm run build
|
|
@echo "Checking Rust code..."
|
|
cargo check
|
|
cargo clippy
|
|
|
|
# Help
|
|
help:
|
|
@echo "PicoBot Web UI Makefile"
|
|
@echo ""
|
|
@echo "Available targets:"
|
|
@echo " make install - Install frontend dependencies"
|
|
@echo " make dev - Start both backend and frontend (development)"
|
|
@echo " make dev-backend - Start Rust backend only"
|
|
@echo " make dev-frontend - Start frontend dev server only"
|
|
@echo " make build - Build for production"
|
|
@echo " make run - Run production build"
|
|
@echo " make clean - Clean build artifacts"
|
|
@echo " make check - Check code formatting and linting"
|
|
@echo " make help - Show this help message"
|