跳到主要内容

介绍

Nest Boot 是一个用于构建 NestJS 应用程序的模块化框架。它提供了一系列可重用的模块,帮助你更快地构建健壮、可扩展的应用程序。

特性

  • 模块化架构 - 按需选择所需的模块
  • TypeScript 优先 - 使用 TypeScript 构建,提供类型安全和更好的开发体验
  • 生产就绪 - 经过生产环境验证的模块
  • 文档完善 - 提供全面的文档和示例

模块

Nest Boot 提供以下模块:

模块描述
@nest-boot/auth身份验证和授权
@nest-boot/bullmq使用 BullMQ 的作业队列管理
@nest-boot/crypt加密和解密工具
@nest-boot/graphqlGraphQL 集成
@nest-boot/graphql-connectionGraphQL 连接/分页
@nest-boot/hash密码哈希工具
@nest-boot/i18n国际化
@nest-boot/logger日志工具
@nest-boot/mailer邮件发送
@nest-boot/metrics应用指标
@nest-boot/middleware中间件管理
@nest-boot/mikro-ormMikroORM 集成
@nest-boot/redisRedis 客户端
@nest-boot/request-context请求上下文管理
@nest-boot/schedule任务调度
@nest-boot/validator验证工具
@nest-boot/view视图渲染

快速开始

安装所需的模块:

npm install @nest-boot/hash @nest-boot/crypt
# 或
pnpm add @nest-boot/hash @nest-boot/crypt

然后在你的 NestJS 应用程序中导入并注册它们:

import { Module } from "@nestjs/common";
import { HashModule } from "@nest-boot/hash";
import { CryptModule } from "@nest-boot/crypt";

@Module({
imports: [
HashModule.register(),
CryptModule.register({
secret: process.env.CRYPT_SECRET,
}),
],
})
export class AppModule {}

下一步

  • 浏览教程了解如何使用特定模块
  • 查看 API 参考获取详细文档