Open frasermcc9 opened 2 years ago
see below
Peter's list is very comprehensive, to add on top it , we need some GET requests for the NavBar:
Currently available endpoints:
" /api/v1/posts"
"/api/v1/posts/:id"
"/api/v1/posts/:id/comments"
"/api/v1/posts/:id/comments/:id"
"'/api/v1/users"
'/api/v1/users/login'
'/api/v1/users/logout'
'/api/v1/users/:id'
'/api/v1/reset'
'/api/v1/resample'
for detailed request body structure or response structure, see backend code
[API Required]
login: POST
signup: POST
forget password: POST
const signUp ={
email: 'test@gmail.com',
username: 'Ronald',
passwordHash: ''
}
const login = {
email: '',
passwordHash: '',
}
//send a link to email to reset password :) Good Luck
const forgetPassword = {
email: ''
}
[GET API Required] list of popular Communities
[GET API Required] list of popular posts in preview form
this is the page for a single community. It probably needs the id of the community in its path
const communityInfo = {
name: "good name",
description: "",
img: "<https://picsum.photos/400/300>"
}
[POST API Required] we probably need request to join and unjoined a community
[GET API Required] list of posts in preview under the particular community
Note: we also need to upload a image here
[POST API Required] create a new community
const newCommunity = {
name: "good name",
description: "",
img: "<https://picsum.photos/400/300>"
}
/CommunitiesPage
[GET API Required] show a list of communities
[GET API Required] show a list of communities by searching it. parameter=”SearchText”
[POST API Required] we probably need request to join and unjoined a community
[GET API Required] Get a list of posts
[GET API Required] show a list of posts by searching it
[GET API Required] /post/:id to get detailed post information
[POST API Required] There is also where you can upvote or downvote a comment
[POST API Required] You can create new comments for the post.
Note: we also need to upload an image here
A new post can have
const newPost = {
title: "",
community:"", //something that points to an existing community/forum
text: "",
img: "" // a single image
}
{
id:"", // mongoID
communityId: "", //id link to community schema
userId: "", // id link to user schema
time: "23:57", // unix time maybe?
title: "sjngosnhpmre",
text: "I love react and react libraries but I have never used Semantic UI... I heard from a teammate that it’s pretty easy to use and has a lot of documentation so hopefully I’ll be fine. Any tips...",
images: [""],// list of images url
upvotes: 534,
downvotes: 352,
commentsArray:[
{
id:"",// mongoID
comment: "I love react and react libraries but I have never used Semantic UI... I heard from a teammate that it’s pretty easy to use and has a lot of documentation so hopefully I’ll be fine. Any tips for using this new frontend framework?",
commentUpvotes: 456,
commentDownvotes: 352,
commentUpi: "shr23456",
commentTime: "23:57" // or UNIX time
},
...
]
}
{
id:"",// mongoID
comment: "I love react and react libraries but I have never used Semantic UI... I heard from a teammate that it’s pretty easy to use and has a lot of documentation so hopefully I’ll be fine. Any tips for using this new frontend framework?",
commentUpvotes: 456,
commentDownvotes: 352,
commentUpi: "shr23456",
commentTime: "23:57" // or UNIX time??
}
{
id: "", // mongoID
community: "SOFTENG 701",// mongoID
members: "150",
description:
"A fun project-driven course emphasising teamwork. This is a very cool course where you can learn lots of things from peers and lecturers.",
image: "<https://picsum.photos/400/300>"
}
{
id: "",
email: "",
username: "",
passwordHash: "",
posts:[], // list of post id
communities:[] // list of community id
}
Description
We need to connect the frontend with the backend.
Tasks