limboaz / stacktraceexception Goto Github PK
View Code? Open in Web Editor NEWThe course project for CSE356.
The course project for CSE356.
The necessary frontend pages to create, verify, and login a user, which correlate to the
/adduser, /verify, and /login, /logout api endpoints (as in those pages should submit requests to these endpoints).
Specifically complete
POST /questions/add
POST /questions/{id}/answers/add
Related to issue #4
Post parameters:
{upvote: Boolean} (default true)
Description:
Upvotes or downvotes the answer (in/decrements) score
Upvoting an already upvoted answer (by the same user) should undo the upvote, and vice versa.
Increments/decrements the reputation of the answerer. Reputation must always be >= 1.
User must be logged in to upvote.
Returns
{status: “OK”/“error”}
For some reason it is currently possible to have two users with the same email. Time to investigate.
Title says all
Parameters:
None
Description:
Accepts an answer
Should only succeed if logged in user is original asker of associated question.
Updates accepted_answer_id in question
Returns
{status: “OK”/“error”}
Some special cases:
If there's already an accepted answer then it should return {status:"error"}
Search through questions
Setup a RabbitMQ instance to distribute requests.
Similar to #12 but for answers
Gets answers posted by user with {username}Returns status: “OK” or “error”answers: array of answer ids posted by this user
Delete question with {id} Should only succeed deleting if logged in user is original asker. Result in HTTP status code 200 OK on Success anything other than 2xx on Failure
Set up load balancer on 152.44.41.174 to route requests to 152.44.36.183 and 209.50.56.141
Preferably create an ansible playbook to quickly bring up load balancers that will route to provided ips. This ansible role seems useful https://github.com/mrlesmithjr/ansible-nginx-load-balancer
You can ssh into 152.44.41.174 using root with password: vpgr8u6v, also add your own public ssh key into the ~/.ssh/authorized_keys file.
So set up load balancer first, and if desired create/find an ansible playbook.
Gets user profile information for user with {username}
Returns
status: “OK” or “error”
user: {
email: string
reputation: int
}
Create a model of a Question to be stored in the database, similar to creating a model for a User. The question model should include everything in the /questions/{id} GET request, that is
question: {
id: string
user: {
id: string
username: string
reputation: int
}
body: string
score: int
view_count: int
answer_count: int
timestamp: timestamp, represented as Unix time
media: array of associated media IDs
tags: array of tags
accepted_answer_id: id of accepted answer, if there exists one. Null otherwise
}
The User model should also be reflected to include the reputation and id, also consider that it should be possible to retrieve an array of answers for a question relatively easily as dictated by the /questions/{id}/answers GET request. So that may influence the Answer model. Anything specified in the document should be a part of the Model in some way but feel free to add things that may make certain aspects easier.
These don't have to be the same page, as long as there exists some page that makes the api calls to add a question and one to get a question.
Specifically complete
GET /questions/{id}/answers
GET /questions/{id}
Create a logging center for the system.
New Parameters:
sort_by: {
Order returned questions by “time” or by “score”
String, optional
Default: score
}
tags: {
Return only questions which have all of these tags (AND).
Array of strings, optional
}
has_media: {
Return questions with media only
Boolean - if true, exclude all questions that do not have an associated media, optional
Default: false
}
accepted: {
only return questions with accepted answers
boolean, optional
Default: false
}
DELETE /questions/{id}
delete associated media file(s), and answers
Parameters:
{upvote: Boolean} (Default: true)
Description:
Upvotes or downvotes the question (in/decrements) score
Upvoting an already upvoted question (by the same user) should undo the upvote, and vice versa.
Increments/decrements the reputation of the asker. Reputation must always be >=1.
Returns
{status: “OK”/“error”}
Similar to #14
Now if there's an error it is required that the response be:
{status:"error", error: //some appropriate error message}
So the status should be lowercase and a message should be sent along with it.
Parameters:
id from req.params i.e. /media/7dsu1j
Description:
Gets media file by {id}
Returns media file (image or video)
Parameters:
content: binary content of file being uploaded
Type is multipart/form-data i.e. we'll need multer
Description:
Adds a media file (photo or video)
Returns
{ status: “OK”/“error”, id: ID of uploaded media, error: error message (if error) }
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.