-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working on profiles, upload, storage plugins
- Loading branch information
Ian Walter
committed
Dec 31, 2021
1 parent
b761ddc
commit c7dba13
Showing
14 changed files
with
1,174 additions
and
12 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,4 +1,8 @@ | ||
{ | ||
"name": "@generates/whip-billing", | ||
"license": "UNLICENSED" | ||
"version": "0.0.0", | ||
"license": "UNLICENSED", | ||
"dependencies": { | ||
"@generates/whip-prisma": "0.0.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
import prisma from '@generates/whip-prisma' | ||
|
||
export default function blogPlugin (app, opts) { | ||
if (!app.prisma) prisma(app, opts.prisma) | ||
} | ||
|
||
blogPlugin.getSession |
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,4 +1,14 @@ | ||
{ | ||
"name": "@generates/whip-blog", | ||
"license": "UNLICENSED" | ||
"version": "0.0.0", | ||
"license": "UNLICENSED", | ||
"scripts": { | ||
"test": "bff" | ||
}, | ||
"dependencies": { | ||
"@generates/whip-prisma": "0.0.2" | ||
}, | ||
"devDependencies": { | ||
"@ianwalter/bff": "^11.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// This is your Prisma schema file, | ||
// learn more about it in the docs: https://pris.ly/d/prisma-schema | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
model Account { | ||
id String @id | ||
email String @unique | ||
username String? @unique | ||
firstName String? | ||
lastName String? | ||
password String | ||
emailVerified Boolean @default(value: false) | ||
enabled Boolean @default(value: true) | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @default(now()) | ||
tokens Token[] | ||
blogPosts BlogPost[] | ||
@@index([email]) | ||
@@index([username]) | ||
} | ||
|
||
enum TokenType { | ||
password | ||
} | ||
|
||
model Token { | ||
id String @id | ||
value String @unique | ||
account Account @relation(fields: [accountId], references: [id], onDelete: Cascade) | ||
accountId String | ||
type TokenType @default(value: email) | ||
email String | ||
expiresAt DateTime | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @default(now()) | ||
@@index([email]) | ||
@@index([accountId]) | ||
} | ||
|
||
model Session { | ||
sid String @id | ||
sess Json | ||
expire DateTime | ||
@@index([expire]) | ||
} | ||
|
||
model BlogPost { | ||
id String @id | ||
title String | ||
slug String | ||
body String | ||
status String @default(value: "draft") | ||
account Account @relation(fields: [accountId], references: [id], onDelete: Cascade) | ||
accountId String | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @default(now()) | ||
tags BlogTagOnBlogPost[] | ||
} | ||
|
||
model BlogTag { | ||
id String @id | ||
name String @unique | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @default(now()) | ||
posts BlogTagOnBlogPost[] | ||
} | ||
|
||
model BlogTagOnBlogPost { | ||
id String @id | ||
post BlogPost @relation(fields: [postId], references: [id], onDelete: Cascade) | ||
postId String | ||
tag BlogTag @relation(fields: [tagId], references: [id], onDelete: Cascade) | ||
tagId String | ||
} |
Empty file.
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 @@ | ||
{ | ||
"name": "@generates/whip-profiles", | ||
"version": "0.0.0", | ||
"license": "UNLICENSED" | ||
} |
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,68 @@ | ||
// This is your Prisma schema file, | ||
// learn more about it in the docs: https://pris.ly/d/prisma-schema | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
model Account { | ||
id String @id | ||
email String @unique | ||
username String? @unique | ||
firstName String? | ||
lastName String? | ||
password String | ||
emailVerified Boolean @default(value: false) | ||
enabled Boolean @default(value: true) | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @default(now()) | ||
tokens Token[] | ||
profile Profile? | ||
@@index([email]) | ||
@@index([username]) | ||
} | ||
|
||
enum TokenType { | ||
password | ||
} | ||
|
||
model Token { | ||
id String @id | ||
value String @unique | ||
account Account @relation(fields: [accountId], references: [id], onDelete: Cascade) | ||
accountId String | ||
type TokenType @default(value: email) | ||
email String | ||
expiresAt DateTime | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @default(now()) | ||
@@index([email]) | ||
@@index([accountId]) | ||
} | ||
|
||
model Session { | ||
sid String @id | ||
sess Json | ||
expire DateTime | ||
@@index([expire]) | ||
} | ||
|
||
model Profile { | ||
id String @id | ||
name String | ||
bio String? | ||
imageUrl String? | ||
account Account @relation(fields: [accountId], references: [id], onDelete: Cascade) | ||
accountId String @unique | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @default(now()) | ||
} |
Empty file.
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,8 @@ | ||
{ | ||
"name": "@generates/whip-storage", | ||
"version": "0.0.0", | ||
"license": "UNLICENSED", | ||
"dependencies": { | ||
"@aws-sdk/client-s3": "^3.45.0" | ||
} | ||
} |
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,8 @@ | ||
{ | ||
"name": "@generates/whip-stripe", | ||
"version": "0.0.0", | ||
"license": "UNLICENSED", | ||
"dependencies": { | ||
"stripe": "^8.195.0" | ||
} | ||
} |
Empty file.
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,8 @@ | ||
{ | ||
"name": "@generates/whip-upload", | ||
"version": "0.0.0", | ||
"license": "UNLICENSED", | ||
"dependencies": { | ||
"multer": "^1.4.4" | ||
} | ||
} |
Oops, something went wrong.