模块化、依赖注入、REST、校验与测试,TypeScript 后端框架,对接 nodejs / backend 路线图。
登录后追踪本课程进度 —登录
NestJS 是什么
与 Express/Spring Boot 对比、装饰器架构、适用场景。
项目创建与结构
Nest CLI、module/controller/service 目录、dev 启动。
Module 与依赖注入
@Module、providers、exports、与 Spring IoC 对照。
Controller 与路由
@Controller、@Get/@Post、参数装饰器、DTO。
Service 层
@Injectable、业务逻辑分离、单元测试友好。
Pipe 与校验
ValidationPipe、class-validator、转换与 whitelist。
Guard 与认证
@UseGuards、JWT 概念、与 Spring Security 对照。
ConfigModule
环境变量、.env、配置注入。
数据库接入入门
TypeORM 或 Prisma 选一、实体与 Repository 直觉。
异常与过滤器
HttpException、ExceptionFilter、统一错误 JSON。
测试
Jest、e2e supertest、mock Provider。
综合练习
Tracks REST API;与 Spring Boot / Express 选型总结。