nestjs-crud-pattern

仓库创建 2026年7月6日最近提交 22 天前SkillHot 收录 22 天前
▸ 精选理由

可显著加速新领域开发并保持一致性,适合有 NestJS 基础的团队。

这个 Skill 做什么

为 NestJS+Prisma 项目提供统一的 CRUD 模块结构与实现约定。

为 NestJS + Prisma 项目规定统一的 CRUD 模板:controller 只做 HTTP,service 承担业务,repository 抽象数据访问,配合验证过的 DTO 和多租户隔离等约定。新增模块、实体或路由时照此实现可保证一致性与可维护性。特点是强制项目同一形态,方便复用、测试和依赖反转。

▸ 展开 SKILL.md 英文原文

House pattern for building complete CRUD domains in NestJS with Prisma — controller/service/repository with dependency inversion, validated DTOs and multi-tenant isolation. Use whenever creating a new module, entity, CRUD route or domain in a NestJS backend, even if the request is just "create the X route" or "add the Y table".

开发编程NestJSCRUD 模式Prisma通用
2
Stars
0
Forks
6
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/JoaoEquer/Oficina/main/skills/nestjs-crud-pattern/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/JoaoEquer/Oficina/main/skills/nestjs-crud-pattern/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# NestJS CRUD — house pattern

Every CRUD domain follows exactly the same shape. The project's first module is the mold; the rest copy its form. Do not invent variations.

## Per-domain structure

```
src/modules/<domain>/
├── <domain>.controller.ts   # HTTP only: receives request, returns response. Zero business logic.
├── <domain>.service.ts      # Business logic. Depends on the repository ABSTRACTION, never on Prisma directly.
├── <domain>.repository.ts   # Abstract class (contract) + Prisma implementation in the same file.
├── dto/
│   ├── create-<domain>.dto.ts
│   └── update-<domain>.dto.ts
└── <domain>.module.ts       # Wiring: binds the contract to the implementation via provider tok
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有