{"id":13880729,"url":"https://github.com/huv1k/nextjs-auth-prisma","last_synced_at":"2025-07-25T02:32:07.543Z","repository":{"id":37848545,"uuid":"347903567","full_name":"huv1k/nextjs-auth-prisma","owner":"huv1k","description":"Full-stack boilerplate template.","archived":false,"fork":false,"pushed_at":"2023-07-14T20:26:49.000Z","size":2017,"stargazers_count":156,"open_issues_count":6,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-24T09:34:05.050Z","etag":null,"topics":["graphql","helix","nextauth","nextjs","prisma","react","typescript","urql"],"latest_commit_sha":null,"homepage":"https://nextjs-auth-prisma.huvik.dev","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/huv1k.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":"2021-03-15T09:13:29.000Z","updated_at":"2024-11-19T08:39:39.000Z","dependencies_parsed_at":"2024-11-24T12:18:57.914Z","dependency_job_id":null,"html_url":"https://github.com/huv1k/nextjs-auth-prisma","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huv1k%2Fnextjs-auth-prisma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huv1k%2Fnextjs-auth-prisma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huv1k%2Fnextjs-auth-prisma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huv1k%2Fnextjs-auth-prisma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huv1k","download_url":"https://codeload.github.com/huv1k/nextjs-auth-prisma/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227504084,"owners_count":17781819,"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":["graphql","helix","nextauth","nextjs","prisma","react","typescript","urql"],"created_at":"2024-08-06T08:03:25.967Z","updated_at":"2024-12-01T06:47:24.354Z","avatar_url":"https://github.com/huv1k.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Next.js-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 Yoga](https://github.com/dotansimha/graphql-yoga/) - Fully-featured GraphQL Server\n- 💄 [Prettier](https://github.com/prettier/prettier) - Formatting 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/kF73swy.gif)\n\n### Automatic GraphQL types generated\n\nGraphQL types are automatically generated for data masking. This pattern is one of [the best practise](https://the-guild.dev/blog/unleash-the-power-of-fragments-with-graphql-codegen) you should follow when building scalable applications. This pattern was first introduced by [Relay](https://relay.dev/docs/principles-and-architecture/thinking-in-relay/#data-masking).\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. You can follow [Pothos's auth plugin](https://pothos-graphql.dev/docs/plugins/scope-auth) documentation or checkout [example](https://github.com/huv1k/nextjs-auth-prisma/blob/master/src/lib/pothos/builder.ts) in this repository.\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\nThis starter could be used with all databases supported by Prisma. I would suggest using [PlanetScale](https://planetscale.com/), which has a nice generous free plan. You can follow [Prisma getting started](https://www.prisma.io/docs/getting-started/setup-prisma/start-from-scratch/relational-databases/connect-your-database-typescript-planetscale) to get your database up and running.\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%2Fhuv1k%2Fnextjs-auth-prisma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuv1k%2Fnextjs-auth-prisma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuv1k%2Fnextjs-auth-prisma/lists"}