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-24 23:10:26 +03:00
|
|
|
route "/editor/:articleSlug?" -> page ArticleEditor
|
2020-11-20 20:22:49 +03:00
|
|
|
page ArticleEditor {
|
|
|
|
component: import ArticleEditor from "@ext/ArticleEditorPage.js"
|
|
|
|
}
|
|
|
|
|
2020-11-24 23:10:26 +03:00
|
|
|
route "/article/:articleSlug" -> page ArticleView
|
2020-11-20 20:22:49 +03:00
|
|
|
page ArticleView {
|
|
|
|
component: import ArticleView from "@ext/ArticleViewPage.js"
|
|
|
|
}
|
|
|
|
|
2020-10-30 22:18:17 +03:00
|
|
|
entity User {=psl
|
2020-11-25 00:57:14 +03:00
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
username String @unique
|
|
|
|
email String @unique
|
|
|
|
password String
|
|
|
|
bio String?
|
2020-11-19 17:11:23 +03:00
|
|
|
profilePictureUrl String?
|
2020-11-25 00:57:14 +03:00
|
|
|
|
|
|
|
articles Article[]
|
|
|
|
comments Comment[]
|
2020-11-27 00:48:35 +03:00
|
|
|
favoriteArticles Article[] @relation("FavoritedArticles")
|
2020-11-20 20:22:49 +03:00
|
|
|
psl=}
|
|
|
|
|
|
|
|
entity Article {=psl
|
2020-11-24 22:39:36 +03:00
|
|
|
id Int @id @default(autoincrement())
|
2020-11-24 23:10:26 +03:00
|
|
|
slug String @unique
|
2020-11-24 22:39:36 +03:00
|
|
|
createdAt DateTime @default(now())
|
2020-11-24 23:10:26 +03:00
|
|
|
updatedAt DateTime @updatedAt
|
2020-11-24 22:39:36 +03:00
|
|
|
title String
|
|
|
|
description String
|
|
|
|
markdownContent String
|
2020-11-25 00:57:14 +03:00
|
|
|
|
2020-11-24 22:39:36 +03:00
|
|
|
user User @relation(fields: [userId], references: [id])
|
|
|
|
userId Int
|
2020-11-25 00:57:14 +03:00
|
|
|
comments Comment[]
|
2020-11-25 18:25:26 +03:00
|
|
|
tags ArticleTag[]
|
2020-11-27 00:48:35 +03:00
|
|
|
favoritedBy User[] @relation("FavoritedArticles")
|
2020-11-25 00:57:14 +03:00
|
|
|
psl=}
|
|
|
|
|
|
|
|
entity Comment {=psl
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
createdAt DateTime @default(now())
|
|
|
|
content String
|
|
|
|
|
|
|
|
user User @relation(fields: [userId], references: [id])
|
|
|
|
userId Int
|
|
|
|
article Article @relation(fields: [articleId], references: [id])
|
|
|
|
articleId Int
|
2020-10-30 22:18:17 +03:00
|
|
|
psl=}
|
|
|
|
|
2020-11-25 18:25:26 +03:00
|
|
|
entity ArticleTag {=psl
|
|
|
|
name String @id
|
|
|
|
|
|
|
|
articles Article[]
|
|
|
|
psl=}
|
|
|
|
|
2020-10-30 22:18:17 +03:00
|
|
|
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]
|
|
|
|
}
|
|
|
|
|
2020-11-27 00:48:35 +03:00
|
|
|
query getFavoritedArticles {
|
|
|
|
fn: import { getFavoritedArticles } from "@ext/queries.js",
|
|
|
|
entities: [Article]
|
|
|
|
}
|
|
|
|
|
2020-11-20 20:22:49 +03:00
|
|
|
query getArticle {
|
|
|
|
fn: import { getArticle } from "@ext/queries.js",
|
|
|
|
entities: [Article]
|
|
|
|
}
|
|
|
|
|
2020-11-25 00:57:14 +03:00
|
|
|
query getArticleComments {
|
|
|
|
fn: import { getArticleComments } from "@ext/queries.js",
|
|
|
|
entities: [Comment]
|
|
|
|
}
|
|
|
|
|
2020-11-20 20:22:49 +03:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2020-11-27 00:48:35 +03:00
|
|
|
action setArticleFavorited {
|
|
|
|
fn: import { setArticleFavorited } from "@ext/actions.js",
|
|
|
|
entities: [Article]
|
|
|
|
}
|
|
|
|
|
2020-11-25 00:57:14 +03:00
|
|
|
action createComment {
|
|
|
|
fn: import { createComment } from "@ext/actions.js",
|
|
|
|
entities: [Comment]
|
|
|
|
}
|
|
|
|
|
|
|
|
action deleteComment {
|
|
|
|
fn: import { deleteComment } from "@ext/actions.js",
|
|
|
|
entities: [Comment]
|
|
|
|
}
|
|
|
|
|
2020-11-26 18:35:38 +03:00
|
|
|
query getTags {
|
|
|
|
fn: import { getTags } from "@ext/actions.js",
|
|
|
|
entities: [ArticleTag, Article]
|
|
|
|
}
|
|
|
|
|
2020-11-24 22:39:36 +03:00
|
|
|
dependencies {=json
|
2020-11-25 00:57:14 +03:00
|
|
|
"prop-types": "15.7.2",
|
2020-11-24 22:39:36 +03:00
|
|
|
"react-markdown": "5.0.3",
|
2020-11-24 23:10:26 +03:00
|
|
|
"moment": "2.29.1",
|
|
|
|
"slug": "4.0.2"
|
2020-11-24 22:39:36 +03:00
|
|
|
json=}
|