{"id":14721809,"url":"https://github.com/eicrud/eicrud","last_synced_at":"2025-05-14T15:10:45.079Z","repository":{"id":243904336,"uuid":"783240306","full_name":"eicrud/eicrud","owner":"eicrud","description":"An opinionated backend framework based on NestJS. Get your CRUD app up and running in no time! ⚙️🔒","archived":false,"fork":false,"pushed_at":"2025-03-25T12:32:46.000Z","size":2614,"stargazers_count":797,"open_issues_count":4,"forks_count":27,"subscribers_count":7,"default_branch":"develop","last_synced_at":"2025-05-12T02:46:29.012Z","etag":null,"topics":["authentication","authorization","backend","casl","crud","crud-application","framework","javascript","microservices","mikro-orm","nest","nestjs","nodejs","nodejs-framework","typescript"],"latest_commit_sha":null,"homepage":"https://eicrud.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/eicrud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["acrosett"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2024-04-07T10:34:51.000Z","updated_at":"2025-05-06T03:26:11.000Z","dependencies_parsed_at":"2024-08-28T13:33:23.552Z","dependency_job_id":"9bde7d45-9e39-4db0-9240-96c676b1c794","html_url":"https://github.com/eicrud/eicrud","commit_stats":{"total_commits":396,"total_committers":1,"mean_commits":396.0,"dds":0.0,"last_synced_commit":"eb3bf372448edda084d9ba68e49eacb5c1f8158a"},"previous_names":["eicrud/eicrud"],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eicrud%2Feicrud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eicrud%2Feicrud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eicrud%2Feicrud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eicrud%2Feicrud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eicrud","download_url":"https://codeload.github.com/eicrud/eicrud/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254170055,"owners_count":22026219,"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":["authentication","authorization","backend","casl","crud","crud-application","framework","javascript","microservices","mikro-orm","nest","nestjs","nodejs","nodejs-framework","typescript"],"created_at":"2024-09-14T05:01:45.248Z","updated_at":"2025-05-14T15:10:45.036Z","avatar_url":"https://github.com/eicrud.png","language":"TypeScript","funding_links":["https://github.com/sponsors/acrosett"],"categories":["TypeScript","Projects using NestJS"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://eicrud.com\" target=\"_blank\"\u003e\u003cimg width=\"200\" src=\"https://raw.githubusercontent.com/eicrud/eicrud/develop/docs/planet.svg\" alt=\"@eicrud/eicrud logo\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://docs.eicrud.com\" target=\"_blank\"\u003e\u003cimg alt=\"Static Badge\" src=\"https://img.shields.io/badge/Documentation-purple\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://npmjs.com/package/@eicrud/core\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/%40eicrud%2Fcore?color=%232AAA8A%09\" alt=\"npm package\"\u003e\u003c/a\u003e\n  \u003c!-- \u003ca href=\"https://npmjs.com/package/@eicrud/core\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/dw/%40eicrud%2Fcore.svg\" alt=\"downloads\"\u003e\u003c/a\u003e --\u003e\n  \u003c!--\u003ca href=\"https://npmjs.com/package/@eicrud/core\" target=\"_blank\"\u003e\u003cimg alt=\"NPM Unpacked Size\" src=\"https://img.shields.io/npm/unpacked-size/%40eicrud%2Fcore\"\u003e\u003c/a\u003e--\u003e\n  \u003ca href=\"https://discord.gg/VaGPqE7bn9\" target=\"_blank\"\u003e\u003cimg alt=\"Static Badge\" src=\"https://img.shields.io/badge/Discord-%235865F2\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://x.com/eicrud\" target=\"_blank\"\u003e\u003cimg alt=\"X (formerly Twitter) Follow\" src=\"https://img.shields.io/twitter/follow/eicrud\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cb\u003eEicrud\u003c/b\u003e is an opinionated backend framework extending \u003ca href=\"https://github.com/nestjs/nest\" target=\"_blank\"\u003eNestJS\u003c/a\u003e.\u003cbr/\u003e It's a tool for building scalable, secure \u003ca href=\"https://nodejs.org\" target=\"_blank\"\u003eNode.js\u003c/a\u003e server applications in record time.\u003c/p\u003e\n\n\u003e [!IMPORTANT]\n\u003e *Eicrud is still in beta; expect minor breaking changes with new versions until **v1.0.0**. However, you can still use it as it is, and the API will not change much. Check out the [release notes](https://github.com/eicrud/eicrud/releases) for migration guides. If you're interested in the project, please leave a star on the repository; it helps a lot 🌟🙏*\n\n## Philosophy\n\nMost of the time, a web app has some CRUD functionality as its base. Eicrud abstracts this into a simple and easy-to-use API, so you don't have to re-write boilerplate code (controllers, validations, db queries...) whenever you need a new service. By centering everything around CRUD entities, Eicrud provides a framework for writing complex applications that are easy to read, test, and maintain. Eicrud also emphasizes \"default security\" for its components, where everything is forbidden until allowed.\n\n## Features\n\n- ⚙️ Out of the box [CRUD services](https://docs.eicrud.com/services/definition)\n\n- 🔑 [Authentication \u0026 user management](https://docs.eicrud.com/user/service/)\n\n- 🔒 [Authorization](https://docs.eicrud.com/security/definition/)\n\n- 🖥️ [Commands](https://docs.eicrud.com/services/commands/)\n\n- ✔️ [Validation/Transform](https://docs.eicrud.com/validation/definition/)\n\n- 🗃️ [Database control](https://docs.eicrud.com/configuration/limits)\n\n- 🚀 Easy to use (RPC) [client](https://docs.eicrud.com/client/setup)\n\n- 🌐 [Monolithic/Microservices](https://docs.eicrud.com/microservices/configuration/)\n\n- And more!\n\n## How it works\n\nUnder the hood, **Eicrud** uses [MikroOrm](https://mikro-orm.io/) entities guarded with [CASL](https://casl.js.org) and [class-validator](https://github.com/typestack/class-validator).\n\n### Here's a quick example \nYou first define your entity with validations and transforms (what the data can be).\n\n```typescript\n@Entity()\nexport class Profile {\n  @PrimaryKey()\n  @IsString()\n  @IsOptional()\n  id: string;\n\n  @OneToOne(() =\u003e MyUser, (user) =\u003e user.profile)\n  @IsString()\n  owner: MyUser | string;\n\n  @Property()\n  @$Transform((val) =\u003e val.toLowerCase())\n  @MaxLength(30)\n  userName: string;\n}\n```\n\nThen define your security (who can access the data).\n\n```typescript\nconst security: CrudSecurity = {\n  user: {\n    async defineCRUDAbility(can, cannot, ctx) {\n      const id = ctx.userId;\n      // users can crud their own profile\n      can('crud', 'profile', { owner: id });\n    },\n  },\n  guest: {\n    async defineCRUDAbility(can, cannot, ctx) {\n      // guests can read all profiles\n      can('read', 'profile');\n    },\n  },\n};\n```\n\nAnd finally, register your service.\n\n```typescript\n@Injectable()\nexport class ProfileService extends CrudService\u003cProfile\u003e {\n  constructor(protected moduleRef: ModuleRef) {\n    super(moduleRef, Profile, security);\n  }\n}\n```\n\n**That's it**, `profile` is now a fully operational CRUD service that you can query with the [client](https://docs.eicrud.com/client/setup/).\n\n```typescript\nconst client = new CrudClient({ serviceName: 'profile' });\n\nconst res = await client.findOne({ userName: 'jon doe' });\n```\n\nYou can extend it using [commands](https://docs.eicrud.com/services/commands/) (for non-CRUD operations).\n\n## Monolithic/Microservices duality\n\n**Eicrud** lets you group your CRUD services into \"microservices\" with a simple configuration. You can start developing a monolith and easily switch to microservices later on.\n\n```typescript\nmsOptions.microServices = {\n  \"entry\": {\n    services: [],\n    openMsLink: false, openController: true,\n    url: \"http://localhost:3004\",\n  },\n  \"users\": {\n    services: [User, Profile],\n    openMsLink: true, openController: false,\n    url: \"http://localhost:3005\",\n  },\n  \"orders\": {\n    services: [Order],\n    openMsLink: true, openController: false,\n    url: \"http://localhost:3006\",\n  },\n}\n```\n\n## Powerful typed client (remote procedure call)\n**Eicrud** lets you generate a powerful super-client that holds all your DTOs and commands. Allowing auto-completion and type safety directly in your front-end.  \n```typescript\n// in your profile service\nasync $say_hello(dto: SayHelloDto, ctx: CrudContext) {\n    return `Hello ${dto.myArg}!`\n}\n\n// in your frontend\nconst sp = new SuperClient({url: 'http://localhost:3004'});\nsp.profile.say_hello({myArg: 'world'}).then(console.log);\n```\n\n## Start building\n\n**Eicrud** is made for code simplicity, you can build your applications in record time using the [CLI](https://www.npmjs.com/package/@eicrud/cli) that will do the heavy work for you.\n\nCheck out the [documentation](https://docs.eicrud.com/installation) to get started.\n\n\n## Support\n\n**Eicrud** is in active development and issues are taken seriously. Don't hesitate to create a [ticket](https://github.com/eicrud/eicrud/issues) or join the [Discord](https://discord.gg/VaGPqE7bn9) if you need help.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feicrud%2Feicrud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feicrud%2Feicrud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feicrud%2Feicrud/lists"}