-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.wasp
More file actions
388 lines (323 loc) · 12.3 KB
/
Copy pathmain.wasp
File metadata and controls
388 lines (323 loc) · 12.3 KB
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
app CinemaVerse {
wasp: {
version: "^0.16.0"
},
title: "CinemaVerse - Movie & TV Tracking Platform",
head: [
"<link rel='icon' href='/favicon.ico' />",
"<meta charset='utf-8' />",
"<meta name='description' content='Track your favorite movies and TV shows with AI-powered recommendations.' />",
"<meta name='author' content='CinemaVerse' />",
"<meta name='keywords' content='movies, tv shows, tracking, watchlist, recommendations, entertainment' />",
"<meta property='og:type' content='website' />",
"<meta property='og:title' content='CinemaVerse - Movie & TV Tracking Platform' />",
"<meta property='og:site_name' content='CinemaVerse' />",
"<meta property='og:url' content='https://cinemaverse.app' />",
"<meta property='og:description' content='Track your favorite movies and TV shows with AI-powered recommendations.' />",
"<meta property='og:image' content='https://cinemaverse.app/public-banner.webp' />",
"<meta name='twitter:image' content='https://cinemaverse.app/public-banner.webp' />",
"<meta name='twitter:image:width' content='800' />",
"<meta name='twitter:image:height' content='400' />",
"<meta name='twitter:card' content='summary_large_image' />",
// TODO: You can put your Plausible analytics scripts below (https://docs.opensaas.sh/guides/analytics/):
// NOTE: Plausible does not use Cookies, so you can simply add the scripts here.
// Google, on the other hand, does, so you must instead add the script dynamically
// via the Cookie Consent component after the user clicks the "Accept" cookies button.
"<script defer data-domain='<your-site-id>' src='https://plausible.io/js/script.js'></script>", // for production
"<script defer data-domain='<your-site-id>' src='https://plausible.io/js/script.local.js'></script>", // for development
],
// 🔐 Auth out of the box! https://wasp.sh/docs/auth/overview
auth: {
userEntity: User,
methods: {
// NOTE: If you decide to not use email auth, make sure to also delete the related routes and pages below.
// (RequestPasswordReset(Route|Page), PasswordReset(Route|Page), EmailVerification(Route|Page))
email: {
fromField: {
name: "Open SaaS App",
email: "me@example.com"
},
emailVerification: {
clientRoute: EmailVerificationRoute,
getEmailContentFn: import { getVerificationEmailContent } from "@src/auth/email-and-pass/emails",
},
passwordReset: {
clientRoute: PasswordResetRoute,
getEmailContentFn: import { getPasswordResetEmailContent } from "@src/auth/email-and-pass/emails",
},
userSignupFields: import { getEmailUserFields } from "@src/auth/userSignupFields",
},
// Google OAuth for CinemaVerse
google: {
userSignupFields: import { getGoogleUserFields } from "@src/auth/userSignupFields",
configFn: import { getGoogleAuthConfig } from "@src/auth/userSignupFields",
},
// Uncomment to enable GitHub Auth (check https://wasp.sh/docs/auth/social-auth/github for setup instructions):
// gitHub: {
// userSignupFields: import { getGitHubUserFields } from "@src/auth/userSignupFields",
// configFn: import { getGitHubAuthConfig } from "@src/auth/userSignupFields",
// },
// Uncomment to enable Discord Auth (check https://wasp.sh/docs/auth/social-auth/discord for setup instructions):
// discord: {
// userSignupFields: import { getDiscordUserFields } from "@src/auth/userSignupFields",
// configFn: import { getDiscordAuthConfig } from "@src/auth/userSignupFields"
// }
},
onAuthFailedRedirectTo: "/login",
onAuthSucceededRedirectTo: "/search",
},
db: {
// Run `wasp db seed` to seed the database with the seed functions below:
seeds: [
// Populates the database with a bunch of fake users to work with during development.
import { seedMockUsers } from "@src/server/scripts/dbSeeds",
]
},
client: {
rootComponent: import App from "@src/client/App",
},
emailSender: {
// NOTE: "Dummy" provider is just for local development purposes.
// Make sure to check the server logs for the email confirmation url (it will not be sent to an address)!
// Once you are ready for production, switch to e.g. "SendGrid" or "Mailgun" providers. Check out https://docs.opensaas.sh/guides/email-sending/ .
provider: SendGrid,
defaultFrom: {
name: "CinemaVerse",
// When using a real provider, e.g. SendGrid, you must use the same email address that you configured your account to send out emails with!
email: "noreply@cinemaverse.app"
},
},
}
route LandingPageRoute { path: "/", to: LandingPage }
page LandingPage {
component: import LandingPage from "@src/landing-page/LandingPage"
}
//#region Public CinemaVerse Pages
route DiscoverRoute { path: "/discover", to: DiscoverPage }
page DiscoverPage {
component: import DiscoverPage from "@src/features/discover/DiscoverPage"
}
route MoviesRoute { path: "/movies", to: MoviesPage }
page MoviesPage {
component: import MoviesPage from "@src/features/movies/MoviesPage"
}
route TVShowsRoute { path: "/tv-shows", to: TVShowsPage }
page TVShowsPage {
component: import TVShowsPage from "@src/features/tv-shows/TVShowsPage"
}
route GenresRoute { path: "/genres", to: GenresPage }
page GenresPage {
component: import GenresPage from "@src/features/genres/GenresPage"
}
//#endregion
//#region CinemaVerse Core Features
route SearchRoute { path: "/search", to: SearchPage }
page SearchPage {
authRequired: true,
component: import SearchPage from "@src/features/search/SearchPage"
}
route WatchlistRoute { path: "/watchlist", to: WatchlistPage }
page WatchlistPage {
authRequired: true,
component: import WatchlistPage from "@src/features/watchlist/WatchlistPage"
}
route RecommendationsRoute { path: "/recommendations", to: RecommendationsPage }
page RecommendationsPage {
authRequired: true,
component: import RecommendationsPage from "@src/features/ai/RecommendationsPage"
}
route OnboardingRoute { path: "/onboarding", to: OnboardingPage }
page OnboardingPage {
authRequired: true,
component: import OnboardingPage from "@src/features/onboarding/OnboardingPage"
}
route ForumRoute { path: "/forum", to: ForumPage }
page ForumPage {
authRequired: true,
component: import ForumPage from "@src/features/forum/ForumPage"
}
route MovieDetailsRoute { path: "/movie/:movieId", to: MovieDetailsPage }
page MovieDetailsPage {
component: import MovieDetailsPage from "@src/features/details/MovieDetailsPage"
}
route TVDetailsRoute { path: "/tv/:tvId", to: TVDetailsPage }
page TVDetailsPage {
component: import TVDetailsPage from "@src/features/details/TVDetailsPage"
}
//#endregion
//#region Auth Pages
route LoginRoute { path: "/login", to: LoginPage }
page LoginPage {
component: import Login from "@src/auth/LoginPage"
}
route SignupRoute { path: "/signup", to: SignupPage }
page SignupPage {
component: import { Signup } from "@src/auth/SignupPage"
}
route RequestPasswordResetRoute { path: "/request-password-reset", to: RequestPasswordResetPage }
page RequestPasswordResetPage {
component: import { RequestPasswordResetPage } from "@src/auth/email-and-pass/RequestPasswordResetPage",
}
route PasswordResetRoute { path: "/password-reset", to: PasswordResetPage }
page PasswordResetPage {
component: import { PasswordResetPage } from "@src/auth/email-and-pass/PasswordResetPage",
}
route EmailVerificationRoute { path: "/email-verification", to: EmailVerificationPage }
page EmailVerificationPage {
component: import { EmailVerificationPage } from "@src/auth/email-and-pass/EmailVerificationPage",
}
//#endregion
//#region User
route AccountRoute { path: "/account", to: AccountPage }
page AccountPage {
authRequired: true,
component: import Account from "@src/user/AccountPage"
}
query getPaginatedUsers {
fn: import { getPaginatedUsers } from "@src/user/operations",
entities: [User]
}
action updateIsUserAdminById {
fn: import { updateIsUserAdminById } from "@src/user/operations",
entities: [User]
}
//#endregion
//#region CinemaVerse Operations
query searchTMDB {
fn: import { searchTMDB } from "@src/features/search/operations",
entities: []
}
query getTrendingContent {
fn: import { getTrendingContent } from "@src/features/search/operations",
entities: []
}
query getWatchlist {
fn: import { getWatchlist } from "@src/features/watchlist/operations",
entities: [WatchItem, Episode]
}
action addToWatchlist {
fn: import { addToWatchlist } from "@src/features/watchlist/operations",
entities: [WatchItem]
}
action updateWatchItem {
fn: import { updateWatchItem } from "@src/features/watchlist/operations",
entities: [WatchItem]
}
action removeFromWatchlist {
fn: import { removeFromWatchlist } from "@src/features/watchlist/operations",
entities: [WatchItem]
}
// Episode Management Operations
query getEpisodes {
fn: import { getEpisodes } from "@src/features/watchlist/operations",
entities: [WatchItem, Episode]
}
action updateEpisode {
fn: import { updateEpisode } from "@src/features/watchlist/operations",
entities: [Episode, WatchItem]
}
action bulkUpdateEpisodes {
fn: import { bulkUpdateEpisodes } from "@src/features/watchlist/operations",
entities: [Episode, WatchItem]
}
action syncEpisodes {
fn: import { syncEpisodes } from "@src/features/watchlist/operations",
entities: [Episode, WatchItem]
}
// AI Operations
query getRecommendations {
fn: import { getRecommendations } from "@src/features/ai/operations",
entities: [WatchItem]
}
action generateSummary {
fn: import { generateSummary } from "@src/features/ai/operations",
entities: []
}
action generateReview {
fn: import { generateReview } from "@src/features/ai/operations",
entities: []
}
// Forum Operations
query getDiscussion {
fn: import { getDiscussion } from "@src/features/forum/operations",
entities: [Discussion]
}
query getComments {
fn: import { getComments } from "@src/features/forum/operations",
entities: [Comment, Discussion]
}
action createDiscussion {
fn: import { createDiscussion } from "@src/features/forum/operations",
entities: [Discussion]
}
action createComment {
fn: import { createComment } from "@src/features/forum/operations",
entities: [Comment, Discussion]
}
action updateComment {
fn: import { updateComment } from "@src/features/forum/operations",
entities: [Comment]
}
action deleteComment {
fn: import { deleteComment } from "@src/features/forum/operations",
entities: [Comment]
}
action likeComment {
fn: import { likeComment } from "@src/features/forum/operations",
entities: [Comment]
}
action dislikeComment {
fn: import { dislikeComment } from "@src/features/forum/operations",
entities: [Comment]
}
query getMovieDetails {
fn: import { getMovieDetails } from "@src/features/details/operations",
entities: []
}
query getTVDetails {
fn: import { getTVDetails } from "@src/features/details/operations",
entities: []
}
// Onboarding Operations
query createGuestSession {
fn: import { createGuestSession } from "@src/features/onboarding/operations",
entities: []
}
query getUserOnboarding {
fn: import { getUserOnboarding } from "@src/features/onboarding/operations",
entities: [UserOnboarding]
}
action updateUserOnboarding {
fn: import { updateUserOnboarding } from "@src/features/onboarding/operations",
entities: [UserOnboarding]
}
//#endregion
//#region Payment
route PricingPageRoute { path: "/pricing", to: PricingPage }
page PricingPage {
component: import PricingPage from "@src/payment/PricingPage"
}
route CheckoutRoute { path: "/checkout", to: CheckoutPage }
page CheckoutPage {
authRequired: true,
component: import Checkout from "@src/payment/CheckoutPage"
}
query getCustomerPortalUrl {
fn: import { getCustomerPortalUrl } from "@src/payment/operations",
entities: [User]
}
action generateCheckoutSession {
fn: import { generateCheckoutSession } from "@src/payment/operations",
entities: [User]
}
api paymentsWebhook {
fn: import { paymentsWebhook } from "@src/payment/webhook",
entities: [User],
middlewareConfigFn: import { paymentsMiddlewareConfigFn } from "@src/payment/webhook",
httpRoute: (POST, "/payments-webhook")
}
//#endregion
route NotFoundRoute { path: "*", to: NotFoundPage }
page NotFoundPage {
component: import { NotFoundPage } from "@src/client/components/NotFoundPage"
}