wasp/mage/main.wasp

253 lines
6.2 KiB
JavaScript
Raw Normal View History

2023-06-15 23:19:01 +03:00
app waspAi {
wasp: {
version: "^0.11.5"
2023-06-15 23:19:01 +03:00
},
2023-10-03 15:58:59 +03:00
title: "MAGE - GPT Web App Generator ✨",
2023-06-30 15:14:34 +03:00
head: [
"<meta property=\"og:title\" content=\"MAGE GPT Web App Generator ✨ MageGPT\">",
"<meta property=\"og:description\" content=\"Generate your full-stack React, Node.js and Prisma web app using the magic of GPT and the Wasp full-stack framework.\">",
2023-06-30 15:14:34 +03:00
"<meta property=\"og:type\" content=\"website\">",
"<meta property=\"og:image\" content=\"https://usemage.ai/twitter.png\">",
"<meta name=\"twitter:image\" content=\"https://usemage.ai/twitter.png\" />",
2023-08-30 17:30:14 +03:00
"<meta name=\"twitter:image:width\" content=\"800\" />",
"<meta name=\"twitter:image:height\" content=\"400\" />",
"<meta name=\"twitter:card\" content=\"summary_large_image\" />",
"<script defer data-domain=\"usemage.ai\" src=\"https://plausible.apps.twoducks.dev/js/script.js\"></script>",
2023-06-30 15:14:34 +03:00
],
dependencies: [
("prismjs", "^1.29.0"),
("react-accessible-treeview", "2.6.1"),
("react-icons", "4.10.1"),
2023-06-28 16:21:50 +03:00
("@zip.js/zip.js", "2.7.16"),
("async-mutex", "0.4.0"),
2023-06-29 23:00:05 +03:00
("@headlessui/react", "1.7.15"),
2023-06-30 14:44:59 +03:00
("@heroicons/react", "2.0.18"),
2023-07-03 15:45:50 +03:00
("react-parallax-tilt", "1.7.151"),
("timeago.js", "4.0.2"),
("@visx/mock-data", "3.0.0"),
("@visx/group", "3.0.0"),
("@visx/shape", "3.0.0"),
("@visx/scale", "3.2.0"),
("@visx/responsive", "3.0.0"),
("@visx/gradient", "3.0.0"),
2023-07-03 18:26:17 +03:00
("@visx/axis", "3.2.0"),
2023-10-03 15:58:59 +03:00
("js-confetti", "0.11.0")
],
2023-06-19 18:28:36 +03:00
client: {
rootComponent: import { RootComponent } from "@client/RootComponent.jsx",
2023-06-28 12:38:48 +03:00
},
db: {
system: PostgreSQL
2023-07-03 18:26:17 +03:00
},
auth: {
userEntity: User,
externalAuthEntity: SocialLogin,
methods: {
2023-10-03 15:58:59 +03:00
gitHub: {
configFn: import { getGitHubAuthConfig } from "@server/auth.js",
getUserFieldsFn: import { getGitHubUserFields } from "@server/auth.js",
},
2023-07-03 18:26:17 +03:00
google: {
configFn: import { getGoogleAuthConfig } from "@server/auth.js",
2023-10-03 15:58:59 +03:00
getUserFieldsFn: import { getGoogleUserFields } from "@server/auth.js",
},
2023-07-03 18:26:17 +03:00
},
onAuthFailedRedirectTo: "/",
2023-10-03 15:58:59 +03:00
onAuthSucceededRedirectTo: "/"
2023-06-19 18:28:36 +03:00
}
2023-06-15 23:19:01 +03:00
}
route RootRoute { path: "/", to: MainPage }
page MainPage {
2023-06-19 18:28:36 +03:00
component: import Main from "@client/pages/MainPage.jsx"
}
2023-06-21 13:37:02 +03:00
route ResultRoute { path: "/result/:appId", to: ResultPage }
page ResultPage {
component: import { ResultPage } from "@client/pages/ResultPage.jsx"
}
route UserRoute { path: "/user", to: UserPage }
page UserPage {
component: import { UserPage } from "@client/pages/UserPage.jsx",
authRequired: true
}
2023-07-03 15:45:50 +03:00
route StatsRoute { path: "/stats", to: StatsPage }
page StatsPage {
2023-07-03 18:26:17 +03:00
component: import { Stats } from "@client/pages/StatsPage.jsx",
authRequired: true
}
2023-07-15 13:42:20 +03:00
route FeedbackRoute { path: "/feedback", to: FeedbackPage }
page FeedbackPage {
component: import { Feedback } from "@client/pages/FeedbackPage.jsx",
authRequired: true
}
2023-07-03 18:26:17 +03:00
route LoginRoute { path: "/login", to: LoginPage }
page LoginPage {
component: import { LoginPage } from "@client/pages/LoginPage.jsx",
2023-07-03 15:45:50 +03:00
}
action startGeneratingNewApp {
2023-06-28 12:38:48 +03:00
fn: import { startGeneratingNewApp } from "@server/operations.js",
entities: [
Project,
]
}
action registerZipDownload {
fn: import { registerZipDownload } from "@server/operations.js",
entities: [Project]
}
2023-07-15 13:42:20 +03:00
action createFeedback {
fn: import { createFeedback } from "@server/operations.js",
entities: [Feedback]
}
action deleteMyself {
fn: import { deleteMyself } from "@server/operations.js",
entities: [User, Project, File, Log]
}
2023-07-15 13:42:20 +03:00
query getFeedback {
fn: import { getFeedback } from "@server/operations.js",
entities: [Feedback]
}
query getProjectsByUser {
fn: import { getProjectsByUser } from "@server/operations.js",
entities: [Project]
}
2023-07-15 13:42:20 +03:00
query getAppGenerationResult {
2023-06-28 12:38:48 +03:00
fn: import { getAppGenerationResult } from "@server/operations.js",
entities: [
Project
]
}
2023-12-12 19:46:03 +03:00
query getProjects {
fn: import { getProjects } from "@server/operations.js",
entities: [
Project
]
}
2023-07-03 15:45:50 +03:00
query getStats {
fn: import { getStats } from "@server/operations.js",
entities: [
Project
]
}
2023-10-03 15:58:59 +03:00
query getNumProjects {
fn: import { getNumProjects } from "@server/operations.js",
entities: [
Project
]
}
2023-07-03 18:26:17 +03:00
entity User {=psl
id Int @id @default(autoincrement())
email String @unique
username String?
2023-07-03 18:26:17 +03:00
externalAuthAssociations SocialLogin[]
projects Project[]
2023-07-03 18:26:17 +03:00
psl=}
entity SocialLogin {=psl
id String @id @default(uuid())
provider String
providerId String
userId Int
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
2023-10-03 15:58:59 +03:00
createdAt DateTime @default(now())
2023-07-03 18:26:17 +03:00
psl=}
2023-06-28 12:38:48 +03:00
entity Project {=psl
id String @id @default(uuid())
name String
description String
2023-06-30 17:53:48 +03:00
primaryColor String @default("sky")
authMethod String @default("usernameAndPassword")
creativityLevel String @default("balanced")
2023-06-28 12:38:48 +03:00
createdAt DateTime @default(now())
status String @default("pending")
referrer String @default("unknown")
zipDownloadedAt DateTime?
userId Int?
user User? @relation(fields: [userId], references: [id])
2023-06-28 12:38:48 +03:00
files File[]
logs Log[]
2023-07-15 13:42:20 +03:00
feedbacks Feedback[]
psl=}
entity Feedback {=psl
id String @id @default(uuid())
score Int
message String
createdAt DateTime @default(now())
projectId String
project Project @relation(fields: [projectId], references: [id])
2023-06-28 12:38:48 +03:00
psl=}
entity File {=psl
id String @id @default(uuid())
name String
content String
createdAt DateTime @default(now())
projectId String
project Project @relation(fields: [projectId], references: [id])
@@index([name, projectId])
psl=}
entity Log {=psl
id String @id @default(uuid())
content String
createdAt DateTime @default(now())
projectId String
project Project @relation(fields: [projectId], references: [id])
psl=}
job checkPendingAppsJob {
executor: PgBoss,
schedule: {
cron: "* * * * *",
},
perform: {
fn: import { checkForPendingApps } from "@server/jobs/checkForPendingApps.js"
},
entities: [Project]
}
job failStaleAppsJobs {
executor: PgBoss,
schedule: {
cron: "* * * * *",
},
perform: {
fn: import { failStaleGenerations } from "@server/jobs/failStaleGenerations.js",
},
entities: [Project, Log]
}
job generateAppJob {
executor: PgBoss,
perform: {
fn: import { generateApp } from "@server/jobs/generateApp.js",
},
entities: [
Project,
File,
Log
]
}