labs.cloudflare.dev

Developer Labs Developer Labs Developer Labs

23 bài lab guided từ labs.cloudflare.dev — Workers, MCP, Agents SDK, Sandbox SDK — đọc từng bước ngay trên hub. Bổ sung lộ trình, không thay docs hay bài học trong track. 23 guided labs from labs.cloudflare.dev — Workers, MCP, Agents SDK, Sandbox SDK — follow each step on this hub. Complements this track; it does not replace docs or the in-track lessons. Lab guided 23 ពី labs.cloudflare.dev — Workers, MCP, Agents SDK, Sandbox SDK — ធ្វើតាមជំហាននីមួយៗនៅលើ hub នេះ។ បំពេញផ្លូវសិក្សា មិនជំនួស docs ឬមេរៀនក្នុង track។

4 track · 23 bài lab trên hub 4 tracks · 23 lab articles on this hub 4 track · 23 អត្ថបទ lab នៅលើ hub នេះ

7 labs 7 labs 7 labs

Cloudflare Workers Cloudflare Workers Cloudflare Workers

Ship Bookmark API Ship a Bookmark API Ship Bookmark API

Routing, KV, D1 và Workers AI — xây Bookmark API từ zero rồi deploy. Routing, KV, D1, and Workers AI — build a Bookmark API from scratch, then deploy. Routing, KV, D1 និង Workers AI — សង់ Bookmark API ពីសូន្យ បន្ទាប់មក deploy។

  • HTTP APIs
  • KV
  • D1
  • Workers AI
  1. 1

    Bắt đầu: auth, C3, đọc code, test Getting started: auth, C3, read the code, test ចាប់ផ្តើម៖ auth, C3, អាន code, test

    Đăng nhập Cloudflare, tạo project Bookmark API, hiểu file, chạy local. Sign in to Cloudflare, create the Bookmark API project, read the files, run locally. ចូល Cloudflare បង្កើត project Bookmark API អាន file រត់ local។

  2. 2

    Routes và CRUD Routes and CRUD Routes និង CRUD

    Type Bookmark, router, handler create/list/get/delete — test luôn error case. Bookmark type, router, create/list/get/delete handlers — including error cases. Type Bookmark, router, handler create/list/get/delete — រួមទាំងករណី error។

  3. 3

    KV lưu bền Persistent KV storage ការផ្ទុក KV ជាប់

    Tạo namespace KV, đổi handler sang binding, kiểm tra data còn sau restart. Create a KV namespace, switch handlers to the binding, confirm data survives restart. បង្កើត namespace KV ប្តូរ handler ទៅ binding ពិនិត្យថា data នៅក្រោយ restart។

  4. 4

    D1 + cache KV D1 + KV cache D1 + cache KV

    Schema SQL, tag, filter; KV làm cache đọc — đo cache hit. SQL schema, tags, filters; KV as a read cache — check cache hits. Schema SQL, tag, filter; KV ជា cache អាន — ពិនិត្យ cache hit។

  5. 5

    Tóm tắt bằng Workers AI AI-powered summaries សង្ខេបដោយ Workers AI

    AI binding, cột summary trên D1, generate khi tạo bookmark. AI binding, a D1 summary column, generate on bookmark create. AI binding, ជួរឈរ summary លើ D1, generate ពេលបង្កើត bookmark។

  6. 6

    AI Gateway AI Gateway AI Gateway

    Đưa inference qua Gateway — cache, rate limit, xem analytics dashboard. Route inference through Gateway — cache, rate limit, read dashboard analytics. បញ្ជូន inference តាម Gateway — cache, rate limit, មើល analytics dashboard។

  7. 7

    Deploy production Deploy to production Deploy ទៅ production

    Tạo resource remote, wrangler deploy, wrangler tail, rollback khi cần. Create remote resources, wrangler deploy, wrangler tail, roll back if needed. បង្កើត resource remote, wrangler deploy, wrangler tail, rollback ពេលចាំបាច់។

Ghép với lộ trình hub Fits this hub path សមនឹងផ្លូវ hub នេះ

Sau Phần 1 (Worker + Wrangler) và Phần 3 (KV/D1). Lab AI + Gateway khớp Phần 5. After Part 1 (Worker + Wrangler) and Part 3 (KV/D1). The AI + Gateway labs match Part 5. បន្ទាប់ពីផ្នែក 1 (Worker + Wrangler) និងផ្នែក 3 (KV/D1)។ Lab AI + Gateway សមនឹងផ្នែក 5។

