# circle **Repository Path**: silence1224/circle ## Basic Information - **Project Name**: circle - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-07-25 - **Last Updated**: 2025-11-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

Nest Logo

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 [circleci-url]: https://circleci.com/gh/nestjs/nest

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Discord Backers on Open Collective Sponsors on Open Collective Donate us Support us Follow us on Twitter

## 项目简介 这是一个NestJS项目模板,包含以下开箱即用的功能: - ✅ 预配置的TypeScript开发环境 - ✅ 统一的代码风格规范(ESLint + Prettier) - ✅ 支持路径别名(@/) - ✅ 集成Swagger API文档 - ✅ 用户认证模块(JWT) - ✅ 数据库集成(TypeORM) - ✅ Docker支持 - ✅ 单元测试配置 ### 快速创建新项目 ```bash # 使用此模板创建新项目 npx degit your-repo/nestjs-template my-new-project # 进入项目目录 cd my-new-project # 安装依赖 pnpm install # 启动开发服务器 pnpm run start:dev ``` Cook API 2.0 是基于 NestJS 框架构建的食谱管理后端服务,提供完整的 CRUD 功能和 RESTful API 接口。 ## 功能特性 - ✅ 完整的食谱管理功能 - ✅ 分页查询支持 - ✅ 用户认证与授权 - ✅ 数据验证与错误处理 - ✅ 日志记录与监控 ## Project Structure ### API 文档 #### 食谱模块 (`/recipes`) - `GET /recipes`: 获取所有食谱(支持分页) - 参数: `skip` (跳过数量), `take` (返回数量) - `GET /recipes/:id`: 获取单个食谱详情 - `POST /recipes`: 创建新食谱 - `PUT /recipes/:id`: 更新食谱 - `DELETE /recipes/:id`: 删除食谱 #### 优化说明 - 代码结构优化:统一命名风格,重构冗余逻辑。 - 性能提升:支持分页查询,减少数据库操作。 - 错误处理增强:统一错误类型和日志记录。 - 测试覆盖率提升:补充单元测试和集成测试。 #### 使用示例 ```bash # 分页查询示例 curl -X GET "http://localhost:3000/recipes?skip=0&take=10" ``` ``` ├── src/ │ ├── modules/ # 业务模块 │ ├── shared/ # 共享模块 │ ├── config/ # 配置文件 │ └── main.ts # 应用入口 ├── test/ # 测试目录 ├── .env # 环境变量 └── README.md # 项目文档 ``` ## 开发指南 ### 路径别名(`@`转换) 1. **配置说明**: - 确保 `tsconfig.json` 中已配置路径别名,例如: ```json { "compilerOptions": { "baseUrl": "./src", "paths": { "@/*": ["./*"] } } } ``` - 安装依赖: ```bash npm install --save tsconfig-paths ``` 2. **运行命令**: - 开发环境(支持路径别名): ```bash ts-node -r tsconfig-paths/register src/main.ts ``` - 生产环境(支持路径别名): ```bash node --experimental-specifier-resolution=node -r tsconfig-paths/register dist/main ``` 1. 确保已安装 Node.js v18+ 2. 使用 `pnpm run lint` 检查代码规范 3. 使用 `pnpm run test` 运行单元测试 ## Project setup ```bash $ pnpm install ``` ## Compile and run the project ```bash # development $ pnpm run start # watch mode $ pnpm run start:dev # production mode $ pnpm run start:prod ``` ## Run tests ```bash # unit tests $ pnpm run test # e2e tests $ pnpm run test:e2e # test coverage $ pnpm run test:cov ``` ## 部署说明 ### Docker 部署 ```bash docker build -t cook-api . docker run -p 3000:3000 cook-api ``` ## Deployment When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information. If you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps: ```bash $ pnpm install -g @nestjs/mau $ mau deploy ``` With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure. ## Resources Check out a few resources that may come in handy when working with NestJS: - Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework. - For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy). - To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/). - Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks. - Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com). - Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com). - To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs). - Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com). ## Support Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). ## Stay in touch - Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec) - Website - [https://nestjs.com](https://nestjs.com/) - Twitter - [@nestframework](https://twitter.com/nestframework) ## License Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).