-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.wasp
197 lines (172 loc) · 5.38 KB
/
main.wasp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
app typergotchi {
wasp: {
version: "^0.10.4"
},
title: "typergotchi",
auth: {
userEntity: User,
methods: {
email: {
fromField: {
name: "Typergotchi",
email: "[email protected]",
},
emailVerification: {
clientRoute: EmailVerificationRoute,
getEmailContentFn: import { getVerificationEmailContent } from "@server/auth/email.js",
},
passwordReset: {
clientRoute: PasswordResetRoute,
getEmailContentFn: import { getPasswordResetEmailContent } from "@server/auth/email.js",
},
allowUnverifiedLogin: true,
},
},
onAuthFailedRedirectTo: "/login"
},
emailSender: {
provider: SMTP,
defaultFrom: {
name: "Typergotchi",
email: "[email protected]",
},
},
db: {
system: PostgreSQL,
seeds: [
import { seedDaBoiSkins } from "@server/dbSeeds.js",
import { seedDaBoiArmors } from "@server/dbSeeds.js"
],
},
dependencies: [
("prettier", "^2.8.8"),
("@tailwindcss/forms", "^0.5.3"),
("esm-seedrandom", "3.0.5"),
("@aws-sdk/client-s3", "3.295.0"),
("node-fetch", "3.3.1"),
("jimp", "0.22.7"),
("@tabler/icons-react", "2.17.0"),
("zustand", "4.3.8")
]
}
entity User {=psl
id Int @id @default(autoincrement())
email String? @unique
password String?
isEmailVerified Boolean @default(false)
emailVerificationSentAt DateTime?
passwordResetSentAt DateTime?
// registration step 2 fields
nickname String? @unique
description String?
balance Int @default(0)
soloPassings SoloPassing[]
inventory Inventory?
daBoiHappyImg String?
daBoiSadImg String?
daBoiSelectedSkinId Int?
daBoiSelectedSkin DaBoiSkin? @relation(fields: [daBoiSelectedSkinId], references: [id])
daBoiSelectedArmorId Int?
daBoiSelectedArmor DaBoiArmor? @relation(fields: [daBoiSelectedArmorId], references: [id])
psl=}
entity SoloPassing {=psl
id Int @id @default(autoincrement())
cpm Int
userId Int
user User @relation(fields: [userId], references: [id])
psl=}
entity DaBoiSkin {=psl
id Int @id @default(autoincrement())
name String
imgHappy String
imgSad String
user User[]
psl=}
entity DaBoiArmor {=psl
id Int @id @default(autoincrement())
name String @unique
price Int
img String
inventory Inventory[]
user User[]
psl=}
entity Inventory {=psl
id Int @id @default(autoincrement())
userId Int @unique
user User @relation(fields: [userId], references: [id])
armorId Int @unique
armor DaBoiArmor @relation(fields: [armorId], references: [id])
psl=}
route RootRoute { path: "/", to: MainPage }
page MainPage {
component: import Main from "@client/MainPage"
}
route LoginRoute { path: "/login", to: LoginPage }
page LoginPage {
component: import { LoginPage } from "@client/pages/auth/LoginPage"
}
route SignupRoute { path: "/signup", to: SignupPage }
page SignupPage {
component: import { SignupPage } from "@client/pages/auth/SignupPage"
}
route SignupStage2Route { path: "/signup-stage-2", to: SignupStage2Page }
page SignupStage2Page {
component: import { SignupStage2 } from "@client/pages/auth/SignupStage2"
}
route RequestPasswordResetRoute { path: "/request-password-reset", to: RequestPasswordResetPage }
page RequestPasswordResetPage {
component: import { RequestPasswordReset } from "@client/pages/auth/RequestPasswordReset.tsx",
}
route PasswordResetRoute { path: "/password-reset", to: PasswordResetPage }
page PasswordResetPage {
component: import { PasswordReset } from "@client/pages/auth/PasswordReset.tsx",
}
route EmailVerificationRoute { path: "/email-verification", to: EmailVerificationPage }
page EmailVerificationPage {
component: import { EmailVerification } from "@client/pages/auth/EmailVerification.tsx",
}
route SoloModeRoute { path: "/solo-mode", to: SoloModePage }
page SoloModePage {
component: import { SoloMode } from "@client/pages/soloMode.tsx",
}
query fetchDaBoiSkins {
fn: import { getDaBoiSkins } from "@server/queries/daBoi.js",
entities: [DaBoiSkin]
}
query fetchDaBoiArmor {
fn: import { getDaBoiArmor } from "@server/queries/daBoi.js",
entities: [DaBoiArmor]
}
query generateText {
fn: import { generateText } from "@server/queries/generateText.js",
}
action registerStep2 {
fn: import { registerStep2 } from "@server/actions/profile.js",
entities: [User]
}
action addSoloPassing {
fn: import { addSoloPassing } from "@server/actions/passings.js",
entities: [SoloPassing]
}
action changeNickname {
fn: import { changeNickname } from "@server/actions/profile.js",
entities: [User]
}
action setDaBoiSkin {
fn: import { setDaBoiSkin } from "@server/actions/profile.js",
entities: [User]
}
action setDaBoiArmor {
fn: import { setDaBoiArmor } from "@server/actions/profile.js",
entities: [User, Inventory]
}
action buyDaBoiArmor {
fn: import { buyDaBoiArmor } from "@server/actions/shop.js",
entities: [User, Inventory, DaBoiArmor]
}
job generateImageJob {
executor: PgBoss,
perform: {
fn: import { generateImage } from "@server/jobs/generateImageJob.js"
}
}