wasp/examples/waspello/main.wasp
Mihovil Ilakovac 84766299cb
Upgrades Waspello to work with latest version (#1273)
* Upgrades Waspello to work with latest version

Signed-off-by: Mihovil Ilakovac <mihovil@ilakovac.com>

* Updates instructions

---------

Signed-off-by: Mihovil Ilakovac <mihovil@ilakovac.com>
Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>
2023-06-21 19:46:51 +02:00

134 lines
2.8 KiB
JavaScript

app waspello {
wasp: {
version: "^0.11.0"
},
title: "Waspello",
db: {
system: PostgreSQL
},
auth: {
userEntity: User,
externalAuthEntity: SocialLogin,
methods: {
usernameAndPassword: {},
google: {}
},
onAuthFailedRedirectTo: "/login"
},
dependencies: [
("react-feather", "2.0.10"),
("classnames", "2.3.1"),
("react-tiny-popover", "7.1.0"),
("react-beautiful-dnd", "13.1.1")
]
}
route MainRoute { path: "/", to: Main }
page Main {
authRequired: true,
component: import Main from "@client/MainPage.jsx"
}
route SignupRoute { path: "/signup", to: Signup }
page Signup {
component: import Signup from "@client/SignupPage.jsx"
}
route LoginRoute { path: "/login", to: Login }
page Login {
component: import Login from "@client/LoginPage.jsx"
}
// Entities
entity User {=psl
id Int @id @default(autoincrement())
username String @unique
password String
lists List[]
cards Card[]
externalAuthAssociations SocialLogin[]
psl=}
entity SocialLogin {=psl
id Int @id @default(autoincrement())
provider String
providerId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
userId Int
createdAt DateTime @default(now())
@@unique([provider, providerId, userId])
psl=}
entity List {=psl
id Int @id @default(autoincrement())
name String
pos Float
// List has a single author.
user User @relation(fields: [userId], references: [id])
userId Int
cards Card[]
psl=}
entity Card {=psl
id Int @id @default(autoincrement())
title String
pos Float
// Card belongs to a single list.
list List @relation(fields: [listId], references: [id])
listId Int
// Card has a single author.
author User @relation(fields: [authorId], references: [id])
authorId Int
psl=}
// ------------------- Queries and actions
query getListsAndCards {
fn: import { getListsAndCards } from "@server/queries.js",
entities: [List, Card]
}
// Lists
action createList {
fn: import { createList } from "@server/actions.js",
entities: [List]
}
action updateList {
fn: import { updateList } from "@server/actions.js",
entities: [List]
}
action deleteList {
fn: import { deleteList } from "@server/actions.js",
entities: [List, Card]
}
action createListCopy {
fn: import { createListCopy } from "@server/actions.js",
entities: [List, Card]
}
// Cards
action createCard {
fn: import { createCard } from "@server/actions.js",
entities: [Card]
}
action updateCard {
fn: import { updateCard } from "@server/actions.js",
entities: [Card]
}