Skip to content

Commit c7dba13

Browse files
author
Ian Walter
committed
Working on profiles, upload, storage plugins
1 parent b761ddc commit c7dba13

File tree

14 files changed

+1174
-12
lines changed

14 files changed

+1174
-12
lines changed

packages/whip-billing/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
22
"name": "@generates/whip-billing",
3-
"license": "UNLICENSED"
3+
"version": "0.0.0",
4+
"license": "UNLICENSED",
5+
"dependencies": {
6+
"@generates/whip-prisma": "0.0.2"
7+
}
48
}

packages/whip-blog/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
import prisma from '@generates/whip-prisma'
12

3+
export default function blogPlugin (app, opts) {
4+
if (!app.prisma) prisma(app, opts.prisma)
5+
}
6+
7+
blogPlugin.getSession

packages/whip-blog/package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
{
22
"name": "@generates/whip-blog",
3-
"license": "UNLICENSED"
3+
"version": "0.0.0",
4+
"license": "UNLICENSED",
5+
"scripts": {
6+
"test": "bff"
7+
},
8+
"dependencies": {
9+
"@generates/whip-prisma": "0.0.2"
10+
},
11+
"devDependencies": {
12+
"@ianwalter/bff": "^11.2.2"
13+
}
414
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// This is your Prisma schema file,
2+
// learn more about it in the docs: https://pris.ly/d/prisma-schema
3+
4+
generator client {
5+
provider = "prisma-client-js"
6+
}
7+
8+
datasource db {
9+
provider = "postgresql"
10+
url = env("DATABASE_URL")
11+
}
12+
13+
model Account {
14+
id String @id
15+
email String @unique
16+
username String? @unique
17+
firstName String?
18+
lastName String?
19+
password String
20+
emailVerified Boolean @default(value: false)
21+
enabled Boolean @default(value: true)
22+
createdAt DateTime @default(now())
23+
updatedAt DateTime @default(now())
24+
tokens Token[]
25+
blogPosts BlogPost[]
26+
27+
@@index([email])
28+
@@index([username])
29+
}
30+
31+
enum TokenType {
32+
email
33+
password
34+
}
35+
36+
model Token {
37+
id String @id
38+
value String @unique
39+
account Account @relation(fields: [accountId], references: [id], onDelete: Cascade)
40+
accountId String
41+
type TokenType @default(value: email)
42+
email String
43+
expiresAt DateTime
44+
createdAt DateTime @default(now())
45+
updatedAt DateTime @default(now())
46+
47+
@@index([email])
48+
@@index([accountId])
49+
}
50+
51+
model Session {
52+
sid String @id
53+
sess Json
54+
expire DateTime
55+
56+
@@index([expire])
57+
}
58+
59+
model BlogPost {
60+
id String @id
61+
title String
62+
slug String
63+
body String
64+
status String @default(value: "draft")
65+
account Account @relation(fields: [accountId], references: [id], onDelete: Cascade)
66+
accountId String
67+
createdAt DateTime @default(now())
68+
updatedAt DateTime @default(now())
69+
tags BlogTagOnBlogPost[]
70+
}
71+
72+
model BlogTag {
73+
id String @id
74+
name String @unique
75+
createdAt DateTime @default(now())
76+
updatedAt DateTime @default(now())
77+
posts BlogTagOnBlogPost[]
78+
}
79+
80+
model BlogTagOnBlogPost {
81+
id String @id
82+
post BlogPost @relation(fields: [postId], references: [id], onDelete: Cascade)
83+
postId String
84+
tag BlogTag @relation(fields: [tagId], references: [id], onDelete: Cascade)
85+
tagId String
86+
}

packages/whip-profiles/index.js

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "@generates/whip-profiles",
3+
"version": "0.0.0",
4+
"license": "UNLICENSED"
5+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// This is your Prisma schema file,
2+
// learn more about it in the docs: https://pris.ly/d/prisma-schema
3+
4+
generator client {
5+
provider = "prisma-client-js"
6+
}
7+
8+
datasource db {
9+
provider = "postgresql"
10+
url = env("DATABASE_URL")
11+
}
12+
13+
model Account {
14+
id String @id
15+
email String @unique
16+
username String? @unique
17+
firstName String?
18+
lastName String?
19+
password String
20+
emailVerified Boolean @default(value: false)
21+
enabled Boolean @default(value: true)
22+
createdAt DateTime @default(now())
23+
updatedAt DateTime @default(now())
24+
tokens Token[]
25+
profile Profile?
26+
27+
@@index([email])
28+
@@index([username])
29+
}
30+
31+
enum TokenType {
32+
email
33+
password
34+
}
35+
36+
model Token {
37+
id String @id
38+
value String @unique
39+
account Account @relation(fields: [accountId], references: [id], onDelete: Cascade)
40+
accountId String
41+
type TokenType @default(value: email)
42+
email String
43+
expiresAt DateTime
44+
createdAt DateTime @default(now())
45+
updatedAt DateTime @default(now())
46+
47+
@@index([email])
48+
@@index([accountId])
49+
}
50+
51+
model Session {
52+
sid String @id
53+
sess Json
54+
expire DateTime
55+
56+
@@index([expire])
57+
}
58+
59+
model Profile {
60+
id String @id
61+
name String
62+
bio String?
63+
imageUrl String?
64+
account Account @relation(fields: [accountId], references: [id], onDelete: Cascade)
65+
accountId String @unique
66+
createdAt DateTime @default(now())
67+
updatedAt DateTime @default(now())
68+
}

packages/whip-storage/index.js

Whitespace-only changes.

packages/whip-storage/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "@generates/whip-storage",
3+
"version": "0.0.0",
4+
"license": "UNLICENSED",
5+
"dependencies": {
6+
"@aws-sdk/client-s3": "^3.45.0"
7+
}
8+
}

packages/whip-stripe/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import stripe from 'stripe'
22

3-
export default function redisPlugin (app, opts) {
4-
app.redis = stripe(opts)
3+
export default function stripePlugin (app, opts) {
4+
app.stripe = stripe(opts)
55
app.use(function stripeMiddleware (req, res, next) {
66
req.stripe = app.stripe
77
next()

0 commit comments

Comments
 (0)