{"id":39850557,"url":"https://github.com/zahidrahimoon/nest-boiler","last_synced_at":"2026-01-18T13:41:55.604Z","repository":{"id":328495839,"uuid":"1114719657","full_name":"zahidrahimoon/nest-boiler","owner":"zahidrahimoon","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-13T15:27:44.000Z","size":141,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-15T06:23:32.379Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zahidrahimoon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-12-11T19:34:50.000Z","updated_at":"2025-12-13T15:27:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zahidrahimoon/nest-boiler","commit_stats":null,"previous_names":["zahidrahimoon/nest-boiler"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/zahidrahimoon/nest-boiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahidrahimoon%2Fnest-boiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahidrahimoon%2Fnest-boiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahidrahimoon%2Fnest-boiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahidrahimoon%2Fnest-boiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zahidrahimoon","download_url":"https://codeload.github.com/zahidrahimoon/nest-boiler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahidrahimoon%2Fnest-boiler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28536773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T13:04:05.990Z","status":"ssl_error","status_checked_at":"2026-01-18T13:01:44.092Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2026-01-18T13:41:54.879Z","updated_at":"2026-01-18T13:41:55.589Z","avatar_url":"https://github.com/zahidrahimoon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NestJS Enterprise Boilerplate\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://nestjs.com/\" target=\"blank\"\u003e\u003cimg src=\"https://nestjs.com/img/logo-small.svg\" width=\"120\" alt=\"Nest Logo\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eA production-ready NestJS boilerplate with enterprise-level architecture, following best practices for scalable and maintainable applications.\u003c/p\u003e\n\n\n## 🌟 Features\n\n- ✅ **Enterprise Architecture** - Scalable folder structure with clear separation of concerns\n- ✅ **Authentication \u0026 Authorization** - JWT-based auth with guards and decorators\n- ✅ **Database Integration** - TypeORM with PostgreSQL\n- ✅ **API Documentation** - Swagger/OpenAPI integration\n- ✅ **Security** - Password hashing with bcrypt, global auth guard\n- ✅ **Validation** - Class-validator for DTO validation\n- ✅ **Modular Design** - Domain-driven structure ready for expansion\n- ✅ **Helper Utilities** - Response and exception helpers\n- ✅ **TypeScript** - Full type safety\n\n## 📁 Project Structure\n\n```\nsrc/\n├── common/                          # Shared utilities across modules\n│   ├── constants/                   # Global constants\n│   ├── decorators/                  # Custom decorators\n│   │   ├── current-user.decorator.ts\n│   │   └── public.decorator.ts\n│   ├── guards/                      # Authentication guards\n│   │   └── auth.guard.ts\n│   ├── helpers/                     # Helper utilities\n│   │   ├── exceptions/              # Exception helpers\n│   │   └── responses/               # Response formatters\n│   ├── interfaces/                  # Shared interfaces\n│   ├── pipes/                       # Custom pipes\n│   └── serializers/                 # Data serializers\n├── config/                          # Configuration modules\n│   ├── app/                         # App configuration\n│   ├── database/                    # Database configuration\n│   │   └── postgres/\n│   │       └── postgres.module.ts\n│   └── swagger/                     # Swagger configuration\n│       └── swagger.config.ts\n├── models/                          # Domain models\n│   └── users/                       # User domain\n│       ├── constants/               # User-specific constants\n│       ├── dto/                     # Data transfer objects\n│       ├── entities/                # TypeORM entities\n│       ├── interfaces/              # User interfaces\n│       ├── serializers/             # User serializers\n│       ├── users.controller.ts\n│       ├── users.service.ts\n│       ├── users.module.ts\n│       └── users.providers.ts\n├── authentication/                  # Authentication module\n│   ├── constants/                   # Auth constants\n│   ├── dto/                         # Auth DTOs\n│   ├── authentication.controller.ts\n│   ├── authentication.service.ts\n│   └── authentication.module.ts\n├── providers/                       # External service providers\n│   └── database/                    # Database providers\n│       └── postgres/\n│           └── postgres.provider.ts\n├── app.controller.ts\n├── app.module.ts\n├── app.service.ts\n└── main.ts\n```\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Node.js (v18 or higher)\n- PostgreSQL (v14 or higher)\n- npm or yarn\n\n### Installation\n\n1. **Clone the repository**\n```bash\ngit clone git@github.com:zahidrahimoon/nest-boiler.git\ncd nest-boiler\n```\n\n2. **Install dependencies**\n```bash\nnpm install\n```\n\n3. **Environment Setup**\n\nCreate a `.env` file in the root directory:\n\n```env\n# Application\nPORT=3000\n\n# Database\nDB_HOST=localhost\nDB_PORT=5432\nDB_USERNAME=postgres\nDB_PASSWORD=your_password\nDB_NAME=nestjs_lms\n\n# JWT\nJWT_SECRET=your_super_secret_jwt_key\n```\n\n4. **Run the application**\n\n```bash\n# Development mode with hot-reload\nnpm run start:dev\n\n# Production mode\nnpm run start:prod\n\n# Debug mode\nnpm run start:debug\n```\n\nThe application will be available at `http://localhost:3000`\n\n## 📚 API Documentation\n\nSwagger documentation is available at: `http://localhost:3000/documentation`\n\n### Available Endpoints\n\n#### Authentication\n- `POST /auth/signup` - Register a new user\n- `POST /auth/login` - Login with email and password\n\n#### User\n- `GET /user/profile` - Get authenticated user profile (requires JWT token)\n\n## 🔐 Authentication\n\nThis boilerplate uses JWT-based authentication with the following flow:\n\n1. **Public Routes** - Use `@Public()` decorator to bypass authentication\n2. **Protected Routes** - All routes are protected by default via global `AuthGuard`\n3. **Current User** - Use `@CurrentUser()` decorator to access authenticated user data\n\n### Decorators\n\n- `@Public()` - Mark routes as public (no authentication required)\n- `@CurrentUser()` - Access authenticated user data in route handlers\n\n## 🗄️ Database\n\n### TypeORM Configuration\n\nThe application uses TypeORM with PostgreSQL. Entity registration is done in:\n`src/providers/database/postgres/postgres.provider.ts`\n\n### Adding New Entities\n\n1. Create entity in `src/models/{domain}/entities/`\n2. Register entity in `src/providers/database/postgres/postgres.provider.ts`\n\n## 🧩 Adding New Features\n\n### Creating a New Model\n\nFollow the domain-driven structure:\n\n```bash\nsrc/models/courses/\n├── constants/\n├── dto/\n│   ├── create-course.dto.ts\n│   ├── update-course.dto.ts\n│   └── course-response.dto.ts\n├── entities/\n│   └── course.entity.ts\n├── serializers/\n│   └── course.serializer.ts\n├── courses.controller.ts\n├── courses.service.ts\n├── courses.module.ts\n└── courses.providers.ts\n```\n\n## 🛠️ Helper Utilities\n\n### Response Helper\n- `ResponseHelper.success()` - Standardized success responses\n- `ResponseHelper.paginated()` - Paginated data responses\n- `ResponseHelper.error()` - Error responses\n\n### Exception Helper\n- `ExceptionHelper.notFound()` - 404 Not Found\n- `ExceptionHelper.badRequest()` - 400 Bad Request\n- `ExceptionHelper.unauthorized()` - 401 Unauthorized\n- `ExceptionHelper.conflict()` - 409 Conflict\n\n## 🧪 Testing\n\n```bash\n# Unit tests\nnpm run test\n\n# E2E tests\nnpm run test:e2e\n\n# Test coverage\nnpm run test:cov\n```\n\n## 📦 Build\n\n```bash\n# Build for production\nnpm run build\n\n# Run production build\nnpm run start:prod\n```\n\n## 🏗️ Architecture Principles\n\n### Separation of Concerns\n- **Common**: Shared utilities and cross-cutting concerns\n- **Config**: Application configuration\n- **Models**: Domain-specific business logic\n- **Providers**: External service integrations\n\n### Scalability\n- Modular design allows independent development\n- Clear patterns for adding new features\n- Domain-driven structure\n\n### Maintainability\n- Predictable file locations\n- Consistent naming conventions\n- Clear module boundaries\n\n## 🔧 Configuration\n\n### Swagger Configuration\nCustomize API documentation in `src/config/swagger/swagger.config.ts`\n\n### Database Configuration\nModify database settings in `src/providers/database/postgres/postgres.provider.ts`\n\n## 📝 Code Style\n\nThis project follows NestJS best practices and conventions:\n- Use DTOs for data validation\n- Implement serializers for response transformation\n- Use guards for authorization\n- Use decorators for metadata\n- Follow domain-driven design\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n\n## 🙏 Acknowledgments\n\n- [NestJS](https://nestjs.com/) - The progressive Node.js framework\n- [TypeORM](https://typeorm.io/) - ORM for TypeScript\n- [Swagger](https://swagger.io/) - API documentation\n\n## 📞 Support\n\nFor questions and support:\n- Visit [NestJS Documentation](https://docs.nestjs.com)\n- Join [NestJS Discord](https://discord.gg/G7Qnnhy)\n\n## 👨‍💻 Author\n\n**Muhammad Zahid Ali Rahimoon**\n\n## 🔗 Repository\n\n[GitHub Repository](https://github.com/zahidrahimoon/nest-boiler)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzahidrahimoon%2Fnest-boiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzahidrahimoon%2Fnest-boiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzahidrahimoon%2Fnest-boiler/lists"}