Code Monkey home page Code Monkey logo

soen-341-fall-2021-team-9-stack-bubbling-'s People

Contributors

autosleep avatar chenchenyellow avatar christsfeir avatar drakehunterk7 avatar dushaani avatar hadihw avatar massdarkness11 avatar vrajp434 avatar

Watchers

 avatar  avatar

soen-341-fall-2021-team-9-stack-bubbling-'s Issues

4.1.2 US4_Backend_Answerpage_SetBestAnswer

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

3.2.2 US3_Backtend_AnswerPage_VoteQuestion

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)

Env-setup-backend

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

2.3 US2_Display_Question_Page

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.

2.3.1.1 US2_Frontend_QuestionTemplatePage_ShowAnswers

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

Env setup for frontend

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

2.2.1 US2_Frontend_PostQuestion

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

[ENV SetUp] change the backend stack

this decision is from the last meeting, while we decide to

  1. using python
  2. using flask
  3. using MongoDB

before that, we have to delete the current backend ENV

1.1.1 US1_Frontend_Resigter

In register page
create textbox
-email address
-username
-password
-confirm password

submit button → send POST
{
“Email”: “email_address”,
"Username”: “user_name”,
“Password”: “pass_word”
}

1.2.1 US1_Frontend_Login

create textbox

  1. email address
  2. password
    submit button -> send GET
    {
    “Email”: “email_address”,
    “Password”: “pass_word”
    }

Beatify the page

The decision comes from the meeting, where we gonna Beatify the login, register and home page

Travis Ci set up

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.

sum up all the component

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

1.1.2 US1_Backend_Resigter

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)

3.3.2 US3_Backend_QuestionTemplatePage_VoteAnswer

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)

2.1.1 US2_Frontend_List_of_Questions

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

1.2.2 US1_Backend_Login

Handle user info received

  1. 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”

1.1.0 Implement 6 basic page with Navbar

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

  • Login - Register
  • Home - List of questions -- Answer page(include question and answers)
  • navbar show (Home and Login)

after login

  • Home
  • user profile
  • Navbar show(home and user profile)

2.3.1.2 US2_Backend_QuestionTemplatePage_ShowAnswers

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”
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.