docs: add research assets, screenshots and guides
Include supplementary documentation, research notes on Lexical/UX, and setup guides.
This commit is contained in:
860
docs/prd/epic-1-execution-plan.md
Normal file
860
docs/prd/epic-1-execution-plan.md
Normal file
@@ -0,0 +1,860 @@
|
||||
# Epic 1: 執行狀態與調整計劃
|
||||
|
||||
**更新日期:** 2025-01-30
|
||||
**基於:** 4 個專業代理的深度分析報告
|
||||
|
||||
---
|
||||
|
||||
## 📊 當前執行狀態總覽
|
||||
|
||||
### 整體進度
|
||||
|
||||
| Story | 完成度 | 狀態 | 阻礙項目 | 優先級 |
|
||||
|-------|--------|------|----------|--------|
|
||||
| 1.1 基礎設施設置 | 85% | ⚠️ 接近完成 | Shared package 配置不完整 | P0 |
|
||||
| 1.2 Collections 定義 | 43% | ❌ 需要大量工作 | Portfolio Collection 缺失 | P0 |
|
||||
| 1.3 內容遷移腳本 | 0% | ⏸️ 未開始 | 依賴 Story 1.2 | P1 |
|
||||
| 1.4-1.11 頁面實作 | 0% | ⏸️ 未開始 | 依賴前置 Stories | P1 |
|
||||
| 1.12-1.13 認證與後台 | 0% | ⏸️ 未開始 | 可並行 | P2 |
|
||||
|
||||
---
|
||||
|
||||
## 🔍 Story 1.1 詳細分析
|
||||
|
||||
### ✅ 已完成的驗收標準
|
||||
|
||||
1. **AC1: pnpm workspace configured** - ✅ 100%
|
||||
- 正確配置所有 packages
|
||||
- workspace 依賴解析正常
|
||||
|
||||
2. **AC2: Payload CMS 3.x initialized** - ✅ 100%
|
||||
- 版本:3.59.1
|
||||
- MongoDB adapter 配置完整
|
||||
- R2 storage adapter 配置完整
|
||||
|
||||
3. **AC3: Astro 6.0.x SSR project** - ✅ 100%
|
||||
- 使用 Astro 6.0.0-beta.1(超過原本 4.x 要求)
|
||||
- Cloudflare native runtime 配置
|
||||
- SSR 模式正確啟用
|
||||
|
||||
4. **AC7: Local dev runs** - ✅ 100%
|
||||
- `pnpm dev` 正常運行
|
||||
- 前後端同時啟動
|
||||
|
||||
### ⚠️ 部分完成的驗收標準
|
||||
|
||||
5. **AC4: TypeScript strict mode** - ⚠️ 66%
|
||||
- Backend: ✅ strict mode 已啟用
|
||||
- Frontend: ✅ strict mode 已啟用
|
||||
- **Shared: ❌ strict mode 未啟用**
|
||||
|
||||
6. **AC5: Turborepo configured** - ⚠️ 60%
|
||||
- 基礎任務配置存在
|
||||
- **缺少:** typecheck 任務
|
||||
- **缺少:** inputs/outputs 完整配置
|
||||
|
||||
7. **AC6: Shared utilities linked** - ⚠️ 30%
|
||||
- Tailwind 配置可導出
|
||||
- **源碼未導出:** `src/index.ts` 不在 exports 中
|
||||
- **缺少:** build 和 typecheck scripts
|
||||
|
||||
### 📋 Story 1.1 剩餘任務清單
|
||||
|
||||
**高優先級(必須完成):**
|
||||
1. 修復 `packages/shared/tsconfig.json` - 添加 `"strict": true`
|
||||
2. 修復 `packages/shared/package.json` - 添加源碼 exports
|
||||
3. 添加 `packages/shared/package.json` scripts
|
||||
4. 添加根目錄 `typecheck` script
|
||||
5. 創建根目錄 `.env.example`
|
||||
|
||||
**預估完成時間:** 40 分鐘
|
||||
|
||||
---
|
||||
|
||||
## ❌ Story 1.2 詳細執行計劃
|
||||
|
||||
### 當前狀態:43% 完成 → 目標:100%
|
||||
|
||||
**重要更新:** 已創建詳細修改計劃文檔
|
||||
📄 `docs/prd/payload-cms-modification-plan.md`
|
||||
|
||||
---
|
||||
|
||||
### 📊 Collection 完成度總覽
|
||||
|
||||
| Collection | 當前 | 目標 | 缺失 | 優先級 |
|
||||
|-----------|------|------|------|--------|
|
||||
| Portfolio | 0% | 100% | 整個 collection | 🔴 P0 |
|
||||
| Categories | 40% | 100% | 4 欄位 | 🔴 P0 |
|
||||
| Posts | 60% | 100% | 4 欄位 | 🟡 P1 |
|
||||
| Users | 70% | 100% | 1 欄位 | 🟡 P1 |
|
||||
| Access Control | 50% | 100% | 2 函數 | 🟡 P1 |
|
||||
|
||||
**總預估時間:** 4 小時(比原計劃減少 50%)
|
||||
|
||||
---
|
||||
|
||||
### 🎯 階段化實作計劃
|
||||
|
||||
#### Phase 1: Critical Blockers(1.5 小時)
|
||||
**目標:** 解除 Story 1.9 (Blog) 和 1.10 (Portfolio) 的阻礙
|
||||
|
||||
**Task 1.2.1: 創建 Portfolio Collection** (1 小時)
|
||||
- ✅ 完整欄位定義文檔已規劃
|
||||
- ✅ Access control 策略已定義
|
||||
- ✅ Auto-slug hook 已規劃
|
||||
- 📁 檔案:`collections/Portfolio/index.ts`
|
||||
- 📋 詳細內容:參考 `payload-cms-modification-plan.md` Task 1.2.1
|
||||
|
||||
**Task 1.2.2: 完善 Categories Collection** (30 分鐘)
|
||||
- ✅ 4 個新欄位已定義(nameEn, order, textColor, backgroundColor)
|
||||
- ✅ 顏色欄位格式已確定(hex code)
|
||||
- ✅ Admin UI 配置已規劃
|
||||
- 📁 檔案:`collections/Categories.ts`
|
||||
- 📋 詳細內容:參考 `payload-cms-modification-plan.md` Task 1.2.2
|
||||
|
||||
#### Phase 2: Content Enhancement(1 小時)
|
||||
**目標:** 完善內容管理功能
|
||||
|
||||
**Task 1.2.3: 完善 Posts Collection** (30 分鐘)
|
||||
- ✅ 4 個新欄位已定義(excerpt, ogImage, showInFooter, status)
|
||||
- ✅ excerpt 長度限制:200 字
|
||||
- ✅ status 選項:draft, review, published
|
||||
- 📁 檔案:`collections/Posts/index.ts`
|
||||
- 📋 詳細內容:參考 `payload-cms-modification-plan.md` Task 1.2.3
|
||||
|
||||
**Task 1.2.4: 完善 Users Collection** (30 分鐘)
|
||||
- ✅ role 欄位已定義(admin/editor)
|
||||
- ✅ 預設值:editor
|
||||
- ✅ Admin UI 配置已規劃
|
||||
- 📁 檔案:`collections/Users/index.ts`
|
||||
- 📋 詳細內容:參考 `payload-cms-modification-plan.md` Task 1.2.4
|
||||
|
||||
#### Phase 3: Security & Access(1.5 小時)
|
||||
**目標:** 實現角色權限系統
|
||||
|
||||
**Task 1.2.5: 創建 Access Control 函數** (30 分鐘)
|
||||
- ✅ adminOnly() 函數已定義
|
||||
- ✅ adminOrEditor() 函數已定義
|
||||
- ✅ 使用場景已文檔化
|
||||
- 📁 檔案:`access/adminOnly.ts`, `access/adminOrEditor.ts`
|
||||
- 📋 詳細內容:參考 `payload-cms-modification-plan.md` Task 1.2.5
|
||||
|
||||
**Task 1.2.6: 應用 Access Control** (30 分鐘)
|
||||
- ✅ 所有 collections 的 access rules 已規劃
|
||||
- ✅ Globals 的 access control 已規劃
|
||||
- ✅ 角色權限矩陣已定義
|
||||
- 📁 檔案:7 個 collection/global 檔案
|
||||
- 📋 詳細內容:參考 `payload-cms-modification-plan.md` Task 1.2.6
|
||||
|
||||
**Task 1.2.7: 驗證和測試** (1 小時)
|
||||
- ✅ 測試腳本已規劃
|
||||
- ✅ 驗收清單已定義
|
||||
- ✅ 角色權限測試案例已準備
|
||||
- 📋 詳細內容:參考 `payload-cms-modification-plan.md` Task 1.2.7
|
||||
|
||||
---
|
||||
|
||||
### 🔄 Webflow 欄位對應表
|
||||
|
||||
#### Portfolio Collection
|
||||
| Webflow 欄位 | Payload 欄位 | 轉換規則 |
|
||||
|-------------|-------------|---------|
|
||||
| Name | title | 直接對應 |
|
||||
| Slug | slug | 保留原始值 |
|
||||
| Website Link | url | 直接對應 |
|
||||
| Preview Image | image | 上傳到 R2 |
|
||||
| Description | description | 直接對應 |
|
||||
| Website Type | websiteType | Select: landing-page/booking/corporate/ecommerce/other |
|
||||
| Tags | tags | String array |
|
||||
|
||||
#### Categories Collection
|
||||
| Webflow 欄位 | Payload 欄位 | 轉換規則 |
|
||||
|-------------|-------------|---------|
|
||||
| Name | title | 直接對應 |
|
||||
| Slug | slug | 保留原始值 |
|
||||
| - | nameEn | ❌ 需手動新增 |
|
||||
| - | order | ❌ 預設 0,手動調整 |
|
||||
| Color | textColor/backgroundColor | 拆分為兩個欄位(hex code) |
|
||||
|
||||
#### Posts Collection
|
||||
| Webflow 欄位 | Payload 欄位 | 轉換規則 |
|
||||
|-------------|-------------|---------|
|
||||
| Title | title | 直接對應 |
|
||||
| Slug | slug | 保留原始值 |
|
||||
| Body | content | Richtext → Lexical JSON |
|
||||
| Published Date | publishedAt | ISO 8601 format |
|
||||
| Post Category | categories | 關聯 Categories collection |
|
||||
| Featured Image | heroImage | 上傳到 R2 |
|
||||
| SEO Title | meta.title | SEO plugin |
|
||||
| SEO Description | meta.description | SEO plugin |
|
||||
| - | excerpt | ❌ 需手動新增(200 字限制) |
|
||||
| - | ogImage | ❌ 需手動上傳(建議 1200x630px) |
|
||||
| - | showInFooter | ❌ 預設 false |
|
||||
| - | status | ❌ 根據 published 判斷(draft/review/published) |
|
||||
|
||||
---
|
||||
|
||||
### 📋 最終驗收標準
|
||||
|
||||
#### Collection 完整性
|
||||
- [x] Portfolio: 7/7 欄位(title, slug, url, image, description, websiteType, tags)
|
||||
- [x] Categories: 6/6 欄位(title, nameEn, order, textColor, backgroundColor, slug)
|
||||
- [x] Posts: 13/13 欄位(含新增的 excerpt, ogImage, showInFooter, status)
|
||||
- [x] Users: 4/4 欄位(email, name, role, password)
|
||||
- [x] Media: 100% ✅(已完整)
|
||||
- [x] Pages: 100% ✅(已完整)
|
||||
|
||||
#### Access Control 完整性
|
||||
- [x] 5 個 access 函數:
|
||||
- anyone ✅(已有)
|
||||
- authenticated ✅(已有)
|
||||
- authenticatedOrPublished ✅(已有)
|
||||
- adminOnly ✅(新增)
|
||||
- adminOrEditor ✅(新增)
|
||||
|
||||
#### 角色權限矩陣
|
||||
| 操作 | Admin | Editor | 說明 |
|
||||
|------|-------|--------|------|
|
||||
| **Users** | | | |
|
||||
| 刪除用戶 | ✅ | ❌ | adminOnly |
|
||||
| 創建用戶 | ✅ | ❌ | adminOnly |
|
||||
| **Posts/Pages** | | | |
|
||||
| 創建內容 | ✅ | ✅ | adminOrEditor |
|
||||
| 刪除內容 | ✅ | ✅ | adminOrEditor |
|
||||
| 發布內容 | ✅ | ✅ | adminOrEditor |
|
||||
| **Settings** | | | |
|
||||
| 修改 Header/Footer | ✅ | ❌ | adminOnly |
|
||||
|
||||
#### 功能驗收
|
||||
- [x] 所有 collections 在 admin panel 可見
|
||||
- [x] 所有欄位可編輯
|
||||
- [x] 角色權限正確執行
|
||||
- [x] Media 上傳到 R2
|
||||
- [x] Rich text editor 正常
|
||||
- [x] 型別生成成功(`pnpm generate:types`)
|
||||
|
||||
---
|
||||
|
||||
### 📊 更新後的時間影響
|
||||
|
||||
**原估計(Story 1.2):** 不明確,預估 8-12 小時
|
||||
**更新後(Story 1.2):** **4 小時**(明確的 7 個 tasks)
|
||||
|
||||
**Sprint 0 總時間:**
|
||||
- Story 1.1: 40 分鐘
|
||||
- Story 1.2: 4 小時
|
||||
- **總計:4.5 小時**(比原計劃 8-12 小時減少 **50-60%**)
|
||||
|
||||
**理由:**
|
||||
1. Payload CMS 架構清晰,修改簡單
|
||||
2. Access control 模式一致,易於應用
|
||||
3. 詳細計劃減少了不確定性
|
||||
4. 大部分欄位是簡單的 text/select/upload 類型
|
||||
|
||||
---
|
||||
|
||||
### 🔗 相關 Stories 依賴更新
|
||||
|
||||
#### Story 1.9: Blog System(依賴 Story 1.2)
|
||||
**新增依賴:**
|
||||
- ✅ Categories.textColor/backgroundColor → category theming
|
||||
- ✅ Posts.excerpt → article list display
|
||||
- ✅ Posts.status → filter published posts
|
||||
|
||||
#### Story 1.10: Portfolio(依賴 Story 1.2)
|
||||
**新增依賴:**
|
||||
- ✅ Portfolio collection 必須存在
|
||||
- ✅ 所有 7 個欄位必須定義
|
||||
|
||||
#### Story 1.12: Authentication(依賴 Story 1.2)
|
||||
**新增依賴:**
|
||||
- ✅ Users.role 欄位必須存在
|
||||
- ✅ adminOnly/adminOrEditor 函數必須創建
|
||||
- ✅ 所有 collections 必須應用 access control
|
||||
|
||||
**詳細的依賴更新請參考:**
|
||||
`docs/prd/payload-cms-modification-plan.md` → "相關 Stories 更新" 章节
|
||||
- ✅ authors (relationship to users)
|
||||
- ✅ meta (SEO fields via plugin)
|
||||
|
||||
**缺失欄位:**
|
||||
- ❌ excerpt (text) - 文章摘要
|
||||
- ❌ ogImage (media) - Open Graph 圖片(獨立於 heroImage)
|
||||
- ❌ showInFooter (boolean) - 是否在頁腳顯示
|
||||
- ❌ status - 自定義狀態(當前只有 _status: draft/published)
|
||||
|
||||
**影響:**
|
||||
- Story 1.9 (Blog System) 的摘要在列表頁無法顯示
|
||||
- SEO 影響:社交分享預覽不完整
|
||||
- 頁腳動態文章列表無法實作
|
||||
|
||||
**實作優先級:** 🟡 **High**
|
||||
|
||||
#### ⚠️ Access Control 缺失
|
||||
|
||||
**當前狀態:**
|
||||
- ✅ `authenticated()` - 檢查是否登入
|
||||
- ✅ `anyone()` - 允許所有人
|
||||
- ✅ `authenticatedOrPublished()` - 認證用戶看全部,未認證看已發布
|
||||
|
||||
**缺失:**
|
||||
- ❌ **角色系統未實現**
|
||||
- Users collection 沒有 `role` 欄位
|
||||
- 沒有 `adminOnly()` access function
|
||||
- 沒有 `adminOrEditor()` access function
|
||||
|
||||
**Story 1.12 要求:**
|
||||
- Admin role: 完整權限
|
||||
- Editor role: 僅內容管理
|
||||
|
||||
**實作優先級:** 🟡 **High** (Story 1.12 前置需求)
|
||||
|
||||
---
|
||||
|
||||
## 📊 Story 1.2 完整任務清單
|
||||
|
||||
### Phase 1: 創建 Portfolio Collection (Critical)
|
||||
|
||||
**檔案:** `apps/backend/src/collections/Portfolio/index.ts`
|
||||
|
||||
**任務:**
|
||||
1. 創建 Portfolio collection config
|
||||
2. 定義所有必需欄位
|
||||
3. 配置 access control
|
||||
4. 添加 hooks (如果需要)
|
||||
5. 註冊到 `payload.config.ts`
|
||||
|
||||
**預估時間:** 1 小時
|
||||
|
||||
### Phase 2: 完善 Categories Collection (Critical)
|
||||
|
||||
**檔案:** `apps/backend/src/collections/Categories.ts`
|
||||
|
||||
**任務:**
|
||||
1. 添加 `nameEn` 欄位 (text)
|
||||
2. 添加 `order` 欄位 (number, defaultValue: 0)
|
||||
3. 添加 `textColor` 欄位 (text, 顏色選擇器)
|
||||
4. 添加 `backgroundColor` 欄位 (text, 顏色選擇器)
|
||||
5. 更新 admin UI 配置
|
||||
|
||||
**預估時間:** 30 分鐘
|
||||
|
||||
### Phase 3: 完善 Posts Collection (High)
|
||||
|
||||
**檔案:** `apps/backend/src/collections/Posts/index.ts`
|
||||
|
||||
**任務:**
|
||||
1. 添加 `excerpt` 欄位 (text, textarea)
|
||||
2. 添加 `ogImage` 欄位 (upload to media)
|
||||
3. 添加 `showInFooter` 欄位 (checkbox, default: false)
|
||||
4. 添加 `status` 欄位 (select: draft, review, published)
|
||||
5. 更新 admin UI 配置
|
||||
|
||||
**預估時間:** 30 分鐘
|
||||
|
||||
### Phase 4: 實現角色系統 (High)
|
||||
|
||||
**檔案:** `apps/backend/src/collections/Users/index.ts`
|
||||
**檔案:** `apps/backend/src/access/adminOnly.ts` (新建)
|
||||
**檔案:** `apps/backend/src/access/adminOrEditor.ts` (新建)
|
||||
|
||||
**任務:**
|
||||
1. 在 Users collection 添加 `role` 欄位 (select: admin, editor)
|
||||
2. 創建 `adminOnly()` access function
|
||||
3. 創建 `adminOrEditor()` access function
|
||||
4. 更新 Collections 的 access control:
|
||||
- Users delete: adminOnly
|
||||
- Posts/Pages create/update/delete: adminOrEditor
|
||||
5. 重新生成型別
|
||||
|
||||
**預估時間:** 1 小時
|
||||
|
||||
### Phase 5: 驗證和測試
|
||||
|
||||
**任務:**
|
||||
1. 重新生成 Payload 型別
|
||||
2. 啟動開發環境
|
||||
3. 驗證所有 collections 出現在 admin sidebar
|
||||
4. 測試新增欄位功能
|
||||
5. 測試角色系統(創建 admin/editor 用戶)
|
||||
6. 測試 R2 上傳(如果尚未測試)
|
||||
|
||||
**預估時間:** 1 小時
|
||||
|
||||
**總預估時間:** 4 小時
|
||||
|
||||
---
|
||||
|
||||
## 🔄 更新的依賴關係圖
|
||||
|
||||
### Critical Path(關鍵路徑)
|
||||
|
||||
```
|
||||
Story 1.1 (85%) ← 剩 40 分鐘
|
||||
↓
|
||||
Story 1.2 (43%) ← 剩 4 小時
|
||||
├─ Phase 1: Portfolio Collection (1 hr) ← BLOCKER
|
||||
├─ Phase 2: Categories (30 min) ← BLOCKER
|
||||
├─ Phase 3: Posts (30 min)
|
||||
├─ Phase 4: Role System (1 hr)
|
||||
└─ Phase 5: Verification (1 hr)
|
||||
↓
|
||||
Story 1.3 (0%) ← 依賴 1.2 完成
|
||||
↓
|
||||
Story 1.4-1.11 (0%) ← 可並行
|
||||
├─ Story 1.4: Header/Footer
|
||||
├─ Story 1.5: Homepage ← 依賴 1.4
|
||||
├─ Story 1.6: About Page
|
||||
├─ Story 1.7: Solutions Page
|
||||
├─ Story 1.8: Contact Page
|
||||
├─ Story 1.9: Blog ← 依賴 1.2 完成
|
||||
├─ Story 1.10: Portfolio ← 依賴 1.2 完成 (BLOCKER)
|
||||
└─ Story 1.11: Teams Page
|
||||
↓
|
||||
Story 1.12-1.13 (0%) ← 可與頁面並行
|
||||
├─ Story 1.12: Authentication ← 依賴 1.2 Role System
|
||||
└─ Story 1.13: Dashboard
|
||||
↓
|
||||
Story 1.14-1.17 (0%) ← 最後階段
|
||||
├─ Story 1.14: SEO
|
||||
├─ Story 1.15: Performance
|
||||
├─ Story 1.16: Deployment
|
||||
└─ Story 1.17: Testing
|
||||
```
|
||||
|
||||
### Parallel Opportunities(並行開發機會)
|
||||
|
||||
**Wave 1: Infrastructure & Collections (必須先完成)**
|
||||
- Story 1.1: 剩餘 40 分鐘
|
||||
- Story 1.2: 4 小時
|
||||
|
||||
**Wave 2: Migration & Layout (可並行)**
|
||||
- Story 1.3: 內容遷移腳本 (12-16 hr)
|
||||
- Story 1.4: Header/Footer 組件 (8-10 hr)
|
||||
|
||||
**Wave 3: Core Pages (可並行)**
|
||||
- Story 1.5: Homepage (6-8 hr) ← 依賴 1.4
|
||||
- Story 1.6: About Page (6-8 hr)
|
||||
- Story 1.7: Solutions Page (4-6 hr)
|
||||
- Story 1.8: Contact Page (6-8 hr)
|
||||
|
||||
**Wave 4: Content Systems (可並行)**
|
||||
- Story 1.9: Blog System (12-16 hr) ← 依賴 1.2
|
||||
- Story 1.10: Portfolio (6-8 hr) ← 依賴 1.2
|
||||
- Story 1.11: Teams Page (4-6 hr)
|
||||
- Story 1.12: Authentication (8-10 hr) ← 依賴 1.2
|
||||
- Story 1.13: Dashboard (4-6 hr)
|
||||
|
||||
**Wave 5: Production Readiness**
|
||||
- Story 1.14: SEO (8-10 hr)
|
||||
- Story 1.15: Performance (8-12 hr)
|
||||
- Story 1.16: Deployment (6-8 hr)
|
||||
- Story 1.17: Testing (12-16 hr)
|
||||
|
||||
---
|
||||
|
||||
## 🎯 優先級調整建議
|
||||
|
||||
基於分析報告,建議調整 Story 優先級:
|
||||
|
||||
### P0 (Critical - 本週必須完成)
|
||||
|
||||
1. **完成 Story 1.1** (40 分鐘)
|
||||
- 移除阻礙 Story 1.2 的配置問題
|
||||
|
||||
2. **完成 Story 1.2 Phase 1-2** (1.5 小時)
|
||||
- 創建 Portfolio Collection ← **Critical Blocker**
|
||||
- 完善 Categories Collection ← **Critical Blocker**
|
||||
|
||||
**理由:** 這些是 Story 1.9 和 1.10 的直接阻礙
|
||||
|
||||
### P1 (High - 下週完成)
|
||||
|
||||
3. **完成 Story 1.2 Phase 3-5** (2.5 小時)
|
||||
- 完善 Posts Collection
|
||||
- 實現角色系統
|
||||
- 驗證和測試
|
||||
|
||||
4. **開始 Story 1.4** (Header/Footer)
|
||||
- 為所有頁面提供 Layout 基礎
|
||||
|
||||
### P2 (Medium - 視情況而定)
|
||||
|
||||
5. **Story 1.5-1.8** (核心頁面)
|
||||
- 按順序實作:首頁 → 關於 → 方案 → 聯絡
|
||||
|
||||
6. **Story 1.9-1.10** (內容系統)
|
||||
- Blog 和 Portfolio (依賴 1.2 完成)
|
||||
|
||||
---
|
||||
|
||||
## 📝 Story 1.2 詳細任務定義
|
||||
|
||||
### Task 1.2.1: Create Portfolio Collection
|
||||
|
||||
**User Story:**
|
||||
```gherkin
|
||||
As a Developer,
|
||||
I want to create a Portfolio collection in Payload CMS,
|
||||
So that website projects can be stored and managed.
|
||||
|
||||
Acceptance Criteria:
|
||||
- Portfolio collection exists with slug 'portfolio'
|
||||
- Has 7 required fields: title, slug, url, image, description, websiteType, tags
|
||||
- Image field uploads to R2 storage
|
||||
- Access control: authenticated users can read, admins can edit
|
||||
- Collection appears in admin sidebar
|
||||
```
|
||||
|
||||
**Definition of Done:**
|
||||
- [ ] Collection config file created
|
||||
- [ ] All 7 fields defined with correct types
|
||||
- [ ] Admin UI labels configured (Chinese)
|
||||
- [ ] Access control functions applied
|
||||
- [ ] Registered in payload.config.ts
|
||||
- [ ] Types regenerated successfully
|
||||
- [ ] Verified in admin panel
|
||||
|
||||
**預估時間:** 1 小時
|
||||
|
||||
---
|
||||
|
||||
### Task 1.2.2: Complete Categories Collection
|
||||
|
||||
**User Story:**
|
||||
```gherkin
|
||||
As a Developer,
|
||||
I want to add missing fields to Categories collection,
|
||||
So that blog categories have complete metadata.
|
||||
|
||||
Acceptance Criteria:
|
||||
- nameEn field added (English name)
|
||||
- order field added (sorting, default: 0)
|
||||
- textColor field added (with color picker)
|
||||
- backgroundColor field added (with color picker)
|
||||
- All fields appear in admin UI
|
||||
- Fields are editable and save correctly
|
||||
```
|
||||
|
||||
**Definition of Done:**
|
||||
- [ ] 4 new fields added to Categories collection
|
||||
- [ ] Admin UI configured with proper labels
|
||||
- [ ] Color picker enabled for color fields
|
||||
- [ ] Types regenerated
|
||||
- [ ] Tested in admin panel
|
||||
|
||||
**預估時間:** 30 分鐘
|
||||
|
||||
---
|
||||
|
||||
### Task 1.2.3: Complete Posts Collection
|
||||
|
||||
**User Story:**
|
||||
```gherkin
|
||||
As a Developer,
|
||||
I want to add missing fields to Posts collection,
|
||||
So that blog posts have complete metadata for display and SEO.
|
||||
|
||||
Acceptance Criteria:
|
||||
- excerpt field added (textarea, 200 char limit)
|
||||
- ogImage field added (upload to media, separate from heroImage)
|
||||
- showInFooter field added (checkbox, default: false)
|
||||
- status field added (select: draft, review, published)
|
||||
- All fields appear in post editor
|
||||
- Fields save and load correctly
|
||||
```
|
||||
|
||||
**Definition of Done:**
|
||||
- [ ] 4 new fields added to Posts collection
|
||||
- [ ] Admin UI configured
|
||||
- [ ] excerpt field has character limit
|
||||
- [ ] ogImage has image preview
|
||||
- [ ] Types regenerated
|
||||
- [ ] Tested creating/editing a post
|
||||
|
||||
**預估時間:** 30 分鐘
|
||||
|
||||
---
|
||||
|
||||
### Task 1.2.4: Implement Role-Based Access Control
|
||||
|
||||
**User Story:**
|
||||
```gherkin
|
||||
As an Admin,
|
||||
I want to have different access levels for admins and editors,
|
||||
So that editors can only manage content, not system settings.
|
||||
|
||||
Acceptance Criteria:
|
||||
- role field added to Users collection (admin, editor)
|
||||
- adminOnly() access function created
|
||||
- adminOrEditor() access function created
|
||||
- Users collection: delete restricted to admins
|
||||
- Posts/Pages: create/update/delete restricted to adminOrEditor
|
||||
- Settings access restricted to admins
|
||||
```
|
||||
|
||||
**Definition of Done:**
|
||||
- [ ] role field added to Users collection
|
||||
- [ ] Default value: 'editor'
|
||||
- [ ] adminOnly.ts file created
|
||||
- [ ] adminOrEditor.ts file created
|
||||
- [ ] All collections updated with new access rules
|
||||
- [ ] Tested with both admin and editor users
|
||||
- [ ] Types regenerated
|
||||
|
||||
**預估時間:** 1 小時
|
||||
|
||||
---
|
||||
|
||||
### Task 1.2.5: Verify and Test Collections
|
||||
|
||||
**User Story:**
|
||||
```gherkin
|
||||
As a QA Engineer,
|
||||
I want to verify all collections work correctly,
|
||||
So that content management is functional.
|
||||
|
||||
Acceptance Criteria:
|
||||
- All collections appear in admin sidebar
|
||||
- All fields are editable in admin UI
|
||||
- Role-based access control works correctly
|
||||
- Media uploads to R2 successfully
|
||||
- Rich text editor works in Posts
|
||||
- Can create users with different roles
|
||||
```
|
||||
|
||||
**Definition of Done:**
|
||||
- [ ] All 6 collections visible in sidebar
|
||||
- [ ] Created test portfolio item
|
||||
- [ ] Created test category with all fields
|
||||
- [ ] Created test post with all fields
|
||||
- [ ] Created admin and editor users
|
||||
- [ ] Verified access restrictions
|
||||
- [ ] Documented any issues
|
||||
|
||||
**預估時間:** 1 小時
|
||||
|
||||
---
|
||||
|
||||
## 📋 Sprint 建議
|
||||
|
||||
### Sprint 0: Infrastructure Completion(1 天)
|
||||
|
||||
**目標:** 完成 Story 1.1 和 Story 1.2 關鍵部分
|
||||
|
||||
**Backlog:**
|
||||
1. ✅ Story 1.1 - Complete Shared package config (40 min)
|
||||
2. ✅ Story 1.2 - Task 1.2.1: Portfolio Collection (1 hr)
|
||||
3. ✅ Story 1.2 - Task 1.2.2: Categories Completion (30 min)
|
||||
|
||||
**更新說明:** Story 1.2 已擴展為 7 個詳細任務(共 4 小時),但 Sprint 0 專注於 Phase 1(Critical Blockers)
|
||||
|
||||
**Sprint Goal:**
|
||||
解除 Story 1.9 和 1.10 的阻礙(Portfolio 和 Categories)
|
||||
|
||||
**Definition of Done:**
|
||||
- [ ] Story 1.1 達到 100%
|
||||
- [ ] Portfolio Collection 創建完成(7/7 欄位)
|
||||
- [ ] Categories Collection 完整(6/6 欄位)
|
||||
- [ ] 所有型別生成成功
|
||||
- [ ] 開發環境正常運行
|
||||
|
||||
**預估時間:** 2.5 小時(比原計劃減少)
|
||||
|
||||
---
|
||||
|
||||
### Sprint 1: Collections Completion & Content Enhancement (1-2 天)
|
||||
|
||||
**目標:** 完成 Story 1.2 剩餘任務,完善 Posts/Users/Access Control
|
||||
|
||||
**Backlog:**
|
||||
1. ✅ Story 1.2 - Task 1.2.3: Posts Completion (30 min)
|
||||
2. ✅ Story 1.2 - Task 1.2.4: Users Completion (30 min)
|
||||
3. ✅ Story 1.2 - Task 1.2.5: Create Access Control Functions (30 min)
|
||||
4. ✅ Story 1.2 - Task 1.2.6: Apply Access Control (30 min)
|
||||
5. ✅ Story 1.2 - Task 1.2.7: Verification and Testing (1 hr)
|
||||
6. ⏸️ Story 1.4 - Header/Footer Components(可選,如時間允許)
|
||||
|
||||
**Sprint Goal:**
|
||||
完成所有 Collections 定義和 Access Control,Payload CMS 完整可用
|
||||
|
||||
**Definition of Done:**
|
||||
- [ ] Story 1.2 達到 100%(所有 7 個 tasks 完成)
|
||||
- [ ] Portfolio Collection: 7/7 欄位 ✅
|
||||
- [ ] Categories Collection: 6/6 欄位 ✅
|
||||
- [ ] Posts Collection: 13/13 欄位 ✅
|
||||
- [ ] Users Collection: 4/4 欄位(含 role)✅
|
||||
- [ ] Access Control: 5 個函數完整 ✅
|
||||
- [ ] 角色權限測試通過
|
||||
- [ ] 所有型別生成成功
|
||||
|
||||
**預估時間:** 3 小時(Story 1.2 Phase 2-3)+ 可選 Story 1.4
|
||||
|
||||
---
|
||||
|
||||
### Sprint 2: Layout & Core Pages (3-4 天)
|
||||
|
||||
**目標:** Header/Footer + 核心頁面實作
|
||||
|
||||
**Backlog:**
|
||||
1. Story 1.4 - Header/Footer Components (8-10 hr)
|
||||
2. Story 1.5 - Homepage (6-8 hr)
|
||||
3. Story 1.6 - About Page (6-8 hr)
|
||||
4. Story 1.7 - Solutions Page (4-6 hr)
|
||||
|
||||
**Sprint Goal:**
|
||||
主要頁面上線,導航和佈局完成
|
||||
|
||||
**Definition of Done:**
|
||||
- [ ] Header/Footer 在所有頁面顯示
|
||||
- [ ] 首頁、關於、方案頁面完成
|
||||
- [ ] 視覺保真度 95%+
|
||||
- [ ] Lighthouse Performance 90+
|
||||
|
||||
---
|
||||
|
||||
### Sprint 3: Content Systems (3-4 天)
|
||||
|
||||
**目標:** Blog, Portfolio, Contact 頁面
|
||||
|
||||
**Backlog:**
|
||||
1. Story 1.8 - Contact Page (6-8 hr)
|
||||
2. Story 1.9 - Blog System (12-16 hr)
|
||||
3. Story 1.10 - Portfolio (6-8 hr)
|
||||
4. Story 1.11 - Teams Page (4-6 hr)
|
||||
|
||||
**Sprint Goal:**
|
||||
所有頁面內容系統完成
|
||||
|
||||
**Definition of Done:**
|
||||
- [ ] Blog 文章列表和詳情頁完成
|
||||
- [ ] Portfolio 列表和詳情頁完成
|
||||
- [ ] Teams 頁面完成
|
||||
- [ ] Contact 表單功能正常
|
||||
|
||||
---
|
||||
|
||||
### Sprint 4: Auth & Admin (2-3 天)
|
||||
|
||||
**目標:** 認證系統和管理後台
|
||||
|
||||
**Backlog:**
|
||||
1. Story 1.12 - Authentication System (8-10 hr)
|
||||
2. Story 1.13 - Admin Dashboard (4-6 hr)
|
||||
|
||||
**Sprint Goal:**
|
||||
編輯者可以登入並管理內容
|
||||
|
||||
**Definition of Done:**
|
||||
- [ ] 登入/登出功能正常
|
||||
- [ ] 角色權限正確執行
|
||||
- [ ] Dashboard 顯示統計資訊
|
||||
- [ ] 可以創建/編輯內容
|
||||
|
||||
---
|
||||
|
||||
### Sprint 5: Production Readiness (3-4 天)
|
||||
|
||||
**目標:** SEO、性能、部署、測試
|
||||
|
||||
**Backlog:**
|
||||
1. Story 1.14 - SEO Implementation (8-10 hr)
|
||||
2. Story 1.15 - Performance Optimization (8-12 hr)
|
||||
3. Story 1.16 - Deployment (6-8 hr)
|
||||
4. Story 1.17 - Testing (12-16 hr)
|
||||
|
||||
**Sprint Goal:**
|
||||
網站正式上線
|
||||
|
||||
**Definition of Done:**
|
||||
- [ ] SEO 設定完整
|
||||
- [ ] Lighthouse 95+
|
||||
- [ ] 部署到 Cloudflare
|
||||
- [ ] 所有測試通過
|
||||
- [ ] 生產環境驗證
|
||||
|
||||
---
|
||||
|
||||
## 📊 調整後的時間線
|
||||
|
||||
**原估計:** 120-160 小時 (7 週)
|
||||
|
||||
**調整後考慮:**
|
||||
- Payload CMS 瘦身已完成(減少維護成本)
|
||||
- Story 1.2 實際複雜度比預期高
|
||||
- Story 1.1 已接近完成
|
||||
|
||||
**更新後時間線:**
|
||||
|
||||
| 週次 | Sprint | 主要交付物 | 預估工時 |
|
||||
|------|--------|----------|----------|
|
||||
| Week 1 | Sprint 0 | Story 1.1 完成 + Story 1.2 關鍵部分 | 8-12 hr |
|
||||
| Week 2-3 | Sprint 1 | Story 1.2 完成 + Story 1.3 遷移 | 24-30 hr |
|
||||
| Week 4-5 | Sprint 2 | Story 1.4-1.7 核心頁面 | 30-40 hr |
|
||||
| Week 6-7 | Sprint 3 | Story 1.8-1.11 內容系統 | 30-40 hr |
|
||||
| Week 8 | Sprint 4 | Story 1.12-1.13 認證後台 | 16-20 hr |
|
||||
| Week 9-10 | Sprint 5 | Story 1.14-1.17 上線準備 | 40-50 hr |
|
||||
|
||||
**總預估:** 148-192 小時 (約 10 週)
|
||||
|
||||
---
|
||||
|
||||
## 🎯 下一步行動建議
|
||||
|
||||
### 立即執行(今天)
|
||||
|
||||
1. **完成 Story 1.1** (40 分鐘)
|
||||
- 快速修復 Shared package 配置
|
||||
- 為 Story 1.2 清除障礙
|
||||
|
||||
2. **創建 Portfolio Collection** (1 小時)
|
||||
- 最高優先級
|
||||
- 解除 Story 1.10 BLOCKER
|
||||
|
||||
### 本週執行
|
||||
|
||||
3. **完善 Categories Collection** (30 分鐘)
|
||||
4. **完善 Posts Collection** (30 分鐘)
|
||||
5. **實現角色系統** (1 小時)
|
||||
6. **驗證測試** (1 小時)
|
||||
|
||||
**目標:** Story 1.1 和 1.2 達到 100%
|
||||
|
||||
### 下週執行
|
||||
|
||||
7. **開始 Story 1.3** (內容遷移腳本)
|
||||
8. **或開始 Story 1.4** (Header/Footer)
|
||||
|
||||
---
|
||||
|
||||
## 📌 關鍵決策點
|
||||
|
||||
### 決策 1: Story 1.3 是否需要立即執行?
|
||||
|
||||
**選項 A:** 是 - 先遷移內容,再實作頁面
|
||||
- 優點:確保內容結構正確
|
||||
- 缺點:看不到實際頁面效果
|
||||
|
||||
**選項 B:** 否 - 先實作頁面,用測試數據
|
||||
- 優點:快速看到視覺成果
|
||||
- 缺點:後續需要更新所有內容
|
||||
|
||||
**建議:** 選項 B - 先實作 Story 1.5 (首頁),建立基礎模板
|
||||
|
||||
### 決策 2: Story 1.12 (認證) 優先級?
|
||||
|
||||
**選項 A:** 高優先級 - 現在就實作
|
||||
- 優點:內容編輯者可以提前開始工作
|
||||
- 缺點:增加當前工作量
|
||||
|
||||
**選項 B:** 中優先級 - 在頁面完成後實作
|
||||
- 優點:集中精力完成用戶可見功能
|
||||
- 缺點:內容管理延後
|
||||
|
||||
**建議:** 選項 B - 在 Sprint 4 執行(頁面完成後)
|
||||
|
||||
---
|
||||
|
||||
**文檔生成時間:** 2025-01-30
|
||||
**基於:** 4 個專業代理分析報告 + Payload CMS 瘩身分析
|
||||
Reference in New Issue
Block a user