Project 3

This assignment is to write a question-and-answer application like Stack Overflow. It is due on April 5, 2016.

Attention

This is a team assignment, so you must complete and submit it with your team.

Change Log

March 30
Added note that the user's vote should be indicated.

Overview

In this assignment, you will be writing a Q&A site like Stack Overflow. Your site will not have nearly so many features as Stack Overflow, but it will still be the most complex application you have built so far.

You'll make good use of the following:

  • Python & Flask
  • HTML & CSS
  • User sessions and authentication
  • Storing data in a database with SQLAlchemy
  • Small client-side JavaScript interactions

Hint

Assignment 2 has significant conceptual overlap with several parts of this assignment.

Requirements

Your application needs to support the following:

  1. Users can create accounts, log in, and log out. Accounts should be protected with a username and password.
  2. Users can post questions; each question has a subject (as a text input field) and a question body (as a textarea); the question body should be treated as Markdown.
  3. The front page should display:
    • The log in/out/current user controls
    • A link or button to ask a question
    • The 25 most recently-asked questions (their titles, ask dates, who asked them, and how many answers they have).
  4. Questions should have their own pages, with URLs like /questions/2310, that display:
    • The question
    • The answers
    • A form to post an answer to a question
    • A link back up to the main index
  5. When a user posts a question or an answer, the POST handler should redirect them to the question's page.
  6. Add support for voting on answers:
    • For each answer in the question page, show vote up/down buttons and the net votes received (upvotes minus downvotes).
    • Use JavaScript to handle clicks on the vote buttons and register a vote up or down.
    • Sort answers by votes, with the most highly-rated answer at the top.
    • If a user has cast a vote, the vote they have cast should be indicated (e.g. the thumbs-up should be filled instead of open).
  7. Style things with Pure CSS.
  8. Store all data in an SQLite database using SQLAlchemy.

Note

For this assignment, I am not providing a step-by-step breakdown like I did in earlier assignments.

Extra Credit

Add tags, where each question can have one or more tags. The tags should be displayed on both the front page and the question page, and they should be links to a tag page that shows all questions with that tag.