{"id":24427393,"url":"https://github.com/backend-driven-admin/bdadmin-nestjs","last_synced_at":"2026-02-07T15:31:53.465Z","repository":{"id":272897575,"uuid":"914737218","full_name":"backend-driven-admin/bdadmin-nestjs","owner":"backend-driven-admin","description":"is a toolkit designed to simplify the creation of administrative dashboards. It provides a set of decorators and utilities for defining DTOs, entities, fields, authentication flows, and more, using metadata to efficiently create and manage complex admin interfaces.","archived":false,"fork":false,"pushed_at":"2025-01-17T13:02:49.000Z","size":111,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-30T15:43:01.092Z","etag":null,"topics":["admin","bdui","cli","config","decorators","generator","json","nestjs","reflect-metadata","restapi","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@bdadmin/nestjs","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/backend-driven-admin.png","metadata":{"files":{"readme":"README.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,"zenodo":null}},"created_at":"2025-01-10T07:51:31.000Z","updated_at":"2025-01-21T04:51:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"60e1f20b-e8ad-4c87-9ca5-741be57405bc","html_url":"https://github.com/backend-driven-admin/bdadmin-nestjs","commit_stats":null,"previous_names":["backend-driven-admin/bdadmin-nestjs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/backend-driven-admin/bdadmin-nestjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backend-driven-admin%2Fbdadmin-nestjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backend-driven-admin%2Fbdadmin-nestjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backend-driven-admin%2Fbdadmin-nestjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backend-driven-admin%2Fbdadmin-nestjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/backend-driven-admin","download_url":"https://codeload.github.com/backend-driven-admin/bdadmin-nestjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backend-driven-admin%2Fbdadmin-nestjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29198178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T14:35:27.868Z","status":"ssl_error","status_checked_at":"2026-02-07T14:25:51.081Z","response_time":63,"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":["admin","bdui","cli","config","decorators","generator","json","nestjs","reflect-metadata","restapi","typescript"],"created_at":"2025-01-20T12:10:29.713Z","updated_at":"2026-02-07T15:31:53.458Z","avatar_url":"https://github.com/backend-driven-admin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backend-driven Admin - NestJS Module\n\n**@bdadmin/nestjs** is a toolkit designed to simplify the creation of administrative dashboards. It provides a set of decorators and utilities for defining DTOs, entities, fields, authentication flows, and more, using metadata to efficiently create and manage complex admin interfaces.\n\n**Important**: This package is part of the @bdadmin ecosystem\n\n## Features\n\n- **Decorators**: Easily annotate classes and properties with metadata for DTOs, entities, validation rules, login/logout/refresh handlers, and more.\n- **Metadata Management**: Utilizes `reflect-metadata` to store and retrieve configuration data.\n- **Type Safety**: Built with TypeScript to ensure type safety and improved developer experience.\n- **CLI Support**: Includes a CLI tool for scaffolding and managing BDAdmin components within your NestJS project.\n- **Rollup Bundling**: Packaged and optimized using Rollup, with TypeScript declaration support for seamless integration.\n\n## Installation\n\nInstall the package via npm:\n\n```bash\nnpm install @bdadmin/nestjs\n```\n\n## Peer Dependencies\n\nMake sure to install and configure the following in your project:\n\n- reflect-metadata: Required for metadata reflection.\n- TypeScript: Ensure emitDecoratorMetadata and experimentalDecorators are enabled in your tsconfig.json.\n\n```json\n{\n  \"compilerOptions\": {\n    \"experimentalDecorators\": true,\n    \"emitDecoratorMetadata\": true,\n    // ...other options\n  }\n}\n```\n\n## Usage\n### Define the entities\n\n```ts\nimport { BDAdminEntity, BDAdminBehavior } from '@bdadmin/nestjs';\nimport { Get } from \"@nestjs/common\";\n\n@Controller(\"users\")\n@BDAdminEntity({ name: \"users\" })\nexport class UserController {\n    @Get()\n    @BDAdminBehavior({ \n        type: [UserController], \n        endpoint: { \n            url: \"/users\", \n            method: \"GET\"\n        } \n    })\n    findAll() { /* ... */ }\n\n    @Post(\"/create\")\n    @BDAdminBehavior({\n        type: UserCreateDto,\n        endpoint: {\n            url: \"/users/create\",\n            method: \"POST\"\n        }\n    })\n    create() { /* ... */ }\n    \n    // ...other methods\n}\n```\n\n### Configure fields \u0026 validation\n\n```ts\nimport { BDAdminField, BDAdminValidation } from '@bdadmin/nestjs';\n\nexport class UserEntity {\n    @BDAdminField({ type: 'string', sort: true, search: true })\n    name: string;\n  \n    @BDAdminField({ type: 'number', sort: true })\n    age: number;\n    \n    // ...other properties\n}\n\nexport class UserCreateDto {\n    @BDAdminValidation({\n        type: 'string',\n        unique: true,\n        required: true\n    })\n    name: string;\n\n    @BDAdminValidation({\n        type: 'number',\n        required: true,\n        min: 16,\n        max: 60\n    })\n    age: number;\n\n    // ...other properties\n}\n```\n\n### \n\n### Initialize authentication\n\n```ts\nimport { BDAdminAuth, BDAdminLogin, BDAdminRefresh, BDAdminLogout } from '@bdadmin/nestjs';\n\n@BDAdminAuth({\n    accessKey: \"access_token\",\n    refreshKey: \"refresh_token\"\n})\nexport class AuthController {\n    @Post(\"/login\")\n    @BDAdminLogin({\n        endpoint: {\n            url: \"/login\",\n            method: \"POST\"\n        },\n        type: LoginDto\n    })\n    signIn() { /* ... */ }\n\n    @Post(\"/refresh\")\n    @BDAdminRefresh({\n        endpoint: {\n            url: \"/refresh\",\n            method: \"POST\"\n        }\n    })\n    refresh() { /* ... */ }\n\n    @Post(\"/logout\")\n    @BDAdminLogout({\n        endpoint: {\n            url: \"/logout\",\n            method: \"POST\"\n        }\n    })\n    logOut() { /* ... */ }\n}\n```\n\n### Running CLI\nThe package includes a CLI for scaffolding and management tasks. After installing globally or locally, you can invoke the CLI:\n\n```bash\nnpx @bdadmin/nestjs [command] [options]\n```\n\nUse --help with the CLI to get a list of available commands and options:\n\n```bash\nnpx @bdadmin/nestjs --help\n```\n\n### Example\n#### Generate a REST route with a config\n```bash\nnpx @bdadmin/nestjs generate\n```\n\n#### Generate a local config\n```bash\nnpx @bdadmin/nestjs generate --local\n```\n\n#### Generate a REST route with a config and a custom name\n```bash\nnpx @bdadmin/nestjs generate --name config\n```\n\n## Building from Source\nIf you are interested in building or modifying the package:\n1. Clone the repository:\n```bash\ngit clone https://github.com/backend-driven-admin/bdadmin-nestjs\ncd bdadmin-nestjs\n```\n\n2. Install dependencies:\n```bash\nnpm install\n```\n\n3. Build the package:\n```bash\nnpm run build\n```\n\nThis will run Rollup to bundle the library, generate a CLI bundle, and create TypeScript declaration files.\n\n## Contributing\nContributions are welcome! Please open issues for any bugs or feature requests. Follow the repository guidelines for pull requests.\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](https://github.com/backend-driven-admin/bdadmin-nestjs/blob/main/LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackend-driven-admin%2Fbdadmin-nestjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbackend-driven-admin%2Fbdadmin-nestjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackend-driven-admin%2Fbdadmin-nestjs/lists"}