drakehunterk7 / soen-341-fall-2021-team-9-stack-bubbling- Goto Github PK
View Code? Open in Web Editor NEWA Stack Overflow Clone - SOEN341 Project for Fall 2021 - Concordia University
A Stack Overflow Clone - SOEN341 Project for Fall 2021 - Concordia University
Backend will handle the data from frontend
Update the database where this answer’s is_best_answer change to true
and other answers of this question become false
return list of answer,
frontend refresh page
status of is_best_answer :
true -> best_answer icon
null -> display best_answer_button
false -> not the best answer
Handle POST, received post_id, User_ID, IsUpvote
update database of voteCount in the database
Go to User with User_ID
Check its Votes to see : // (increment/ decrement the vote count)
If Votes contains Post_ID
Check:
If Vote.IsUpvote == IsUpvote
// We are cancelling a vote
Delete this Vote
Go to Question with Post_ID
If IsUpvote == true
Question.Vote_Count -= 1
Else
Question.Vote_Count += 1
Else
Set Vote.IsUpvote = IsUpvote
If IsUpvote == true
// We changed our vote from Down to Up
Question.Vote_Count += 2
Else
// We changed our vote from Up to Down
Question.Vote_Count -= 2
Else
// We haven’t vote for this question, we are voting now, first time
Create Vote with Post_ID, User_ID and IsUpvote
If IsUpvote == true
Question.Vote_Count += 1
Else
Question.Vote_Count -= 1
also update the user table (voteList)
we need to have env setup for the backend
since we are not decided which language for the backend
we will discuss it in the next meeting
As an owner of a question, I want to be able to mark an answer as "best answer", so that I can tell others that this answer is the most helpful for me and it solved my problem.
Related epic story #21
When we click on a question, it should take us to a separate page for that question. This page should also display the answers to this question, if any.
As an User of the website, I want to be able to view people's post, so that I can look for the solution of my problems.
On the Answer page, all the questions will be on the top
show question info (which this info will props form list of question page)
{
question_id: ”question_id”,
Question_Title: “question_title”,
Question_body: “question_text”,
User_Id: “User_Id”,
createdTime: time,
vote_count: “vote_count”
answerObject:{
post_id: ”question_id”,
User_Id: “User_Id”,
answer_body: “question_text”,
createdTime: time,
vote_count: “vote_count
}
}
Send GET: get all the answer info
{
post_id: post_id
}
When receiving data for getting
Show all Answers info
Create textbox_answer
Create button_submit
As an User of the website, I want to be able to ask a question, so that others can help me solve my problem.
Related to epic story #19
Story Points: 3
For the frontend, add the vote buttons to the AnswerBox REACT Component
In this project, we will use Reactjs as a frontend framework, and also using Axios to do the HTTP request
The UI part parts will be discussed in the next meeting
As an User of the website, I want to be able to login with my account, so that all my activities will be tracked.
As an User of the website, I want to be able to upvote or downvote an answer of a question, so that I tell other if that answer is useful for me or not.
Related to epic story #20
Story Points: 1
Risk: low value, low risk
Priority: low
If a session is on (an User is logon)
Create Textbox_Question_Title
Create Textbox_Question_Body
Create Button_Submit
Send POST -> info
{
Question_Title: “question_title”,
Question_body: “question_text”,
User_Id: id
createdTime: time
}
When received data, go to the list_of_question page
Handle POST, answer data received
Generate an Answer_ID
Add Answer to database
return 200(OK)
this decision is from the last meeting, while we decide to
before that, we have to delete the current backend ENV
need to set up database in this project
In register page
create textbox
-email address
-username
-password
-confirm password
submit button → send POST
{
“Email”: “email_address”,
"Username”: “user_name”,
“Password”: “pass_word”
}
As an User of the website, I want to be able to log out, so that other user of my computer won't be able to use my account without my permission.
beak the session (we will think about this task during the project)
Handle POST, question data received
Add Question to database
return status
create textbox
The decision comes from the meeting, where we gonna Beatify the login, register and home page
Backend Post Answer asking user_id from usercollection,
but now we use _id as user_id in usercolleciton
this is one of the requirements from the grading schema
For the current stage, we don't need to write any test case, set up the env only.
Backend post question is asking user_id from user collection
But user collection now uses _id instead of user_id
Query entirety of [Questions] of database
return 200
with body = entirety of [Questions] of database
Create a best answer button, once owner click one of the answer in answer list, that answer will be label as best answer and show the icon
send post
{
post_id
user_id
}
All the page's components stay in the header now.
Can you put them on the home page?
it is a better place to place them in
Create button_upvote
Create button_downvote
Send POST
{
post_id_of_question
post_id_of_answer
user_id
isUpVote
}
handle user info received
check if the username and email address exist
if exist
return 201(errors)
with msg{email address and username is used}
if not exist
update the user info to the database
return 200(OK)
The description of README is not that cleaner. After review other group's README, they have cleaner descriptions and a better format of the README
Fetch all questions from the database and display them on the question list page one by one using the proper format and the QuestionPreviewTemplate REACT Component
Handle POST, received question_id, answer_id, User_Token, IsUpvote
update database of voteCount in the database
Go to User with User_ID
Check its Votes to see : // (increment/ decrement the vote count)
If Votes contains Post_ID
Check:
If Vote.IsUpvote == IsUpvote
// We are cancelling a vote
Delete this Vote
Go to Question with Post_ID_of_Question
Go to Answer with Post_ID_of_Answer
If IsUpvote == true
Answer.Vote_Count -= 1
Else
Answer.Vote_Count += 1
Else
Set Vote.IsUpvote = IsUpvote
If IsUpvote == true
// We changed our vote from Down to Up
Answer.Vote_Count += 2
Else
// We changed our vote from Up to Down
Answer.Vote_Count -= 2
Else
// We haven’t vote for this answer, we are voting now, first time
Create Vote with Post_ID_of_Answer, User_ID and IsUpvote
If IsUpvote == true
Answer.Vote_Count += 1
Else
Answer.Vote_Count -= 1
also update the user table (voteList)
once the user goes to the home page (list of question page)
send a request GET and get a response
{
question_id: ”question_id”,
question_title: question_title””,
question_body: “question_body”,
username: ”user_name”
creation_time:”creation_time”,
voting_id:”voting_id”,
voting_count:”voting_count”
}
render response (question info) to this page
Handle user info received
Check if email exists in the database
If exist Compare Password in the database with the Password received
If identical
Create a session (this is not the final decision)
return this session
Or return OK with token
Else return a error with message “Password not valid”
Else return errors with the message “Password not valid”
implement 6 basic pages - (Home, Login, register, list of questions, answer page, user profile) with a navbar on the top
structure of the page
non - login user
after login
Handle GET, Question_ID received,
Query all Answers that have this Question_ID
return all Answers info that has this Question_ID
{
username : ”user_name”,
answer_id: ”answer_id”,
answer_body : “answer_body”
creation_time: ”creation_time”
vote_count: “vote_count”
}
Create button_upvote
Create button_downvote
Send POST
{
post_id
user_id
isUpVote :bool
}
Backend Login api require a confirmPassword, which is not needed
— As logged user, I would like to see all answer that i answer before (frontend)
As a User of the website, I want be able to register for a personnel account, so that I can keep track of my activities.
As an User of the website, I want to be able to post an answer under a question, so that I can solve the problem of others.
Related to epic story #19
Story Points: 5
display answer’s vote_count property (props from list of answer page)
— As a logged user, I would like to see all my question being posted(backend)
Send POST:
info
{
user_id:”uer_id”,
answer_body:”answer_body”,
created_time:”created_time”
}
refresh the page of answer part after the answer posted
— As a logged user, I would like to see all answers that I answer before (backend)
Please update the README.MD to show the new tech stack we will be working with as we discussed on the meeting of September 27th, 2021. If you have any questions, please contact me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.