chore: seal Design Vision v1 and monorepo scaffold
Archive the differentiated YuXinGu product docs, AI engineering system, design contract, and Go/Vue scaffold. Next execution prioritizes Cece-parity over early innovation (see .ai/product/STRATEGY.md). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# Domain docs
|
||||
|
||||
| File | Purpose |
|
||||
|---|---|
|
||||
| [../domain.md](../domain.md) | Ubiquitous language — terms only |
|
||||
| [domain-map.md](domain-map.md) | Bounded contexts, aggregates, ER sketch |
|
||||
@@ -0,0 +1,183 @@
|
||||
# Domain Map — 愈心谷(DDD 视角)
|
||||
|
||||
给后端 / DB / OpenAPI / SDK 用的**能力域与实体图**。
|
||||
词汇以 [../domain.md](../domain.md) 为准;产品范围以 [../product/feature-map.md](../product/feature-map.md) 为准。
|
||||
竞品能力对照:[../product/cece-feature-map.md](../product/cece-feature-map.md)。
|
||||
|
||||
AI 生成表结构或 API 时:先落本图中的 Context / Aggregate,再写 migration;禁止发明未列出的聚合根名。
|
||||
|
||||
---
|
||||
|
||||
## 1. Bounded Contexts
|
||||
|
||||
```
|
||||
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
|
||||
│ Identity │──▶│ Profile │──▶│ Discovery │
|
||||
│ (User) │ │ Life Archive│ │ Decode/Scale│
|
||||
└─────────────┘ └──────┬───────┘ └──────┬──────┘
|
||||
│ │
|
||||
▼ ▼
|
||||
┌──────────────┐ ┌─────────────┐
|
||||
│ Relationship │ │ Ask │
|
||||
│ Match │ │ Companion │
|
||||
└──────┬───────┘ └──────┬──────┘
|
||||
│ │
|
||||
▼ ▼
|
||||
┌─────────────────────────────────┐
|
||||
│ Commerce │
|
||||
│ Subscription / Order / Unlock │
|
||||
└─────────────────────────────────┘
|
||||
│
|
||||
┌──────────────┼──────────────┐
|
||||
▼ ▼ ▼
|
||||
ContentFeed GrowthShare Consult(*)
|
||||
(* later)
|
||||
```
|
||||
|
||||
| Context | 职责 | MVP |
|
||||
|---|---|---|
|
||||
| **Identity** | Visitor/User/Session | Yes |
|
||||
| **Profile** | Self/Other 生命档案 | Yes |
|
||||
| **Discovery** | Decode、Scale、Report 生成 | Yes |
|
||||
| **Relationship** | Match | Yes |
|
||||
| **Ask** | 档案上下文对话、额度 | Skeleton |
|
||||
| **Companion** | SolarTerm、Mood | Skeleton |
|
||||
| **Commerce** | Subscription、Membership、Order、Unlock、Payment | Yes (mock) |
|
||||
| **Content** | Feed 配置 | Static OK |
|
||||
| **Growth** | Share 卡片元数据 | Minimal |
|
||||
| **Consult** | 真人顾问 Marketplace | No |
|
||||
| **Recommendation** | 推荐 | V1 rules |
|
||||
|
||||
---
|
||||
|
||||
## 2. Aggregates & Entities(命名强制)
|
||||
|
||||
### Identity
|
||||
|
||||
| Type | Name | Notes |
|
||||
|---|---|---|
|
||||
| Aggregate | **User** | 注册主体 |
|
||||
| Entity | Session | token 会话 |
|
||||
| Entity | DeviceIdentity | Visitor 匿名 |
|
||||
|
||||
### Profile(生命档案)
|
||||
|
||||
| Type | Name | Notes |
|
||||
|---|---|---|
|
||||
| Aggregate | **Profile** | `relation`: self \| other |
|
||||
| VO | BirthInput | date;time/place optional later |
|
||||
| VO | RelationType | partner/family/friend/… |
|
||||
|
||||
### Discovery
|
||||
|
||||
| Type | Name | Notes |
|
||||
|---|---|---|
|
||||
| Aggregate | **Report** | type: decode \| match \| … |
|
||||
| Domain Svc | DecodeEngine | 可复算;结果入 Report |
|
||||
| Aggregate | **Scale** | 量表定义 |
|
||||
| Entity | ScaleQuestion | |
|
||||
| Aggregate | **ScaleResult** | 作答 + 计分 |
|
||||
|
||||
### Relationship
|
||||
|
||||
| Type | Name | Notes |
|
||||
|---|---|---|
|
||||
| Aggregate | **Match** | 引用两个 Profile;产出 Report 或嵌入 |
|
||||
|
||||
### Ask / Companion
|
||||
|
||||
| Type | Name | Notes |
|
||||
|---|---|---|
|
||||
| Aggregate | **AskThread** | 挂 profile_id |
|
||||
| Entity | AskMessage | role user/assistant |
|
||||
| Entity | AskQuota | 与 Membership 联动 |
|
||||
| Aggregate | **Mood** | 日维度打卡 |
|
||||
| Read Model | **SolarTerm** | 日历内容;可配置表 |
|
||||
|
||||
### Commerce
|
||||
|
||||
| Type | Name | Notes |
|
||||
|---|---|---|
|
||||
| Aggregate | **Subscription** | 计划 SKU |
|
||||
| Aggregate | **Membership** | 用户权益状态 |
|
||||
| Aggregate | **Order** | 订阅或 Unlock |
|
||||
| Entity | Payment | mock / 渠道 |
|
||||
| Entity | Unlock | order → report 解锁 |
|
||||
|
||||
### Content / Growth(薄)
|
||||
|
||||
| Type | Name | Notes |
|
||||
|---|---|---|
|
||||
| Entity | FeedItem | 运营配置 |
|
||||
| VO | SharePayload | 分享卡字段 |
|
||||
|
||||
### Consult(Later)
|
||||
|
||||
| Type | Name | Notes |
|
||||
|---|---|---|
|
||||
| Aggregate | Consultant | |
|
||||
| Aggregate | ConsultOrder | |
|
||||
| Entity | ConsultSession | |
|
||||
|
||||
---
|
||||
|
||||
## 3. 关键关系(ER 草图)
|
||||
|
||||
```
|
||||
User 1──* Profile
|
||||
Profile 1──* Report
|
||||
Profile 1──* AskThread
|
||||
User 1──* ScaleResult
|
||||
User 1──0..1 Membership
|
||||
User 1──* Order
|
||||
Order 0..1── Unlock ──▶ Report
|
||||
Profile ── Match ── Profile
|
||||
User 1──* Mood
|
||||
```
|
||||
|
||||
权益规则:**Membership / Unlock 只由服务端判定**;客户端不可信任。
|
||||
|
||||
---
|
||||
|
||||
## 4. Context → 代码落点
|
||||
|
||||
| Context | Go | H5 |
|
||||
|---|---|---|
|
||||
| Identity | `internal/service/user` | login / mine |
|
||||
| Profile | `service/profile` | decode form, mine |
|
||||
| Discovery | `service/report`, `service/scale` | decode, explore, report |
|
||||
| Relationship | `service/match` | match |
|
||||
| Ask | `service/ask` | ask tab |
|
||||
| Companion | `service/companion` | companion tab |
|
||||
| Commerce | `service/order`, `membership` | paywall, mine |
|
||||
|
||||
包名只用 `domain.md` 词汇:`user` `profile` `report` `order` `membership` `scale` `ask` `mood`。
|
||||
|
||||
---
|
||||
|
||||
## 5. 测测域 → 愈心谷域 映射
|
||||
|
||||
| 测测概念 | 愈心谷 |
|
||||
|---|---|
|
||||
| 星盘档案 | **Profile**(生日+体质相关输入) |
|
||||
| 测测 AI | **Ask** |
|
||||
| 真人 1v1 | **Consult**(后置) |
|
||||
| MBTI 等 | **Scale** |
|
||||
| 缘分合盘 | **Match**(合规叙事) |
|
||||
| 今日运势 | **SolarTerm** + 生活建议(替换) |
|
||||
| 会员 | **Subscription / Membership** |
|
||||
| AI 玩法广场 | **[No] MVP** |
|
||||
| 心情打卡 | **Mood** |
|
||||
| 沙盘/心情小镇 | **[No]** |
|
||||
|
||||
---
|
||||
|
||||
## 6. 生成顺序(给 AI)
|
||||
|
||||
1. 改范围 → 更新 `product/feature-map.md` MVP 标记
|
||||
2. 新实体 → 本文件 + `domain.md` 词条(若新词)
|
||||
3. migration → `playbooks/new-table.md`
|
||||
4. API → `playbooks/add-api.md` + OpenAPI
|
||||
5. 页面 → `playbooks/new-page.md` + design contract
|
||||
|
||||
下一步可选:单独 `apps/docs/erd.md` 或 migrations 初稿(本任务不强制)。
|
||||
Reference in New Issue
Block a user