Chuyển đến nội dung
Skillpedia
Lập trình chung8.1k · #12600

webiny-full-stack-architect

Skill này làm gì

Skill này cung cấp cấu trúc cho một package extension duy nhất gồm cả code backend lẫn code admin. Skill dành cho lập trình viên xây các tính năng cần cả hai phía của dự án Webiny.

Khi nào nên dùng

  • ✓Khi một tính năng cần cả logic backend lẫn màn hình admin trong cùng một package.
  • ✓Khi bạn thiết lập extension cấp cao nhất để đăng ký cả phần API lẫn phần admin.
  • ✓Khi bạn muốn code domain dùng chung cho cả lớp API và lớp admin.

Liên kết skill

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/full-stack-architect/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/webiny/webiny-js/blob/next/skills/user-skills/full-stack-architect/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo một extension Webiny full-stack cho đánh giá sản phẩm, gồm phần backend và màn hình admin.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill giải thích một thành phần cấp cao nhất đăng ký một điểm vào API và một điểm vào admin, cả hai đều dựa trên một lớp domain dùng chung. Chi tiết cho từng phía nằm trong các skill kiến trúc API và admin riêng.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Full-Stack Extension Skeleton

TL;DR

A full-stack extension bundles API and Admin into a single package with a shared domain layer. The top-level component registers both sides via <Api.Extension> and <Admin.Extension>, which point to separate entry-point files. Each side follows its own layered architecture pattern — see webiny-api-architect and webiny-admin-architect skills for details.

Working Context

This skill applies to both extension developers (working in extensions/) and core developers (working in packages/). The architecture patterns are the same — only the import convention and registration mechanism differ.

Extensions (extensions/) Core (packages/)
Imports webiny/api, webiny/admin, webiny/admin/ui @webiny/feature/api, @webiny/app-admin, @webiny/admin-ui
Catalog paths Use the Import: path Use the Source: path
Registration <Api.Extension src={...}> / <Admin.Extension src={...}> in webiny.config.tsx createFeature registered directly by the package's module initializer
Entry point export Files targeted by Extension src MUST use export default No restriction — features are registered programmatically
Top-level component Required — composes <Api.Extension> + <Admin.Extension> Not applicable — each package registers its own features

Detect which context you're in by checking the file path: extensions/ → extension mode, packages/ → core mode.

RULE — Extension Entry Points

Admin extensions CANNOT be directly mounted in webiny.config.tsx or in any child component tree without going through <Admin.Extension />.

The same rule applies to API extensions — they must go through <Api.Extension />.

These entry-point components are the only way to register code that runs inside the Admin app or the API runtime. They use the src prop to point to a file that will be loaded in the correct execution environment (browser for Admin, Lambda for API). Bypassing these entry points will fail at runtime because the Admin and API contexts (DI containers, routers, GraphQL registries, etc.) are not available outside their respective runtimes.

YOU MUST include the full file path with the .ts or .tsx extension in every src prop. For example, use src={"/extensions/lead/src/index.ts"}, NOT src={"/extensions/lead"}. Omitting the file extension will cause a build failure.

YOU MUST use export default for the createImplementation() call when the file is targeted directly by an Extension src prop. Using a named export (export const Foo = SomeFactory.createImplementation(...)) will cause a build failure. Named exports are only valid inside files registered via createFeature.

// CORRECT — always use entry-point components
<Api.Extension src={import.meta.dirname + "/api/Extension.js"} />
<Admin.Extension src={import.meta.dirname + "/admin/Extension.js"} />

// WRONG — never mount admin/api code directly
<MyAdminComponent />     // Will not have access to Admin DI container
<MyApiFeature />         // Will not have access to API DI container

Package Structure

my-extension/
├── src/
│   ├── index.ts                  # Single public export
│   ├── MyExtension.tsx           # Top-level component (registers Api + Admin)
│   ├── shared/                   # Shared between API and Admin
│   │   ├── constants.ts          # Model IDs, permission names, etc.
│   │   └── types.ts              # Shared types
│   ├── api/                      # API-side code → see webiny-api-architect skill
│   │   ├── Extension.ts
│   │   ├── domain/
│   │   ├── features/
│   │   └── graphql/
│   └── admin/                    # Admin-side code → see webiny-admin-architect skill
│       ├── Extension.tsx
│       ├── features/
│       └── presentation/

Top-Level Component

The top-lev

Câu hỏi thường gặp

Hai điểm vào là gì?

Một cho API và một cho ứng dụng admin, cả hai đều được đăng ký trong thành phần cấp cao nhất.

Quy tắc dùng chung đặt ở đâu?

Trong lớp domain dùng chung mà cả hai phía đều dùng.

Skill có giải thích code chi tiết của từng phía không?

Skill tham chiếu đến các skill kiến trúc API và admin riêng để xem chi tiết.

Chi tiết

Mô tả gốc của tác giả

Full-stack extension skeleton and registration pattern. Use this skill when creating an extension that spans both API and Admin — the top-level component with Api.Extension and Admin.Extension entry points, shared domain layer, BuildParam declarations, and package structure. References webiny-api-architect and webiny-admin-architect for layer-specific details.

repo: webiny/webiny-js

Độ phổ biến

Sao GitHub
8.1k
Vị trí xếp hạng
#12600
Giấy phép
—
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự