2020-10-30 22:18:17 +03:00
|
|
|
app Conduit {
|
|
|
|
title: "Conduit"
|
2020-10-30 18:28:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
route "/" -> page Main
|
|
|
|
page Main {
|
|
|
|
component: import Main from "@ext/MainPage.js"
|
|
|
|
}
|
2020-10-30 22:18:17 +03:00
|
|
|
|
|
|
|
route "/login" -> page Login
|
|
|
|
page Login {
|
|
|
|
component: import Login from "@ext/LoginPage.js"
|
|
|
|
}
|
|
|
|
|
|
|
|
route "/register" -> page Signup
|
|
|
|
page Signup {
|
|
|
|
component: import Signup from "@ext/SignupPage.js"
|
|
|
|
}
|
|
|
|
|
2020-11-19 17:11:23 +03:00
|
|
|
route "/settings" -> page UserSettings
|
|
|
|
page UserSettings {
|
|
|
|
component: import UserSettings from "@ext/UserSettingsPage.js"
|
|
|
|
}
|
|
|
|
|
|
|
|
route "/@:username" -> page UserProfile
|
|
|
|
page UserProfile {
|
|
|
|
component: import UserProfile from "@ext/UserProfilePage.js"
|
|
|
|
}
|
|
|
|
|
2020-11-22 19:18:03 +03:00
|
|
|
route "/editor/:articleId?" -> page ArticleEditor
|
2020-11-20 20:22:49 +03:00
|
|
|
page ArticleEditor {
|
|
|
|
component: import ArticleEditor from "@ext/ArticleEditorPage.js"
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: Instead of articleId, we should some combination of its title and
|
|
|
|
// a random string, if I got it right. Figure out better what is the spec
|
|
|
|
// and implement it correctly.
|
|
|
|
route "/article/:articleId" -> page ArticleView
|
|
|
|
page ArticleView {
|
|
|
|
component: import ArticleView from "@ext/ArticleViewPage.js"
|
|
|
|
}
|
|
|
|
|
2020-10-30 22:18:17 +03:00
|
|
|
entity User {=psl
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
username String @unique
|
|
|
|
email String @unique
|
|
|
|
password String
|
2020-11-19 17:11:23 +03:00
|
|
|
bio String?
|
|
|
|
profilePictureUrl String?
|
2020-11-20 20:22:49 +03:00
|
|
|
articles Article[]
|
|
|
|
psl=}
|
|
|
|
|
|
|
|
// TODO: Add tags.
|
|
|
|
// TODO: Add creation and update times.
|
|
|
|
entity Article {=psl
|
2020-11-24 22:39:36 +03:00
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
title String
|
|
|
|
description String
|
|
|
|
markdownContent String
|
|
|
|
user User @relation(fields: [userId], references: [id])
|
|
|
|
userId Int
|
2020-10-30 22:18:17 +03:00
|
|
|
psl=}
|
|
|
|
|
|
|
|
auth {
|
|
|
|
userEntity: User,
|
|
|
|
methods: [ EmailAndPassword ]
|
|
|
|
}
|
|
|
|
|
|
|
|
action signup {
|
|
|
|
fn: import { signup } from "@ext/actions.js",
|
|
|
|
entities: [User]
|
2020-11-19 17:11:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
action updateUser {
|
|
|
|
fn: import { updateUser } from "@ext/actions.js",
|
|
|
|
entities: [User]
|
|
|
|
}
|
|
|
|
|
|
|
|
query getUser {
|
|
|
|
fn: import { getUser } from "@ext/queries.js",
|
|
|
|
entities: [User]
|
2020-11-20 20:22:49 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
query getArticlesByUser {
|
|
|
|
fn: import { getArticlesByUser } from "@ext/queries.js",
|
|
|
|
entities: [Article]
|
|
|
|
}
|
|
|
|
|
|
|
|
query getArticle {
|
|
|
|
fn: import { getArticle } from "@ext/queries.js",
|
|
|
|
entities: [Article]
|
|
|
|
}
|
|
|
|
|
|
|
|
action createArticle {
|
|
|
|
fn: import { createArticle } from "@ext/actions.js",
|
|
|
|
entities: [Article]
|
|
|
|
}
|
|
|
|
|
|
|
|
action updateArticle {
|
|
|
|
fn: import { updateArticle } from "@ext/actions.js",
|
|
|
|
entities: [Article]
|
|
|
|
}
|
|
|
|
|
|
|
|
action deleteArticle {
|
|
|
|
fn: import { deleteArticle } from "@ext/actions.js",
|
|
|
|
entities: [Article]
|
2020-11-24 22:39:36 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {=json
|
|
|
|
"react-markdown": "5.0.3",
|
|
|
|
"moment": "2.29.1"
|
|
|
|
json=}
|