Giter Site home page Giter Site logo

cyf-faq-group's Introduction

Frequently Asked Questions

This repository contains initial work on a FAQ app. To complete the app, you'll need to implement the functions which allow a visitor to search for a question and ask a new question.

This repository is part of CodeYourFuture's group projects.

Screenshot of starting point

What you need to do

  • Create a MongoDB database and a collection to store questions and answers.
  • Move the existing data into the database. Add several more entries on whatever topics you would like.
  • Allow a user to search for a word or phrase and display only entries which contain that word or phrase. You'll want to use MongoDB's $regex feature to search your database.
  • Add a form which allows a user to ask a new question.
  • Only questions with answers should be shown on the front page or included in search results.
  • Allow a user to indicate whether an answer was helpful using the Yes and No buttons. Their response should be reflected in the numbers included below each answer: "25/?? people found this helpful."
  • Create a route on your server to display a list of unanswered questions. Allow users to submit an answer to an unanswered question.

Stretch goals

  • Try to implement the search feature using only ajax requests, so that the results appear without reloading the page.
  • Try to sort the entries with the most helpful entries listed first. Try to do the same for the search results.
  • Try to prevent entries that are very unhelpful from being shown in the main page.

cyf-faq-group's People

Contributors

natewr avatar yjohn avatar

Watchers

 avatar  avatar  avatar  avatar

cyf-faq-group's Issues

Create Entry data model

@khaledkzy, create an Entry data model using Mongoose. The data model should support:

  • questions - string (required)
  • answers - string
  • how many people found usefull - integers
  • how many people found not usefull -integers

Depending on your preference, it can include the total number of useful/not-useful votes too.

Create a database and connection

Assigned: @khaledkzy

Create a database named faq with a collection named entries. Add the database connection to the project and help get every other team member set up with the database locally, so that everyone is working on the same database.

Implement the search functionality

Assigned: @panditita

You need to implement the search form on the homepage, so that it finds matching results and only returns those results which match the request.

Currently the form submits a GET request to the homepage router.get('/', ...). You can either extend the homepage route or add a custom route for search results. It's up to you. Either way, you'll need to:

  • Receive the search input data (the "query") from the form in your route
  • Search the database for matches using MongoDB's $regex functionality.
  • Display all the questions which matched the search result.
  • Display the query phrase to the user, so they know what phrase the results are matched against.

Entries should be ordered by most helpful first

Unassigned.

When displaying our entries, we should use the isHelpful and isNotHelpful data to rank the entries, with the most helpful ones appearing first.

How can we determine which entries are the most helpful? We'll discuss strategies as a group if we're able to implement this feature.

Client-side functionality for the Helpful/Not Helpful buttons

Assigned: @Yjohn

To implement the client-side functionality, you'll need to write everything that happens on the user side when they click the Helpful/Not Helpful buttons, and handle the response from the server.

  • When a user clicks one of the buttons, add an indication that the request is in process. (Read about CSS Animation and look at this loading spinner example).
  • Submit a POST ajax request to /rating containing the data keys entryId and isHelpful.
  • When the response is received from the server, use the data to update the helpful display.

Some resources which might help you:

Create a form to ask a question

Assigned: @Habiiba12

  • Add a new route (/ask-question) that displays a form where a user can ask a new question.
  • The form should contain a text field for Question, a button to submit the form, and a button to go back to the homepage.
  • A new post route (router.post('/ask-question', ...)) should accept the posted form data, validate it, and throw an error if a question text field is empty. If it's not, it should add the question to the database.

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.