wasp/mage/main.wasp

223 lines
5.5 KiB
JavaScript
Raw Normal View History

2023-06-15 23:19:01 +03:00
app waspAi {
wasp: {
2024-03-19 18:43:33 +03:00
version: "^0.13.0"
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\" />",
2024-11-14 19:17:26 +03:00
"<script defer data-domain=\"usemage.ai\" data-api=\"/waspara/wasp/event\" src=\"/waspara/wasp/script.js\"></script>",
2023-06-30 15:14:34 +03:00
],
2023-06-19 18:28:36 +03:00
client: {
rootComponent: import { RootComponent } from "@src/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,
methods: {
2023-10-03 15:58:59 +03:00
gitHub: {
configFn: import { getGitHubAuthConfig } from "@src/server/auth.js",
userSignupFields: import { gitHubUserSignupFields } from "@src/server/auth.ts",
2023-10-03 15:58:59 +03:00
},
2023-07-03 18:26:17 +03:00
google: {
configFn: import { getGoogleAuthConfig } from "@src/server/auth.js",
userSignupFields: import { googleUserSignupFields } from "@src/server/auth.ts",
2023-10-03 15:58:59 +03:00
},
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 {
component: import Main from "@src/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 "@src/client/pages/ResultPage.jsx"
2023-06-21 13:37:02 +03:00
}
route UserRoute { path: "/user", to: UserPage }
page UserPage {
component: import { UserPage } from "@src/client/pages/UserPage.jsx",
authRequired: true
}
2023-07-03 15:45:50 +03:00
route StatsRoute { path: "/stats", to: StatsPage }
page StatsPage {
component: import { Stats } from "@src/client/pages/StatsPage.jsx",
2023-07-03 18:26:17 +03:00
authRequired: true
}
2023-07-15 13:42:20 +03:00
route FeedbackRoute { path: "/feedback", to: FeedbackPage }
page FeedbackPage {
component: import { Feedback } from "@src/client/pages/FeedbackPage.jsx",
2023-07-15 13:42:20 +03:00
authRequired: true
}
2023-07-03 18:26:17 +03:00
route LoginRoute { path: "/login", to: LoginPage }
page LoginPage {
component: import { LoginPage } from "@src/client/pages/LoginPage.jsx",
2023-07-03 15:45:50 +03:00
}
action startGeneratingNewApp {
fn: import { startGeneratingNewApp } from "@src/server/operations.js",
2023-06-28 12:38:48 +03:00
entities: [
Project,
]
}
action registerZipDownload {
fn: import { registerZipDownload } from "@src/server/operations.js",
entities: [Project]
}
2023-07-15 13:42:20 +03:00
action createFeedback {
fn: import { createFeedback } from "@src/server/operations.js",
2023-07-15 13:42:20 +03:00
entities: [Feedback]
}
action deleteMyself {
fn: import { deleteMyself } from "@src/server/operations.js",
entities: [User, Project, File, Log]
}
2023-07-15 13:42:20 +03:00
query getFeedback {
fn: import { getFeedback } from "@src/server/operations.js",
2023-07-15 13:42:20 +03:00
entities: [Feedback]
}
query getProjectsByUser {
fn: import { getProjectsByUser } from "@src/server/operations.js",
entities: [Project]
}
2023-07-15 13:42:20 +03:00
query getAppGenerationResult {
fn: import { getAppGenerationResult } from "@src/server/operations.js",
2023-06-28 12:38:48 +03:00
entities: [
Project
]
}
2023-12-12 19:46:03 +03:00
query getProjects {
fn: import { getProjects } from "@src/server/operations.js",
2023-12-12 19:46:03 +03:00
entities: [
Project
]
}
2023-07-03 15:45:50 +03:00
query getStats {
fn: import { getStats } from "@src/server/operations.js",
2023-07-03 15:45:50 +03:00
entities: [
Project
]
}
2023-10-03 15:58:59 +03:00
query getNumProjects {
fn: import { getNumProjects } from "@src/server/operations.js",
2023-10-03 15:58:59 +03:00
entities: [
Project
]
}
2023-07-03 18:26:17 +03:00
entity User {=psl
id Int @id @default(autoincrement())
email String?
username String?
2023-07-03 18:26:17 +03:00
projects Project[]
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 "@src/server/jobs/checkForPendingApps.js"
},
entities: [Project]
}
job failStaleAppsJobs {
executor: PgBoss,
schedule: {
cron: "* * * * *",
},
perform: {
fn: import { failStaleGenerations } from "@src/server/jobs/failStaleGenerations.js",
},
entities: [Project, Log]
}
job generateAppJob {
executor: PgBoss,
perform: {
fn: import { generateApp } from "@src/server/jobs/generateApp.js",
},
entities: [
Project,
File,
Log
]
}