Giter Site home page Giter Site logo

question_box's Introduction

Question Box

This Rails application provides much of the same functionality as Stack Overflow.

Models

  • User
    • requires a name
    • requires an email, which must be unique
    • requires a password
    • has many comments
    • has many votes
  • Question
    • requires a title
    • requires text
    • belongs to and requires a user
    • has many comments (polymorphic association)
    • has many votes (polymorphic association)
    • knows its total score (determined by votes)
    • has and belongs to many tags (tags being short phrases that show the topics of the question)
  • Answer
    • belongs to and requires a question
    • belongs to and requires a user
    • requires text
    • can be chosen as the correct answer
      • but only one answer per question can be chosen
      • the author of the answer gets +100 points
    • has many comments (polymorphic association)
    • has many votes (polymorphic association)
    • knows its total score (determined by votes)
  • Comment
    • belongs to and requires a user
    • belongs to and requires a "commentable" (polymorphic association)
    • requires text
  • Vote
    • belongs to a user
    • belongs to a "voteable" (polymorphic association)
    • is positive or negative (+1 or -1)
    • when a positive vote is given to something a user created (question or answer), +10 points to that user
    • when a negative vote is given to something a user created (question or answer), -5 points to that user
    • when a user makes a negative vote, -1 points to that user (yes, it costs from your score to vote something down)
  • Tag
    • has a name
    • has and belongs to many questions

question_box's People

Contributors

cndreisbach avatar geoffpurdy avatar josechirivella avatar deedeelavinder avatar nickpassarella avatar noahhh avatar vpfaulkner avatar kheang avatar

Watchers

James Cloos avatar

question_box's Issues

Question Box JSON API

Question Box needs an API! We have not yet covered how to do this, so whoever takes this on is adventuring into unknown territory.

Requirements

  • The API must emit JSON.
  • The API does not require authentication and is read-only.
  • The API should be implemented as an alternate response type on the current controller actions, or in some cases, new controller actions.
  • The following URLs should work:
    • questions.json
    • questions/:id.json
    • users/:id.json (shows user information, and a list of questions the user has asked).

Convert integration tests to Cucumber

This is a big one and not easy! You'll have to learn Cucumber on your own.

You'll convert all the existing integration tests to Cucumber and write new Cucumber features for every feature in the application, including:

  • Adding a question
  • Adding an answer
  • Selecting an answer as the chosen one

Show related questions

On the questions/show page, show a list of related questions. How you determine what is a related question is up to you.

Here are some options:

  • Compare tags between questions. The questions with the most matching tags to the current question are most related. This should be fast and easy, although you will have to write a lot of SQL.
  • Read this Stack Overflow post about how they do it and see if you can glean something.
  • Use LSI. This will be slow to run, so you will want to get the results via Ajax. This will produce the highest-quality results.

added votes and lots of modifications based on your code

I very much enjoyed reading your code and feel like I learned heaps: double bang and po-ro and lots more. I don't know what the hell is at the bottom of the test helper, but I will ask.

I spent so much reviewing and coming to understand what you had done, that when I ran into a complicated schema issue, it was already late. My "corrections" made things worse for a while. Once I got on track, I simply ran out of time. So this is not complete, error-free, failure-free, or styled well. It will be, as soon as possible.

Improve use of tags

Currently, tags are not used on the site at all. You will need to add them to displays as well as add new pages to show questions by tag.

Requirements

  • Everywhere questions are shown on the site, the question's tags are also shown.
  • Tags can be clicked to go to a new page at /tags/:id that shows all questions tagged with that tag. The :id in that URL should be the tag name, not a numerical ID. See #25 for hints on how to best do this.
  • The question form should use autocomplete for tag entry. See jQuery-Tags-Input and jQuery.autocomplete for more details.

User profile page

Users on Question Box have nothing to represent them! You have to design and implement a user profile page, as well as a way for users to update their profile.

Requirements

  • Users should be able to add their GitHub URL, Stack Overflow URL, and Twitter URL. Any of these added should show on the profile page.
  • All questions asked and answers given by a user should be accessible either on the user profile page or on a sub-page (like so: /users/12/questions).
  • All answers given by a user that are accepted should be marked as such. It would be best to pull these out into their own special section. Look at the GitHub profile page for ideas.
  • The profile page should have a user's name and bio (if they write one) and an image of them. I suggest using Gravatar for this image and using Identicons if they don't have a Gravatar image. (Try the gravtastic gem.)
  • The profile page should also show the user's 10 last updated GitHub repos if they gave you their GitHub URL.
  • The profile page should show the user's Stack Overflow reputation if they gave you their Stack Overflow URL.

Design refresh

Question Box needs a design refresh! For this issue, you have a free hand to do what makes sense for you, but I have included a mood board that might be useful for inspiration:

You can continue to use Foundation or rip it out and use Bourbon or whatever!

This is the most open-ended of the issues and one of the hardest, since it covers design and development. Make sure you don't break the tests while working on this!

Requirements

  • All current pages should be redesigned.
  • There should be a consistent style across all pages.
  • The entire flow can be changed if you want. There aren't any sacred cows.
  • The style should be aesthetically pleasing, as determined by @cndreisbach.
  • Any images added should be licensed using Creative Commons or created by you.

Use FriendlyId

Right now, everywhere on the site that we have an ID in the URL, it's a numerical ID, which is ugly and bad for SEO. Use FriendlyId to change that to slugs, so that we have URLs like /questions/how-do-i-make-a-resourceful-route.

Favorite tags

Users should be able to choose their favorite tags. If a user is logged in and has favorite tags, there should be a page (/questions/favorites is an option for the URL) that shows the most recent questions for their favorite tags. Optionally, put this on the home page.

Add text notification of answers

For users who have burning questions, they may want to receive a text notification when their question is answered. You will use SendHub or another texting service to send text messages. (I chose SendHub because they have a free trial that doesn't restrict what phone numbers you can text.)

Requirements

  • Users can add their phone number to their account.
  • Users can decide if they want to get a text message when their question is answered. This should be turned on and off from the questions/show page by clicking a button or a phone icon or something like that.
  • If they have chosen to get a text message, then when an answer is added, they will get a text message with this message: "New answer for your question '[original question title text]': [truncated answer text]"
  • Texting should be tested, but no texts should be sent during testing. Read up on mocks and stubs and see the MiniTest documentation on how to use them.

Bonuses

  • Verify phone numbers before allowing texts to be sent to them.
  • If the user responds to a text with the message "off", then text notifications for that question are turned off.

Add question time to all questions

Using moment.js, display on each question, wherever it is displayed, how long ago the question was asked. Also add this to all answers. Note that you will probably emit the actual time from Rails and then use moment.js to then format it.

Add a separate new question form

We always intended to have something at /questions/new. Please put something there, using the same form that is currently on the front page.

Q Box

Ran in to so many 'No routes match' errors in logins test but finally got them working. Then bourbon threw up on my tests and gave me plenty of 'File to import not found - Bourbon'. And plural/singular...

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.