← Foundations Course

ENGINEERING BRIDGE · 32

Capstone:從空資料夾做出一個可部署、可 Debug 的 Mini System

Capstone 不要求你背更多 API。你要把 Foundations 的 mental models 全部實際用一次:HTML/CSS/JS client、HTTP API、data persistence、auth boundary、Git/CI/deploy、production evidence。

Learning outcomes

1. Product Requirement

Course Workspace

User can:
- view courses
- create course
- edit own course
- delete own course
- sign in/out

不要一開始就選 framework。先把 capabilities 和 trust rules 寫清楚。

2. Architecture

Browser
  HTML/CSS/JS
    ↓ HTTPS
Course API
  validation/auth
    ↓
Database
  constraints/RLS

3. Phase 1:Static UI

HTML semantics
CSS responsive layout
JS local state

No backend yet

先讓 UI flow 成立,再引入 network complexity。

4. Phase 2:API / Data

GET /courses
POST /courses
PATCH /courses/:id
DELETE /courses/:id

Database:
courses(id, owner_id, title)

5. Phase 3:Auth / Security

authenticated user
  ↓
server verifies identity
  ↓
authorization
  ↓
RLS / constraints

用 user A/B/anon 測試,不只用 admin context。

6. Phase 4:Engineering

git commits
CI checks
build artifact
manual deploy
production smoke
rollback plan

Project checkpoint:Definition of Done

Feature:
critical flows work

Correctness:
unit/integration checks pass

Security:
A cannot edit B

Operations:
CI green
deploy traceable to commit
production smoke PASS

Debug:
request id / logs available

7. Required Incident Drill

刻意製造三個 bug:

每一個都要保存 symptom → evidence → root cause → fix → regression。

8. Review Standard

你不需要一次寫出企業級系統;但你必須能回答每一層「誰在執行、input/output 是什麼、state 在哪、失敗怎麼看」。這就是 Foundations 真正的完成條件。

Knowledge check / Final review

  1. 畫完整 architecture 與 trust boundaries。
  2. 列出至少 8 個 failure points 與 evidence。
  3. 從空 repo 安排 commit/CI/deploy 順序。
  4. 完成 incident drill 後再進專項語言課程。