# nest-restful-fullstack-template **Repository Path**: jh_shot/nest-restful-fullstack-template ## Basic Information - **Project Name**: nest-restful-fullstack-template - **Description**: NestJS Restful 全栈模板 - **Primary Language**: TypeScript - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 13 - **Forks**: 4 - **Created**: 2023-07-12 - **Last Updated**: 2025-05-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: Nodejs, Nestjs, Vue ## README # Nest Restful Fullstack Template ## 简介 Nest Restful Fullstack Template 是一个参考若依实现的开源后台管理系统全栈模版。 ## 特性 - **技术栈**:使用 Nest/Vue3 等前端前沿技术开发 - **TypeScript**:应用程序级 JavaScript 的语言 ## 准备 - [Node](http://nodejs.org/) 和 [Git](https://git-scm.com/) - [Nest](https://docs.nestjs.com/) - [TypeORM](https://typeorm.io/) - [Vue3](https://cn.vuejs.org/guide/introduction.html) ## 安装使用 - 获取项目代码 ```bash git clone https://gitee.com/jh_shot/nest-restful-fullstack-template.git ``` - 安装依赖 ```bash pnpm i ``` - 部署 Docker 服务 ```bash docker-compose -p fullstack up ``` - 运行全部 ```bash # 选择 All -> dev pnpm scripts ``` - 只运行后端,可通过 swagger 验证代码逻辑 ```bash # 选择 Server -> dev pnpm scripts ``` - 打包全部 ```bash # 选择 All -> build pnpm scripts ``` ## 注意事项 - NestJS 执行顺序:中间件 -> 守卫 -> 拦截器/管道 -> 异常过滤器 - TypeOrm 查询 `select: false` 的列需要用 `createQueryBuilder` - TypeOrm 需要用 `save` 触发关联表操作,`insert` 只影响当前表 - TypeOrm 不要修改数据库表结构,Entity 只做了简单定义,`synchronize` 会报错 - 使用 `IntersectionType` 合并对象是需要逐步创建对象,否则会与其他匿名对象冲突 - DTO 结尾表示请求传输对象,VO 结尾表示响应传输对象 - 如果请求传输数据是对象的话,需要对每一项加上 `class-validator` 的装饰器 - NestJS 依赖注入的类型需要保留,所以不能用 `import type` 导入 ## 待开发 - [ ] 日志文件切割 ## 待处理 - [ ] 加载 esm 包 [issue](https://github.com/nestjs/nest/pull/8736)