Giter Site home page Giter Site logo

stacktraceexception's People

Contributors

baabochka avatar limboaz avatar

Watchers

 avatar  avatar  avatar

stacktraceexception's Issues

Login and signup pages

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).

Complete POST /answers/{id}/upvote

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

Make emails unique

For some reason it is currently possible to have two users with the same email. Time to investigate.

Complete POST /answers/{id}/accept

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

Search through questions

Message Queue

Setup a RabbitMQ instance to distribute requests.

GET /user/{username}/questions and /user/{username}/answers

Gets questions posted by user with {username}Returns status: “OK” or “error”questions: array of question ids posted by this user

Gets answers posted by user with {username}Returns status: “OK” or “error”answers: array of answer ids posted by this user

/questions/{id} DELETE

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 for frontend

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.

GET /user/{username}

Gets user profile information for user with {username}
Returns
status: “OK” or “error”
user: {
email: string
reputation: int
}

Update the models

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.

Logstash

Create a logging center for the system.

Update POST /search

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
}

Complete POST /questions/{id}/upvote

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

Add error messages to error responses

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.

Complete GET /media/{id}

Parameters:
id from req.params i.e. /media/7dsu1j

Description:
Gets media file by {id}

Returns media file (image or video)

Complete POST /addmedia

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

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.