{"id":20283791,"url":"https://github.com/premieroctet/next-crud","last_synced_at":"2025-04-04T12:06:02.834Z","repository":{"id":39888667,"uuid":"315250977","full_name":"premieroctet/next-crud","owner":"premieroctet","description":"Full-featured CRUD routes for Next.js","archived":false,"fork":false,"pushed_at":"2024-07-22T12:29:46.000Z","size":1174,"stargazers_count":267,"open_issues_count":16,"forks_count":33,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T11:07:01.829Z","etag":null,"topics":["crud","hacktoberfest","nextjs","prisma","react"],"latest_commit_sha":null,"homepage":"https://next-crud.js.org","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/premieroctet.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}},"created_at":"2020-11-23T08:41:28.000Z","updated_at":"2025-02-22T07:30:51.000Z","dependencies_parsed_at":"2024-12-07T03:05:25.329Z","dependency_job_id":"7071b823-fd05-4376-839c-9898d188b2d5","html_url":"https://github.com/premieroctet/next-crud","commit_stats":{"total_commits":78,"total_committers":10,"mean_commits":7.8,"dds":0.2948717948717948,"last_synced_commit":"f5e57d9dcd636ec3cc17a4f38669b1ff13b9828f"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/premieroctet%2Fnext-crud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/premieroctet%2Fnext-crud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/premieroctet%2Fnext-crud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/premieroctet%2Fnext-crud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/premieroctet","download_url":"https://codeload.github.com/premieroctet/next-crud/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174407,"owners_count":20896076,"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":["crud","hacktoberfest","nextjs","prisma","react"],"created_at":"2024-11-14T14:17:08.910Z","updated_at":"2025-04-04T12:06:02.816Z","avatar_url":"https://github.com/premieroctet.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Next Crud\n\n[![NPM Version](https://img.shields.io/npm/v/@premieroctet/next-crud/latest)](https://www.npmjs.com/package/@premieroctet/next-crud)\n[![NPM License](https://img.shields.io/npm/l/all-contributors.svg?style=flat)](https://github.com/premieroctet/next-crud/blob/master/LICENSE)\n[![Github Actions](https://github.com/premieroctet/next-crud/workflows/next-crud/badge.svg)](https://github.com/premieroctet/next-crud/actions?query=workflow%3Anext-crud)\n\n`next-crud` is a helper library that creates CRUD API routes with one simple function based on a Prisma model for Next.js.\n\n**Starting from version 3 of the lib, we only support Prisma v5 and above. Please install version 2 of the lib if you are using Prisma v4 or older.**\n\n# Documentation\n\nThe documentation is available [here](https://next-crud.js.org/)\n\n# Overview\n\n`yarn add @premieroctet/next-crud`\n\nGiven the following Prisma schema:\n\n```sql\nmodel User {\n  id              Int        @id @default(autoincrement())\n  name            String?\n  email           String?\n}\n```\n\nCreate the file `/pages/api/[...nextcrud].ts.` with:\n\n```javascript\nimport NextCrud, { PrismaAdapter } from '@premieroctet/next-crud'\nimport { NextApiRequest, NextApiResponse } from 'next'\n\nconst handler = async (req: NextApiRequest, res: NextApiResponse) =\u003e {\n  const nextCrudHandler = await NextCrud({\n    adapter: new PrismaAdapter({\n      prismaClient: myPrismaClientInstance,\n    }),\n  })\n\n  return nextCrudHandler(req, res)\n}\n\nexport default handler\n```\n\nAnd get your full featured CRUD routes!\n\n|              | Endpoint                | Description               |\n| ------------ | ----------------------- | ------------------------- |\n| List         | GET `/api/users`        | Get all the users         |\n| Get          | GET `/api/users/[id]`   | Get one user              |\n| Add          | POST `/api/users`       | Create one user           |\n| Edit         | PUT `/api/users/[id]`   | Update one user           |\n| Partial edit | PATCH `/api/users/[id]` | Update one user (partial) |\n| Delete       | DELETE`/api/users/[id]` | Delete one user           |\n\n# Example\n\n[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat-square\u0026logo=codesandbox)](https://codesandbox.io/s/next-crud-demo-qj3gn)\n\n# Contributing\n\nYou can run the example project to test your modifications. Make sure to run `yarn watch` in the root folder.\n\n# Sponsors\n\nThis project is being developed by [Premier Octet](https://www.premieroctet.com), a Web and mobile agency specializing in React and React Native developments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpremieroctet%2Fnext-crud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpremieroctet%2Fnext-crud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpremieroctet%2Fnext-crud/lists"}