{"id":23124955,"url":"https://github.com/codegetters/nestjs-template","last_synced_at":"2026-04-30T10:32:26.751Z","repository":{"id":267447877,"uuid":"901276092","full_name":"CodeGetters/nestjs-template","owner":"CodeGetters","description":"nestjs start template","archived":false,"fork":false,"pushed_at":"2025-01-19T13:54:21.000Z","size":315,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T16:22:41.113Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://nestjs-template-inky.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodeGetters.png","metadata":{"files":{"readme":"README-EN.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-10T11:09:56.000Z","updated_at":"2025-01-22T00:58:26.000Z","dependencies_parsed_at":"2024-12-10T12:42:33.486Z","dependency_job_id":null,"html_url":"https://github.com/CodeGetters/nestjs-template","commit_stats":null,"previous_names":["codegetters/nestjs-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeGetters%2Fnestjs-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeGetters%2Fnestjs-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeGetters%2Fnestjs-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeGetters%2Fnestjs-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeGetters","download_url":"https://codeload.github.com/CodeGetters/nestjs-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247123107,"owners_count":20887261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-17T08:12:07.481Z","updated_at":"2026-04-30T10:32:21.711Z","avatar_url":"https://github.com/CodeGetters.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NestJS Template\n\n[中文](README.md) | [English](README-EN.md)\n\nA full-featured NestJS backend project template with common functionalities and best practices.\n\n## Features\n\n- 🚀 High-performance HTTP server based on Fastify\n- 📝 Integrated Swagger documentation (OpenAPI)\n- 🔒 Global exception handling and unified response format\n- 📊 Winston logging system (with daily rotation)\n- 💾 Prisma ORM integration\n- ⚡️ Request timeout handling\n- ✨ Unified response transformation\n- 🦢 support vercel one-click deployment\n\n## Project Structure\n\n```\nsrc/\n├── api/           # API modules directory\n│ ├── demo/        # Example module\n│ └── index.ts     # API route registration\n├── common/        # Common modules\n│ ├── logger/      # Logging module\n│ └── prisma/      # Prisma database module\n├── core/          # Core functionality\n│ ├── decorator/   # Custom decorators\n│ ├── filter/      # Exception filters\n│ ├── guard/       # Guards\n│ └── interceptor/ # Interceptors\n└── main.ts        # Application entry point\n```\n\n## Quick Start\n\n### Requirements\n\n- Node.js \u003e= 16\n- pnpm \u003e= 8\n\n### Install Dependencies\n\n```bash\npnpm install\n```\n\n### Configure Environment Variables\n\n```bash\ncp .env.example .env\n```\n\n### Database Connection\n\nUncomment the code at `src/common/prisma/prisma.service.ts:51` and set up the database connection\n\n### Start the Project\n\n```bash\n# dev\npnpm run start:dev\n\n# prod\npnpm run start:prod\n\n# build\npnpm run build\n```\n\n### Access Documentation\n\n```bash\nhttp://localhost:8080/docs\n```\n\n## One-Click Deploy\n\n\u003e When Vercel is deployed, an empty LoggerService will be introduced, because Vercel has its own log system, and using the original log system will cause the operation to fail.\n\nDeploy the template using [Vercel](https://vercel.com?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=vercel-examples):\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/CodeGetters/nestjs-template)\n\n## Main Features\n\n### Unified Response Format\n\nSuccess response format\n\n```json\n{\n  \"code\": \"SUCCESS\",\n  \"data\": {},\n  \"message\": \"Request successful\",\n  \"timestamp\": \"2024-01-01T00:00:00.000Z\"\n}\n```\n\nError response format\n\n```json\n{\n  \"code\": \"ERROR_CODE\",\n  \"message\": \"Error message\",\n  \"timestamp\": \"2024-01-01T00:00:00.000Z\",\n  \"path\": \"/api/xxx\"\n}\n```\n\n### Logging System\n\n- Automatic daily log file rotation\n- Separate error and combined logs\n- Console output in development environment\n- Log files stored in logs directory\n\n### Exception Handling\n\n- Global exception filter for all uncaught exceptions\n- HTTP exception filter for standard HTTP exceptions\n- Unified handling of Prisma database exceptions\n\n### Request Timeout Handling\n\nDefault 60-second timeout limit, configurable via TimeoutInterceptor\n\n## Development Guide\n\n### Adding New Modules\n\n1. Create a new module directory in `src/api`, e.g., `user`\n2. Define service in `src/api/user/user.service.ts`\n3. Define controller in `src/api/user/user.controller.ts`\n4. Define module in `src/api/user/user.module.ts`\n5. Register new module in `src/api/index.ts`\n\n### Using Custom Response Format\n\nUse `@SkipTransform()` decorator to skip unified response transformation:\n\n```typescript\n@Get()\n@SkipTransform()\ngetData() {\n  return { raw: 'data' };\n}\n```\n\n## Contributing\n\nIssues and Pull Requests are welcome\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodegetters%2Fnestjs-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodegetters%2Fnestjs-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodegetters%2Fnestjs-template/lists"}