{"id":43082473,"url":"https://github.com/leanstacks/nestjs-starter","last_synced_at":"2026-01-31T15:02:36.732Z","repository":{"id":313624924,"uuid":"1052052284","full_name":"leanstacks/nestjs-starter","owner":"leanstacks","description":"A starter kit for NestJS TypeScript components.","archived":false,"fork":false,"pushed_at":"2026-01-25T12:59:06.000Z","size":591,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-26T01:35:48.276Z","etag":null,"topics":["nestjs","typescript"],"latest_commit_sha":null,"homepage":"https://www.leanstacks.com","language":"TypeScript","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/leanstacks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-07T09:55:49.000Z","updated_at":"2026-01-25T12:59:08.000Z","dependencies_parsed_at":"2025-09-07T12:25:31.806Z","dependency_job_id":"22d933ef-77db-4b99-a9ae-ee386c671c5d","html_url":"https://github.com/leanstacks/nestjs-starter","commit_stats":null,"previous_names":["mwarman/nestjs-playground","leanstacks/nestjs-starter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leanstacks/nestjs-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanstacks%2Fnestjs-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanstacks%2Fnestjs-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanstacks%2Fnestjs-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanstacks%2Fnestjs-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leanstacks","download_url":"https://codeload.github.com/leanstacks/nestjs-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leanstacks%2Fnestjs-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28946070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T14:26:55.697Z","status":"ssl_error","status_checked_at":"2026-01-31T14:26:52.545Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["nestjs","typescript"],"created_at":"2026-01-31T15:02:35.294Z","updated_at":"2026-01-31T15:02:36.726Z","avatar_url":"https://github.com/leanstacks.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NestJS Starter\n\n[![Continuous Integration](https://github.com/leanstacks/nestjs-starter/actions/workflows/ci.yml/badge.svg)](https://github.com/leanstacks/nestjs-starter/actions/workflows/ci.yml)\n\u0026nbsp;\n\u0026nbsp;\n[![Code Quality](https://github.com/leanstacks/nestjs-starter/actions/workflows/code-quality.yml/badge.svg)](https://github.com/leanstacks/nestjs-starter/actions/workflows/code-quality.yml)\n\n## Overview\n\nThis is a starter kit for creating new NestJS application components. It provides efficient and scalable server-side applications using the [NestJS](https://nestjs.com/) framework and TypeScript with a well-structured foundation for rapid development.\n\n## Features\n\nThis starter project implements production-ready NestJS patterns and features. Use them as-is, extend them, or remove them based on your specific requirements.\n\n### Core Application Features\n\n- **Modular Architecture** - Feature-based module organization (Tasks, Users, Auth, Reference Data, Health)\n- **RESTful API Endpoints** - Fully functional CRUD operations with validation\n- **API Versioning** - URI-based versioning supporting multiple API versions\n- **Request Validation** - Automatic validation using `class-validator` and DTOs\n- **Pagination** - Built-in pagination support for list endpoints\n- **Caching** - In-memory caching with configurable TTL for improved performance\n- **Scheduled Tasks** - Cron-based task scheduling for background operations\n\n### Database \u0026 Persistence\n\n- **TypeORM Integration** - PostgreSQL database with TypeORM for entity management\n- **Database Migrations** - Version-controlled schema changes and data seeding\n- **Read Replicas** - Support for read-only database connections to reduce load\n- **Entity Relationships** - Demonstrates foreign key relationships and data associations\n- **Connection Pooling** - Optimized database connection management\n\n### Authentication \u0026 Security\n\n- **JWT Authentication** - Token-based authentication using JSON Web Tokens\n- **Passport Integration** - Strategy-based authentication with Passport.js (JWT and Local strategies)\n- **Global Auth Guard** - Default protection for all endpoints with opt-out using `@Public()` decorator\n- **Password Hashing** - Secure password storage using bcrypt\n- **User Management** - Complete user registration and profile management\n- **Custom Decorators** - `@AuthUser()` decorator for accessing authenticated user context\n- **Security Middleware** - Helmet for HTTP header security\n- **CORS Configuration** - Cross-origin resource sharing with configurable origins\n\n### Logging \u0026 Monitoring\n\n- **Structured Logging** - Production-ready JSON logging with Pino\n- **Formatted Development Logs** - Pretty-printed logs for local development\n- **Configurable Log Levels** - Environment-specific logging verbosity\n- **SQL Query Logging** - Optional TypeORM query logging for debugging\n- **Custom TypeORM Logger** - Integration between TypeORM and Pino logging\n\n### Health Checks \u0026 Monitoring\n\n- **Health Check Endpoints** - Built-in health monitoring using `@nestjs/terminus`\n- **Database Health Checks** - Validates database connectivity\n- **Version Information** - Application version tracking and reporting\n- **Custom Health Indicators** - Extensible health check framework\n\n### API Documentation\n\n- **Swagger/OpenAPI** - Automatic API documentation generation\n- **Interactive API Explorer** - Swagger UI for testing endpoints\n- **Schema Documentation** - Comprehensive DTO and entity documentation\n- **Authentication in Swagger** - Bearer token support in API docs\n\n### Configuration Management\n\n- **Environment Variables** - Centralized configuration using `@nestjs/config`\n- **Type-Safe Config** - TypeScript interfaces for configuration validation\n- **Schema Validation** - Environment variable validation on startup\n- **Multiple Environments** - Support for development, quality, staging, and production configurations\n\n### DevOps \u0026 Infrastructure\n\n- **Docker Support** - Multi-stage Dockerfile for optimized container images\n- **Docker Compose** - Local development setup with PostgreSQL and pgAdmin\n- **AWS CDK Infrastructure** - Complete infrastructure as code using TypeScript\n  - Aurora Serverless v2 PostgreSQL database\n  - ECS Fargate compute with autoscaling\n  - Application Load Balancer with health checks\n  - ECR for container image storage\n  - Route 53 DNS and SSL certificates\n  - Scheduled task infrastructure for cron jobs\n- **GitHub Actions** - CI/CD pipelines for testing, building, and deployment\n- **Comprehensive Documentation** - Detailed guides for configuration, infrastructure, and Docker\n\n### Code Quality \u0026 Testing\n\n- **Unit Tests** - Comprehensive test coverage using Jest\n- **End-to-End Tests** - Integration tests for API endpoints\n- **Pre-commit Hooks** - Husky for automated linting and formatting\n- **ESLint** - Code quality enforcement with NestJS-specific rules\n- **Prettier** - Consistent code formatting\n- **Coverage Reports** - Test coverage tracking and reporting\n\n## Getting Started\n\n1. **Install dependencies:**\n\n```bash\nnpm install\n```\n\n2. **Configure environment variables:**\n\n- Copy `.env.example` to `.env` and adjust values as needed.\n- See the [Configuration Guide](docs/configuration-guide.md) for details.\n\n3. **Run the application:**\n\n```bash\nnpm run start\n```\n\n## Available Scripts\n\n| Script                | Description                                  |\n| --------------------- | -------------------------------------------- |\n| npm run build         | Compile the TypeScript source code           |\n| npm run clean         | Remove build output and temporary files      |\n| npm run lint          | Run ESLint to check code quality             |\n| npm run lint:fix      | Fix code quality issues with ESLint          |\n| npm run format        | Format code using Prettier                   |\n| npm run format:check  | Check code formatting without changing files |\n| npm run start         | Start the application (development)          |\n| npm run start:dev     | Start in watch mode                          |\n| npm run start:prod    | Start in production mode                     |\n| npm run test          | Run unit tests                               |\n| npm run test:e2e      | Run end-to-end tests                         |\n| npm run test:coverage | Run test coverage                            |\n\n## Project Structure\n\n```\n├── .github/                             # GitHub workflows and configuration\n|\n├── docs/                                # Project documentation\n|  ├── configuration-guide.md            # Configuration guide\n|  └── devops-guide.md                   # DevOps guide\n|\n├── infrastructure/                      # AWS CDK Infrastructure as Code\n│   ├── stacks/                          # AWS CDK stacks\n|   └── app.ts                           # AWS CDK application\n|\n├── src/                                 # Main application source code\n│   ├── app.module.ts                    # App module\n│   ├── main.ts                          # Application entry point\n│   ├── modules/\n│   │   └── tasks/                       # Example feature module\n│   │       ├── tasks.module.ts          # Tasks module definition\n│   │       ├── tasks.controller.ts      # Tasks controller\n│   │       ├── tasks.controller.spec.ts # Tasks controller unit tests\n│   │       ├── tasks.service.ts         # Tasks service\n│   │       ├── tasks.service.spec.ts    # Tasks service unit tests\n│   │       ├── dto/                     # DTOs for tasks\n│   │       └── entities/                # Entities for tasks\n│   └── config/                          # Configuration-related code\n│       └── configuration.ts             # Configuration loader\n├── test/                                # End-to-end tests\n│   ├── tasks.e2e-spec.ts                # E2E test spec\n│   └── jest-e2e.json                    # Jest E2E config\n|\n├── .env.example                         # Example environment variables\n├── package.json                         # Project metadata and scripts\n├── tsconfig.json                        # TypeScript configuration\n├── nest-cli.json                        # NestJS CLI configuration\n└── README.md                            # Project documentation\n```\n\n## Documentation Hub\n\nFor all guides and references—including configuration, Docker, DevOps, and API documentation—see the [Documentation Table of Contents](docs/README.md).\n\n## Additional Information\n\nFor more information, see the [NestJS Documentation](https://docs.nestjs.com/).\n\n## License\n\nThis project is licensed under the MIT License - see [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanstacks%2Fnestjs-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleanstacks%2Fnestjs-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleanstacks%2Fnestjs-starter/lists"}