Mở 7 bài lab Open 7 lab articles បើក 7 អត្ថបទ lab
7 labs 7 labs 7 labs

Model Context Protocol Model Context Protocol Model Context Protocol

Ship MCP server + AI assistant Ship an MCP server + AI assistant Ship MCP server + AI assistant

Remote MCP trên Workers: tool có type, Zod, API ngoài và KV. Remote MCP on Workers: typed tools, Zod, external APIs, and KV. Remote MCP លើ Workers៖ tool មាន type, Zod, API ខាងក្រៅ និង KV។

  • Custom Tools
  • Zod
  • External APIs
  • KV
  1. 1

    Tạo MCP server và Inspector Create the MCP server and Inspector បង្កើត MCP server និង Inspector

    Scaffold server trên Workers, test kết nối bằng MCP Inspector. Scaffold the server on Workers, test the connection with MCP Inspector. Scaffold server លើ Workers test ការភ្ជាប់ដោយ MCP Inspector។

  2. 2

    Tool tùy chỉnh Custom tools Tool ផ្ទាល់ខ្លួន

    Thêm tool (random number) có schema — gọi và xem response typed. Add a typed tool (random number) — call it and inspect the typed response. បន្ថែម tool មាន type (លេខចៃដន្យ) — ហៅ និងមើល response typed។

  3. 3

    Tích hợp API ngoài External API integration ភ្ជាប់ API ខាងក្រៅ

    Gọi drand (hoặc API tương đương) từ tool — validate input bằng Zod. Call drand (or an equivalent API) from a tool — validate input with Zod. ហៅ drand (ឬ API សមមូល) ពី tool — validate input ដោយ Zod។

  4. 4

    Deploy lên Workers Deploy to Workers Deploy ទៅ Workers

    wrangler deploy, thử trên AI Playground. wrangler deploy, then try it in the AI Playground. wrangler deploy បន្ទាប់មកសាកលើ AI Playground។

  5. 5

    KV cho tool KV for tools KV សម្រាប់ tool

    Namespace KV + tool đọc/ghi — state không mất giữa session. KV namespace + read/write tools — state survives across sessions. Namespace KV + tool អាន/សរសេរ — state នៅរវាង session។

  6. 6

    Todo bền trên KV Persistent todo app កម្មវិធី todo ជាប់លើ KV

    Bộ tool todo (add/list/done) — deploy và kiểm tra persistence. Todo tools (add/list/done) — deploy and confirm persistence. ឈុត tool todo (add/list/done) — deploy និងពិនិត្យ persistence។

  7. 7

    Bạn đã là MCP builder You're an MCP Builder Now អ្នកជា MCP builder ហើយ

    Nhìn lại pattern MCP, gợi ý tool tiếp theo, dùng AI để ship server mới. Review the MCP pattern, pick a next tool, use AI to ship another server. មើល pattern MCP ជ្រើស tool បន្ទាប់ ប្រើ AI ដើម្បី ship server ថ្មី។

Ghép với lộ trình hub Fits this hub path សមនឹងផ្លូវ hub នេះ

Sau Phần 5 (tools/agent) và khi đã quen KV ở Phần 3. Luyện schema + authorization phía server. After Part 5 (tools/agents) and once KV from Part 3 is familiar. Practice schemas and server-side authorization. បន្ទាប់ពីផ្នែក 5 (tools/agent) និងពេលស្គាល់ KV ពីផ្នែក 3។ ហាត់ schema + authorization ខាង server។

Mở 7 bài lab Open 7 lab articles បើក 7 អត្ថបទ lab
2 labs 2 labs 2 labs

Agents SDK Agents SDK Agents SDK

Ship agent có state Ship a stateful agent Ship agent មាន state

Agent stateful: memory, schedule task, WebSocket realtime. A stateful agent: memory, scheduled tasks, and realtime WebSockets. Agent មាន state៖ memory, កំណត់ពេល task, WebSocket realtime។

  • Agents SDK
  • State
  • Scheduling
  • WebSockets
  1. 1

    Agent starter: tools và schedule Agent starter: tools and scheduling Agent starter៖ tools និងការកំណត់ពេល

    Tạo agent, xem tool có sẵn, đọc cách schedule task. Create an agent, inspect the bundled tools, read how tasks are scheduled. បង្កើត agent មើល tool ភ្ជាប់មក អានវិធីកំណត់ពេល task។

  2. 2

    Clone repo Agents và build Clone the Agents repo and build Clone repo Agents និង build

    Clone source, npm install, build — sẵn sàng sửa tool / memory. Clone the source, npm install, build — ready to change tools or memory. Clone source, npm install, build — រួចរាល់កែ tool / memory។

