-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
2,941 additions
and
4,795 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
DATABASE_URL="postgresql://" | ||
GITHUB_ID="" | ||
GITHUB_SECRET="" | ||
NEXTAUTH_URL="http://localhost:3000/api/auth" | ||
JWT_SECRET="" | ||
DATABASE_URL=postgresql:// | ||
GITHUB_ID= | ||
GITHUB_SECRET= | ||
NEXTAUTH_URL=http://localhost:3000/api/auth | ||
NEXTAUTH_SECRET= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.graphql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
save-exact=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { UserRole, User } from '@prisma/client' | ||
import { JWT, DefaultJWT } from 'next-auth/jwt' | ||
|
||
declare module 'next-auth/jwt' { | ||
interface JWT extends DefaultJWT { | ||
role: UserRole | ||
id: User['id'] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/types/global" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// @ts-check | ||
|
||
/** | ||
* @type {import('next').NextConfig} | ||
**/ | ||
module.exports = { | ||
reactStrictMode: true, | ||
images: { | ||
domains: ['avatars.githubusercontent.com'], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,60 @@ | ||
{ | ||
"name": "next-auth-prisma-template", | ||
"version": "0.0.1", | ||
"name": "nextjs-auth-prisma-template", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"author": { | ||
"name": "Lukáš Huvar", | ||
"email": "lukas@huvar.cz", | ||
"url": "https://huvik.dev/" | ||
}, | ||
"scripts": { | ||
"build": "yarn generate:nexus && next build", | ||
"build": "yarn schema:generate && yarn hooks:generate && next build", | ||
"dev": "next", | ||
"start": "next start", | ||
"hooks:generate": "graphql-codegen --config .graphqlrc.yaml", | ||
"lint": "next lint", | ||
"postinstall": "yarn prisma generate && yarn generate:nexus", | ||
"generate:hooks": "graphql-codegen --config .graphqlrc.yaml", | ||
"generate:nexus": "ts-node --skip-project --transpile-only src/lib/nexus/schema --nexus-exit" | ||
"postinstall": "yarn prisma generate", | ||
"schema:generate": "tsx src/lib/utils/build-schema.ts", | ||
"start": "next start" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "pretty-quick --staged" | ||
} | ||
}, | ||
"dependencies": { | ||
"@next-auth/prisma-adapter": "^0.4.4-canary.64", | ||
"@prisma/client": "2.24", | ||
"graphql": "^15.5.0", | ||
"graphql-helix": "1.6.1", | ||
"next": "^11.0.0", | ||
"next-auth": "^3.27.0", | ||
"next-urql": "3.0.0", | ||
"nexus": "1.0.0", | ||
"nexus-prisma": "^0.28.0", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react-is": "17.0.2", | ||
"urql": "2.0.2" | ||
"@graphql-yoga/node": "2.13.3", | ||
"@next-auth/prisma-adapter": "1.0.3", | ||
"@pothos/core": "3.13.0", | ||
"@pothos/plugin-prisma": "3.14.0", | ||
"@pothos/plugin-scope-auth": "3.11.0", | ||
"@prisma/client": "4.0.0", | ||
"graphql": "16.5.0", | ||
"next": "12.2.3", | ||
"next-auth": "4.10.0", | ||
"next-urql": "3.3.3", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"react-is": "18.2.0", | ||
"urql": "2.2.2" | ||
}, | ||
"devDependencies": { | ||
"@graphql-codegen/cli": "1.21.4", | ||
"@graphql-codegen/near-operation-file-preset": "^1.18.0", | ||
"@graphql-codegen/typed-document-node": "1.18.8", | ||
"@graphql-codegen/typescript": "1.21.0", | ||
"@graphql-codegen/typescript-operations": "1.17.15", | ||
"@graphql-codegen/typescript-urql": "2.0.3", | ||
"@graphql-typed-document-node/core": "3.1.0", | ||
"@types/next-auth": "3.1.26", | ||
"eslint": "^7.28.0", | ||
"eslint-config-next": "^11.0.0", | ||
"graphql-playground-html": "^1.6.29", | ||
"husky": "4.3.8", | ||
"prettier": "2.2.1", | ||
"pretty-quick": "3.1.0", | ||
"prisma": "2.24", | ||
"ts-node": "9.1.1", | ||
"typescript": "^4.3.4" | ||
} | ||
"@graphql-codegen/cli": "^2.11.3", | ||
"@graphql-codegen/near-operation-file-preset": "2.4.0", | ||
"@graphql-codegen/typed-document-node": "2.3.2", | ||
"@graphql-codegen/typescript": "2.7.2", | ||
"@graphql-codegen/typescript-operations": "2.5.2", | ||
"@graphql-codegen/typescript-urql": "3.6.3", | ||
"@graphql-typed-document-node/core": "3.1.1", | ||
"@types/node": "18.6.3", | ||
"@types/react": "18.0.15", | ||
"eslint": "8.20.0", | ||
"eslint-config-next": "12.2.2", | ||
"husky": "8.0.1", | ||
"prettier": "2.7.1", | ||
"pretty-quick": "3.1.3", | ||
"prisma": "4.0.0", | ||
"tsx": "3.8.0", | ||
"typescript": "4.7.4" | ||
}, | ||
"packageManager": "yarn@3.2.2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,10 @@ | ||
### This file was generated by Nexus Schema | ||
### Do not make changes to this file directly | ||
|
||
""" | ||
A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. | ||
""" | ||
scalar DateTime | ||
|
||
""" | ||
The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). | ||
""" | ||
scalar Json | ||
@specifiedBy( | ||
url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf" | ||
) | ||
|
||
type Query { | ||
users: [User] | ||
users: [User!]! | ||
viewer: User | ||
} | ||
|
||
enum Role { | ||
ADMIN | ||
SUPERADMIN | ||
USER | ||
} | ||
|
||
type User { | ||
id: ID! | ||
image: String | ||
name: String | ||
} | ||
} |
Oops, something went wrong.