83 lines
1.9 KiB
Plaintext

app CaptionGenerator {
wasp: {
version: "^0.13.0"
},
title: "CaptionGenerator",
client: {
rootComponent: import { Layout } from "@src/Layout.jsx",
},
db: {
prisma: {
clientPreviewFeatures: ["extendedWhereUnique"]
}
},
auth: {
userEntity: User,
methods: {
usernameAndPassword: {}
},
onAuthFailedRedirectTo: "/login",
onAuthSucceededRedirectTo: "/"
},
}
route LoginRoute { path: "/login", to: LoginPage }
page LoginPage {
component: import Login from "@src/pages/auth/Login.jsx"
}
route SignupRoute { path: "/signup", to: SignupPage }
page SignupPage {
component: import Signup from "@src/pages/auth/Signup.jsx"
}
entity User {=psl
id Int @id @default(autoincrement())
captions Caption[]
psl=}
entity Caption {=psl
id Int @id @default(autoincrement())
content String
category String
user User @relation(fields: [userId], references: [id])
userId Int
psl=}
action createCaption {
fn: import { createCaption } from "@src/actions.js",
entities: [Caption],
}
action deleteCaption {
fn: import { deleteCaption } from "@src/actions.js",
entities: [Caption],
}
query getCaption {
fn: import { getCaption } from "@src/queries.js",
entities: [Caption],
}
query getCaptionsByCategory {
fn: import { getCaptionsByCategory } from "@src/queries.js",
entities: [Caption],
}
route DashboardRoute { path: "/", to: DashboardPage }
page DashboardPage {
component: import DashboardPage from "@src/pages/Dashboard.jsx",
authRequired: true
}
route CaptionCreationRoute { path: "/create-caption", to: CaptionCreationPage }
page CaptionCreationPage {
component: import CaptionCreationPage from "@src/pages/CaptionCreation.jsx",
authRequired: false
}
route CaptionRoute { path: "/caption/:captionId", to: CaptionPage }
page CaptionPage {
component: import CaptionPage from "@src/pages/Caption.jsx",
authRequired: true
}