Files
users/开发文档/2、架构/系统架构.md

90 lines
1.5 KiB
Markdown
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.

# 神射手数据中台 - 系统架构
> 📅 更新: 2026-01-31
---
## 一、四层架构
```
客户端层 → 网关层 → 服务层 → 数据层
```
### 1.1 客户端层
- 浏览器 (localhost:3001)
- 飞书机器人
- 企业微信
- API调用方
### 1.2 网关层
- **Next.js 14**:前端 + /api/* 接口
- **卡若AI Gateway**/feishu/*, /wecom/*
### 1.3 服务层
- 用户查询queryFullProfile, intelligentSearch
- AI对话parseIntent, handleQuery
- 标签统计:$sample 采样
- 流量池user_evaluation_score 分桶
- 人群圈选:按项目 getProjectPools
### 1.4 数据层
- MongoDB localhost:27017
- 26个KR_*数据库
- 20.13亿条记录
---
## 二、架构图
```mermaid
graph TB
subgraph 客户端
A[浏览器]
B[飞书]
C[企微]
end
subgraph 网关
D[Next.js :3001]
E[卡若AI Gateway :8000]
end
subgraph 服务
F[用户查询]
G[AI对话]
H[标签引擎]
I[流量池]
end
subgraph 数据
J[(MongoDB :27017)]
end
A --> D
B --> E
C --> E
D --> F
D --> G
D --> H
D --> I
E --> G
F --> J
G --> J
H --> J
I --> J
```
---
## 三、数据流向
```
数据源(KR_*) → AI标签引擎 → KR.用户估值 → 流量池分层 → 导出/发送
```
---
## 四、关联文档
- [核心架构逻辑.md](./核心架构逻辑.md)
- [技术选型.md](./技术选型.md)
- [数据库.md](./数据库.md)