refactor: switch to free-trial/private-deploy/buyout pricing, fix feature gaps, add SEO landing + deploy config

This commit is contained in:
TradeMate Dev
2026-07-12 08:09:28 +08:00
parent 9ca5d79d8a
commit 04924e3bc4
36 changed files with 1026 additions and 975 deletions
+29 -4
View File
@@ -1,5 +1,20 @@
# TradeMate (外贸小助手) — Agent Guide
## Chrome 浏览器扩展 🆕
- **目录**: `browser-extension/` — 完整 Chrome 插件
- **功能**: popup 面板调用 AI 翻译/回复/提取客户信息、网页右键菜单集成、自动填写报价单
- **兼容平台**: LinkedIn / Amazon / AliExpress 等外贸平台页面
- **安装**: 打开 `chrome://extensions` → 加载已解压的扩展 → 选择 `browser-extension/` 目录
- **API 客户端**: `browser-extension/api/client.js` — 封装后端 API 调用,支持 JWT 认证
## UX Design
- **PC 工作台**: 侧边栏 5 项精简导航 (首页/客户/业务/翻译/更多) + **CommandK 命令面板** (Ctrl+K)
- **移动端 H5**: 底部 4 Tab 导航 (首页/客户/业务/我的)
- **工作区合并**: Customers/Discovery/Followup → `WorkspaceCustomer`Translate/Products/Quotations/Marketing → `WorkspaceBiz`
- **路由**: 旧页面保留隐藏路由,保证兼容性
## uni-app 移动端 H5 (改版后)
- **Tab Bar**: 4 项底部导航 — 首页 / 客户 / 业务 / 我的
@@ -36,9 +51,16 @@
- `GET /api/v1/agent/pipelines` — 任务列表
- `GET /api/v1/agent/{pipeline_id}` — 任务详情
- **流程**: 用户输入产品+市场 → AgentOrchestrator 串接 DiscoveryService.search() → analyze() → outreach() → 自动保存高匹配客户
- **前端入口**: `UserLayout.vue` 侧边栏首位 "AI数字员工" (MagicStick 图标)
- **前端入口**: `user-frontend/src/views/Agent.vue` 已接入路由 `/workspace/agent``UserLayout.vue` 侧边栏 "AI数字员工" (MagicStick 图标)`/agent` 重定向到 `/workspace/agent`
- **迁移**: 需要运行 `alembic revision --autogenerate -m "add agent_pipelines"` 创建 `agent_pipelines`
## 收费方式(免费试用 / 私有化部署 / 买断源码)
- **页面**: `user-frontend/src/views/Upgrade.vue` + `UpgradeModal.vue``uni-app/src/pages/upgrade/upgrade.vue`、浏览器插件升级入口均改为三种方案:免费试用 / 私有化部署(年付授权)/ 买断源码(一次性)
- **企业线索**: 私有化部署与买断源码的 CTA 提交到 `POST /api/v1/leads`(模型 `EnterpriseLead`,表 `enterprise_leads`),无需登录;admin 可在 `enterprise_leads` 表查看
- **价格占位**: `Upgrade.vue``PRICING` 对象(¥39,800/年、¥98,000 一次性)为可配置展示值
- **说明**: 旧的按月订阅套餐(`/credits/subscribe`)仍存在于后端,但前端不再主推;如彻底下线订阅需同步清理 `credits.py` 订阅逻辑
## Architecture
- **Backend**: `backend/` — FastAPI + SQLAlchemy 1.4 async + asyncpg, single `app.main:app`
@@ -50,8 +72,8 @@
## AI Providers
- **Active**: Sensenova (商汤), NVIDIA, 阿里机器翻译 (alibaba-mt) — 5 providers in DB
- **Removed**: Claude, DeepL, Local, OpencodeGo, 讯飞 Spark — all git rm'd
- **Active (seeded by `seed_from_env()`)**: Sensenova (商汤, if `SENSENOVA_API_KEY` set), NVIDIA (if `NVIDIA_API_KEY` set), 阿里翻译 alibaba-mt (always inserted) — at most 3 rows. Do NOT assume 5 providers exist.
- **Removed**: Claude, DeepL, Local, OpencodeGo, 讯飞 Spark — provider implementations were git rm'd; don't re-add them.
- **DB-driven**: `AIProvider` model + `admin_ai.py` API — manage providers at runtime. `router.seed_from_env()` loads from `.env` on startup
- **ECS RAM role**: 阿里翻译使用 ECS 实例 RAM 角色 `trademate-translate` 获取 STS 临时凭证
- **Provider type mapping** in `router.py._build_provider()`: sensenova, nvidia, alibaba-mt
@@ -90,6 +112,8 @@ cd user-frontend && npm run dev # port 5174, base: /workspace/
cd backend && venv/bin/pytest # all
venv/bin/pytest tests/test_auth_api.py # single file
venv/bin/pytest tests/ -k "test_login" # keyword filter
# pytest.ini: asyncio_mode=auto (no @pytest.mark.asyncio needed) and
# addopts adds --cov=app coverage automatically on every run.
# Builds
cd uni-app && npm run build:h5 # uni-app (mobile H5)
@@ -110,6 +134,7 @@ alembic revision --autogenerate -m "desc"
- **Nginx**: SPA fallbacks for `/app/`, `/admin/`, `/workspace/`
- **vite config**: each project has its own `base` path and dev port
- **API**: proxied via nginx `location /api/` to `127.0.0.1:8000`
- **Makefile `make deploy`** references `docker-compose.prod.yml` / `docker-compose.staging.yml`, which do **not** exist (only `docker-compose.yml` is present). Those targets are currently broken.
## Critical Quirks
@@ -132,7 +157,7 @@ alembic revision --autogenerate -m "desc"
## Project Conventions
- **No README.md** — key context is in `PROGRESS.md` and `docs/`
- **Docs**: `README.md` (overview), `PROGRESS.md` (task status), `docs/` (API/schema/architecture). README references this file for dev norms.
- **Chinese UI** — mobile-first, for foreign-trade SOHOs/small teams
- **No comments in code** unless explicitly asked
- **Commit messages** focus on "why" not "what", in English