feat: 集成 DeepSeek AI 服务

- 新增 backend 服务 (Express + TypeScript)
- 前端表单提交改为调用后端 API
- DeepSeek 增强分析结果,本地规则作为 fallback
- Docker 双容器部署:web (Nginx) + backend
- Nginx 反向代理 /api 到后端服务
- 本地开发支持 Vite 代理 + backend:dev 脚本

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jowe
2026-03-28 01:37:52 +08:00
parent 7fe1586dc0
commit 3c0fbd5059
22 changed files with 909 additions and 352 deletions

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
web:
build:
@@ -9,6 +7,8 @@ services:
ports:
- "8801:80"
restart: unless-stopped
depends_on:
- backend
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost/"]
interval: 30s
@@ -18,6 +18,29 @@ services:
networks:
- tianxuan-network
backend:
build:
context: .
dockerfile: backend/Dockerfile
container_name: tianxuan-company-backend
restart: unless-stopped
env_file:
- .env
environment:
PORT: 3000
DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY}
DEEPSEEK_BASE_URL: ${DEEPSEEK_BASE_URL:-https://api.deepseek.com}
DEEPSEEK_MODEL: ${DEEPSEEK_MODEL:-deepseek-chat}
REQUEST_TIMEOUT_MS: ${REQUEST_TIMEOUT_MS:-20000}
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:3000/api/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1))"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- tianxuan-network
networks:
tianxuan-network:
driver: bridge