Ghép với lộ trình hub Fits this hub path សមនឹងផ្លូវ hub នេះ

Sau bài Agents ở Phần 5. Phần 6 (Durable Objects) giải thích state theo object phía sau SDK. After the Agents lesson in Part 5. Part 6 (Durable Objects) explains the per-object state behind the SDK. បន្ទាប់ពីមេរៀន Agents នៅផ្នែក 5។ ផ្នែក 6 (Durable Objects) ពន្យល់ state តាម object ខាងក្រោយ SDK។

Mở 2 bài lab Open 2 lab articles បើក 2 អត្ថបទ lab
7 labs 7 labs 7 labs

Sandbox SDK Sandbox SDK Sandbox SDK

Ship AI code executor an toàn Ship a secure AI code executor Ship AI code executor សុវត្ថិភាព

Chạy code trong container cô lập, preview live, gắn Workers AI — từ zero. Run code in isolated containers, live preview, Workers AI — from scratch. រត់ code ក្នុង container បំបែក preview ផ្ទាល់ ភ្ជាប់ Workers AI — ពីសូន្យ។

  • Secure Execution
  • AI Code Generation
  • Containers
  • Workers AI
  1. 1

    Project sandbox đầu tiên First sandbox project Project sandbox ដំបូង

    Scaffold, đọc cấu trúc, chạy local, exec lệnh đầu tiên. Scaffold, read the layout, run locally, exec the first command. Scaffold អានរចនាសម្ព័ន្ធ រត់ local exec ពាក្យបញ្ជាដំបូង។

  2. 2

    exec() và file exec() and files exec() និង file

    API exec(), thao tác file, endpoint tùy chỉnh, xử lý lỗi. The exec() API, file ops, a custom endpoint, and error handling. API exec() ប្រតិបត្តិការ file endpoint ផ្ទាល់ខ្លួន និងដោះស្រាយ error។

  3. 3

    Code executor Code executor Code executor

    Context chạy code, runCode(), nhận input động, bắt exception. A code context, runCode(), dynamic input, catch execution errors. Context រត់ code, runCode(), input ថាមវន្ត ចាប់ exception។

  4. 4

    Sinh code bằng Workers AI AI-powered code generation AI-powered code generation

    AI binding + endpoint /vibe — pipeline generate → execute. AI binding + /vibe endpoint — generate → execute pipeline. AI binding + endpoint /vibe — pipeline generate → execute។

  5. 5

    Live preview Live app preview Live app preview

    Cài deps, start server trong sandbox, expose port, stream log. Install deps, start a server in the sandbox, expose a port, stream logs. ដំឡើង deps start server ក្នុង sandbox expose port stream log។

  6. 6

    Bảo mật sandbox Sandbox security សុវត្ថិភាព sandbox

    Validate input, isolate theo user, env/secret, auth — sandbox không phải ACL. Validate input, per-user isolation, env/secrets, auth — a sandbox is not an ACL. Validate input បំបែកតាម user env/secret auth — sandbox មិនមែន ACL។

  7. 7

    Deploy và lifecycle Deploy and lifecycle Deploy និង lifecycle

    Deploy, cleanup sandbox, config production, monitor. Deploy, clean up sandboxes, production config, monitor. Deploy cleanup sandbox កំណត់ production monitor។

Ghép với lộ trình hub Fits this hub path សមនឹងផ្លូវ hub នេះ

Sau Phần 5 (AI) và Phần 4 (vận hành/secret). Lab bảo mật khớp golden rules: secret không lên client. After Part 5 (AI) and Part 4 (operate/secrets). The security labs match the golden rules: secrets stay off the client. បន្ទាប់ពីផ្នែក 5 (AI) និងផ្នែក 4 (ដំណើរការ/secret)។ Lab សុវត្ថិភាពសមនឹងច្បាប់៖ secret មិនឡើង client។

Mở 7 bài lab Open 7 lab articles បើក 7 អត្ថបទ lab