{"id":24874677,"url":"https://github.com/dirheimerb/next-prisma","last_synced_at":"2025-03-27T02:15:51.867Z","repository":{"id":38038889,"uuid":"502193383","full_name":"dirheimerb/next-prisma","owner":"dirheimerb","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-13T21:50:36.000Z","size":12886,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T07:28:57.052Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/dirheimerb.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}},"created_at":"2022-06-10T22:11:37.000Z","updated_at":"2022-06-11T03:00:22.000Z","dependencies_parsed_at":"2025-02-01T07:38:18.093Z","dependency_job_id":null,"html_url":"https://github.com/dirheimerb/next-prisma","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"huv1k/nextjs-auth-prisma","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirheimerb%2Fnext-prisma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirheimerb%2Fnext-prisma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirheimerb%2Fnext-prisma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirheimerb%2Fnext-prisma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dirheimerb","download_url":"https://codeload.github.com/dirheimerb/next-prisma/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245767360,"owners_count":20668826,"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":[],"created_at":"2025-02-01T07:28:09.245Z","updated_at":"2025-03-27T02:15:51.847Z","avatar_url":"https://github.com/dirheimerb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nextjs-auth-prisma boilerplate\n\nBuild bleeding-edge full-stack applications using **Next.js**, **GraphQL**, **TypeScript** and **Prisma**.\n\n## Getting started\n\n1. Clone this project `git clone https://github.com/huv1k/nextjs-auth-prisma`\n2. Install dependencies `yarn install` or `npm install`\n3. [Setup](#Setup) your local environment\n4. Run application `yarn dev` or `npm run dev`\n5. Profit 💰\n\n## Features\n\n- 🐣 **Simple:** You can focus on building your product.\n- ⚡️ **Fast:** Compile only what is needed and when is needed.\n- 💍 **Feature-rich:** Code generation, automatic migrations, type-safety.\n- 🛠 **Customizable:** You can easily change tools you are not familiar with.\n\n## Overview\n\nI have created this boilerplate because there was a missing one with all features. Which would support fast development and easy deployment without sacrificing performance. This boilerplate is built on the best open-source tools out there:\n\n- ⚡️ [Next.js](https://github.com/vercel/next.js) - The React framework for Production\n- 🛠 [TypeScript](https://www.typescriptlang.org/) - Type-safety for your code\n- 🤝 [Prisma](https://github.com/prisma/prisma) - ORM for accessing and managing your data\n- 🛡 [NextAuth.js](https://github.com/nextauthjs/next-auth) - Authentication for Next.js\n- 🦅 [urql](https://github.com/FormidableLabs/urql) - Highly customisable GraphQL client with sensitive defaults\n- ⚙️ [GraphQL Code Generator](https://github.com/dotansimha/graphql-code-generator) - Generates code out of GraphQL schema\n- 🧬 [GraphQL Helix](https://github.com/contrawork/graphql-helix) - Flexible utility functions for building GraphQL servers\n- 💄 [Prettier](https://github.com/prettier/prettier) - Formating your code\n- 🤖 [Dependabot](https://github.com/marketplace/dependabot-preview) - Keeping your dependencies up to date\n\n### Run Prisma migrations on save\n\nThis boilerplate works out of the box with automatic migrations for rapid prototyping. I described this in my article [Improve prototyping speed of Prisma](https://huvik.dev/blog/improve-prototyping-speed-of-prisma), you can check how it works under the hood.\n\n![](https://i.imgur.com/clz6RjW.gif)\n\n### Automatic GraphQL hooks generation\n\nHooks for GraphQL are automatically generated inside `src/lib/grahql/*` from your GraphQL files. You can customize hooks generation inside `.graphqlrc.yaml`.\n![](https://i.imgur.com/gFGF2fB.gif)\n\n### Authentication using NextAuth.js\n\nThis boilerplate is configured to use [GitHub](https://next-auth.js.org/providers/github) authentication provider. [NextAuth.js](https://github.com/nextauthjs/next-auth) comes with a lot of different [providers](https://next-auth.js.org/configuration/providers). You can choose, which providers suit your needs most.\n\n### Defining custom authorization rules\n\nYou can define authorization rules for your resolvers. For example [isAdmin](https://github.com/huv1k/nextjs-auth-prisma/blob/master/src/lib/nexus/rules.ts) rule for listing [all users](https://github.com/huv1k/nextjs-auth-prisma/blob/master/src/lib/nexus/types/user.ts#L24).\n\n### Deployment\n\nFor deployment, you can use [Vercel](https://vercel.com/), this boilerplate works with Vercel out of the box! Use this template and then import Git repository inside Vercel [dashboard](https://vercel.com/new).\n\n## Setup\n\n### Connect your database\n\nYou can follow [Prisma getting started](https://www.prisma.io/docs/getting-started/setup-prisma/start-from-scratch-typescript-postgres#connect-your-database), which requires to have running PostgreSQL database running. If you don't want to use a local docker setup, I suggest using [Railway.app](https://railway.app/), which has a nice generous free plan for PostgreSQL databases.\n\n### NextAuth GitHub provider\n\nYou need to create [GitHub OAuth App](https://github.com/settings/developers). You're going to provide Authorization callback URL like:\n\n- Local development: `http://localhost:3000/api/auth`\n- Production deployment: `https://www.YOURDOMAIN.TLD/api/auth`\n\nThen you are going to copy `Client ID` and `Client secret` and fill your environment variables.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirheimerb%2Fnext-prisma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirheimerb%2Fnext-prisma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirheimerb%2Fnext-prisma/lists"}