2023-06-15 23:19:01 +03:00
app waspAi {
wasp : {
2024-02-26 18:25:47 +03:00
version : "^0.12.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 : [
2023-11-07 13:24:57 +03:00
"<meta property=\"og:title\" content=\"MAGE GPT Web App Generator ✨ MageGPT\">" ,
2023-06-30 15:47:09 +03:00
"<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\">" ,
2023-10-02 15:12:59 +03:00
"<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\" />" ,
2023-11-19 00:18:50 +03:00
"<script defer data-domain=\"usemage.ai\" src=\"https://plausible.apps.twoducks.dev/js/script.js\"></script>" ,
2023-06-30 15:14:34 +03:00
] ,
2023-06-19 18:28:36 +03:00
client : {
2024-02-26 18:25:47 +03:00
rootComponent : import { RootComponent } from "@src/client/RootComponent.jsx" ,
2023-06-28 12:38:48 +03:00
} ,
db : {
2024-02-26 18:25:47 +03:00
system : PostgreSQL ,
2023-07-03 18:26:17 +03:00
} ,
auth : {
userEntity : User ,
methods : {
2023-10-03 15:58:59 +03:00
gitHub : {
2024-02-26 18:25:47 +03:00
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 : {
2024-02-26 18:25:47 +03:00
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
} ,
2023-11-07 13:24:57 +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 {
2024-02-26 18:25:47 +03:00
component : import Main from "@src/client/pages/MainPage.jsx"
2023-06-16 16:43:16 +03:00
}
2023-06-21 13:37:02 +03:00
route ResultRoute { path : "/result/:appId" , to : ResultPage }
page ResultPage {
2024-02-26 18:25:47 +03:00
component : import { ResultPage } from "@src/client/pages/ResultPage.jsx"
2023-06-21 13:37:02 +03:00
}
2023-11-07 13:24:57 +03:00
route UserRoute { path : "/user" , to : UserPage }
page UserPage {
2024-02-26 18:25:47 +03:00
component : import { UserPage } from "@src/client/pages/UserPage.jsx" ,
2023-11-07 13:24:57 +03:00
authRequired : true
}
2023-07-03 15:45:50 +03:00
route StatsRoute { path : "/stats" , to : StatsPage }
page StatsPage {
2024-02-26 18:25:47 +03:00
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 {
2024-02-26 18:25:47 +03:00
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 {
2024-02-26 18:25:47 +03:00
component : import { LoginPage } from "@src/client/pages/LoginPage.jsx" ,
2023-07-03 15:45:50 +03:00
}
2023-06-16 16:43:16 +03:00
action startGeneratingNewApp {
2024-02-26 18:25:47 +03:00
fn : import { startGeneratingNewApp } from "@src/server/operations.js" ,
2023-06-28 12:38:48 +03:00
entities : [
Project ,
]
2023-06-16 16:43:16 +03:00
}
2023-07-14 13:10:55 +03:00
action registerZipDownload {
2024-02-26 18:25:47 +03:00
fn : import { registerZipDownload } from "@src/server/operations.js" ,
2023-07-14 13:10:55 +03:00
entities : [ Project ]
}
2023-07-15 13:42:20 +03:00
action createFeedback {
2024-02-26 18:25:47 +03:00
fn : import { createFeedback } from "@src/server/operations.js" ,
2023-07-15 13:42:20 +03:00
entities : [ Feedback ]
}
2023-11-23 12:42:03 +03:00
action deleteMyself {
2024-02-26 18:25:47 +03:00
fn : import { deleteMyself } from "@src/server/operations.js" ,
2023-11-23 12:42:03 +03:00
entities : [ User , Project , File , Log ]
}
2023-07-15 13:42:20 +03:00
query getFeedback {
2024-02-26 18:25:47 +03:00
fn : import { getFeedback } from "@src/server/operations.js" ,
2023-07-15 13:42:20 +03:00
entities : [ Feedback ]
}
2023-11-07 13:24:57 +03:00
query getProjectsByUser {
2024-02-26 18:25:47 +03:00
fn : import { getProjectsByUser } from "@src/server/operations.js" ,
2023-11-07 13:24:57 +03:00
entities : [ Project ]
}
2023-07-15 13:42:20 +03:00
2023-06-16 16:43:16 +03:00
query getAppGenerationResult {
2024-02-26 18:25:47 +03:00
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 {
2024-02-26 18:25:47 +03:00
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 {
2024-02-26 18:25:47 +03:00
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 {
2024-02-26 18:25:47 +03:00
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 ( ) )
2024-02-26 18:25:47 +03:00
email String ?
2023-11-07 13:24:57 +03:00
username String ?
2023-07-03 18:26:17 +03:00
2024-02-26 18:25:47 +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" )
2023-07-12 17:16:21 +03:00
creativityLevel String @ default ( "balanced" )
2023-06-28 12:38:48 +03:00
createdAt DateTime @ default ( now ( ) )
2023-07-04 14:05:04 +03:00
status String @ default ( "pending" )
2023-07-14 13:10:55 +03:00
referrer String @ default ( "unknown" )
zipDownloadedAt DateTime ?
2023-07-04 14:05:04 +03:00
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 = }
2023-07-04 14:05:04 +03:00
job checkPendingAppsJob {
executor : PgBoss ,
schedule : {
cron : "* * * * *" ,
} ,
perform : {
2024-02-26 18:25:47 +03:00
fn : import { checkForPendingApps } from "@src/server/jobs/checkForPendingApps.js"
2023-07-04 14:05:04 +03:00
} ,
entities : [ Project ]
}
job failStaleAppsJobs {
executor : PgBoss ,
schedule : {
cron : "* * * * *" ,
} ,
perform : {
2024-02-26 18:25:47 +03:00
fn : import { failStaleGenerations } from "@src/server/jobs/failStaleGenerations.js" ,
2023-07-04 14:05:04 +03:00
} ,
entities : [ Project , Log ]
}
job generateAppJob {
executor : PgBoss ,
perform : {
2024-02-26 18:25:47 +03:00
fn : import { generateApp } from "@src/server/jobs/generateApp.js" ,
2023-07-04 14:05:04 +03:00
} ,
entities : [
Project ,
File ,
Log
]
}