Files
PicAnalysis/backend/.env.example
锦麟 王 f8472987f0 feat: 实现多 OCR 提供商架构和完整设置页面
## 主要变更

### OCR 架构
- 新增多提供商 OCR 系统 (Tesseract.js, Baidu OCR, RapidOCR)
- 添加 Provider 基类接口和工厂模式
- 支持 provider 自动选择和降级处理
- 新增 RapidOCR Python HTTP 服务 (端口 8080)

### 路径修复
- 修复 Windows 平台路径解析问题
- 统一路径处理工具 (lib/path.ts)
- 修复 uploads 目录定位问题

### 设置页面重构
- 三个标签页:API 配置、OCR 配置、AI 配置
- API 服务器地址配置
- OCR 服务商配置(Tesseract.js, RapidOCR, 百度 OCR)
- AI 服务商配置(智谱 GLM, MiniMax, DeepSeek, Kimi, OpenAI, Anthropic)

### 端口配置
- 前端端口: 13056
- 后端端口: 13057

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 14:00:22 +08:00

55 lines
1.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Database
DATABASE_URL="file:./dev.db"
# JWT
JWT_SECRET="your-secret-key-change-in-production"
JWT_EXPIRES_IN="24h"
# Server
PORT=4000
NODE_ENV="development"
# CORS
CORS_ORIGIN="http://localhost:3000"
# OCR
# OCR Provider: tesseract | baidu | rapidocr | auto
# - tesseract: 本地轻量,需要安装 tesseract.js
# - baidu: 云端准确,需要配置 API Key (有免费额度)
# - rapidocr: 本地快速准确,需要启动 RapidOCR 服务
# - auto: 自动选择可用的 provider
OCR_PROVIDER="auto"
OCR_CONFIDENCE_THRESHOLD="0.3"
# Tesseract.js (本地 OCR无需额外配置)
# 安装: npm install tesseract.js
# Baidu OCR (云端 OCR需要申请密钥)
# 获取地址: https://cloud.baidu.com/product/ocr
BAIDU_OCR_API_KEY=""
BAIDU_OCR_SECRET_KEY=""
# RapidOCR (本地快速 OCR需要启动服务)
# Docker: docker run -d -p 8080:8080 cshgg/rapidocr
# 或参考: https://github.com/RapidAI/RapidOCR
RAPIDOCR_API_URL="http://localhost:8080"
# AI (GLM)
GLM_API_KEY=""
GLM_API_URL="https://open.bigmodel.cn/api/paas/v4/chat/completions"
GLM_MODEL="glm-4-flash"
# AI (MiniMax)
MINIMAX_API_KEY=""
MINIMAX_API_URL="https://api.minimax.chat/v1/chat/completions"
MINIMAX_MODEL="abab6.5s-chat"
# AI (DeepSeek)
DEEPSEEK_API_KEY=""
DEEPSEEK_API_URL="https://api.deepseek.com/v1/chat/completions"
DEEPSEEK_MODEL="deepseek-chat"
# Upload
UPLOAD_MAX_SIZE="10485760"
UPLOAD_ALLOWED_TYPES="image/jpeg,image/png,image/webp"