-
-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from belgattitude/auth-prisma
Feat: example with next-auth and prisma
- Loading branch information
Showing
36 changed files
with
1,563 additions
and
52 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'web-app': minor | ||
--- | ||
|
||
Add prisma and next-auth example |
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,5 @@ | ||
--- | ||
'@your-org/core-lib': minor | ||
--- | ||
|
||
Add example asserts and typeguards |
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,5 @@ | ||
--- | ||
'@your-org/core-lib': minor | ||
--- | ||
|
||
Add jest example for packages |
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
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,6 +1,11 @@ | ||
# This is the main file for environment | ||
# https://nextjs.org/docs/basic-features/environment-variables | ||
|
||
PRISMA_DATABASE_URL="file:../data/prisma-dev-database.sqlite" | ||
|
||
# DATABASE_URL | ||
# When deploying on serveless/lambdas "?connection_limit=" should be 1 | ||
# @see https://www.prisma.io/docs/concepts/components/prisma-client/deployment#recommended-connection-limit | ||
PRISMA_DATABASE_URL=postgresql://nextjs:!ChangeMe!@localhost:5432/maindb?schema=public | ||
|
||
# Enable display of lambdas size for vercel deployments | ||
# NEXT_DEBUG_FUNCTION_SIZE=1 |
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 @@ | ||
PRISMA_DATABASE_URL=postgresql://nextjs:!ChangeMe!@localhost:5432/maindb?schema=public |
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,23 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIDxDCCAqygAwIBAgIUbLxMod62P2ktCiAkxnKJwtE9VPYwDQYJKoZIhvcNAQEL | ||
BQAwazELMAkGA1UEBhMCVVMxEDAOBgNVBAgMB0RlbHdhcmUxEzARBgNVBAcMCk5l | ||
dyBDYXN0bGUxFTATBgNVBAoMDFN1cGFiYXNlIEluYzEeMBwGA1UEAwwVU3VwYWJh | ||
c2UgUm9vdCAyMDIxIENBMB4XDTIxMDQyODEwNTY1M1oXDTM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LEnI3QmEKsqaCLv12BnVjbkSeZsMnevJPs1Ye6TjjJwdik5P | ||
o/bKiIz+Fq8= | ||
-----END CERTIFICATE----- |
Binary file not shown.
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,24 +1,69 @@ | ||
datasource db { | ||
provider = "sqlite" | ||
url = env("PRISMA_DATABASE_URL") | ||
} | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("PRISMA_DATABASE_URL") | ||
} | ||
|
||
model Post { | ||
id Int @id @default(autoincrement()) | ||
title String | ||
content String? | ||
published Boolean @default(false) | ||
author User? @relation(fields: [authorId], references: [id]) | ||
authorId Int? | ||
@@map(name: "post") | ||
} | ||
|
||
model User { | ||
id Int @id @default(autoincrement()) | ||
email String @unique | ||
name String? | ||
posts Post[] | ||
id Int @id @default(autoincrement()) | ||
name String? | ||
email String @unique | ||
emailVerified DateTime? @map(name: "email_verified") | ||
image String? | ||
createdAt DateTime @default(now()) @map(name: "created_at") | ||
updatedAt DateTime @updatedAt @map(name: "updated_at") | ||
posts Post[] | ||
@@map(name: "user") | ||
} | ||
|
||
model AuthAccount { | ||
id Int @id @default(autoincrement()) | ||
compoundId String @unique @map(name: "compound_id") | ||
userId Int @map(name: "user_id") | ||
providerType String @map(name: "provider_type") | ||
providerId String @map(name: "provider_id") | ||
providerAccountId String @map(name: "provider_account_id") | ||
refreshToken String? @map(name: "refresh_token") | ||
accessToken String? @map(name: "access_token") | ||
accessTokenExpires DateTime? @map(name: "access_token_expires") | ||
createdAt DateTime @default(now()) @map(name: "created_at") | ||
updatedAt DateTime @default(now()) @map(name: "updated_at") | ||
@@index([providerAccountId], name: "providerAccountId") | ||
@@index([providerId], name: "providerId") | ||
@@index([userId], name: "userId") | ||
@@map(name: "auth_account") | ||
} | ||
|
||
model AuthSession { | ||
id Int @id @default(autoincrement()) | ||
userId Int @map(name: "user_id") | ||
expires DateTime | ||
sessionToken String @unique @map(name: "session_token") | ||
accessToken String @unique @map(name: "access_token") | ||
createdAt DateTime @default(now()) @map(name: "created_at") | ||
updatedAt DateTime @default(now()) @map(name: "updated_at") | ||
@@map(name: "auth_session") | ||
} | ||
|
||
model AuthVerificationRequest { | ||
id Int @id @default(autoincrement()) | ||
identifier String | ||
token String @unique | ||
expires DateTime | ||
createdAt DateTime @default(now()) @map(name: "created_at") | ||
updatedAt DateTime @default(now()) @map(name: "updated_at") | ||
@@map(name: "auth_verification_request") | ||
} |
Oops, something went wrong.
754df64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nextjs-monorepo-example-web-app – ./apps/web-app
nextjs-monorepo-example-web-app.vercel.app
nextjs-monorepo-example-web-app-git-main-belgattitude.vercel.app
nextjs-monorepo-example-web-app-belgattitude.vercel.app
754df64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nextjs-monorepo-example-blog-app – ./apps/blog-app
nextjs-monorepo-example-blog-app-git-main-belgattitude.vercel.app
nextjs-monorepo-example-blog-app.vercel.app
nextjs-monorepo-example-blog-app-belgattitude.vercel.app