Giter VIP home page Giter VIP logo

friend-finder's Introduction

  1. My survey should have 10 questions of your choosing. Each answer is on a scale of 1 to 5 based on how much the user agrees or disagrees with a question. ​
  2. My server.js file requires the basic npm packages: express and path. ​
  3. MyhtmlRoutes.js file should include two routes: ​
    • A GET Route to /survey which should display the survey page.
    • A default, catch-all route that leads to home.html which displays the home page. ​
  4. MyapiRoutes.js file contains two routes: ​
    • A GET route with the url /api/friends. This will be used to display a JSON of all possible friends.
    • A POST routes /api/friends. This will be used to handle incoming survey results. This route will also be used to handle the compatibility logic. ​ 5.My application's data is saved inside of app/data/friends.js as an array of objects. Each of these objects should roughly follow the format below. ​
{
  "name":"Ahmed",
  "photo":"https://media.licdn.com/mpr/mpr/shrinknp_400_400/p/6/005/064/1bd/3435aa3.jpg",
  "scores":[
      5,
      1,
      4,
      4,
      5,
      1,
      2,
      5,
      4,
      1
    ]
}

​ 6. Determine the user's most compatible friend using the following as a guide: ​

  • Convert each user's results into a simple array of numbers (ex: [5, 1, 4, 4, 5, 1, 2, 5, 4, 1]).
  • With that done, compare the difference between current user's scores against those from other users, question by question. Add up the differences to calculate the totalDifference.
    • Example:
      • User 1: [5, 1, 4, 4, 5, 1, 2, 5, 4, 1]
      • User 2: [3, 2, 6, 4, 5, 1, 2, 5, 4, 1]
      • Total Difference: 2 + 1 + 2 = 5
  • Remember to use the absolute value of the differences. Put another way: no negative solutions! Your app should calculate both 5-3 and 3-5 as 2, and so on.
  • The closest match will be the user with the least amount of difference. ​
  1. Once you've found the current user's most compatible friend, display the result as a modal pop-up.
    • The modal should display both the name and picture of the closest match. ​

Reminder: Submission on BCS

  • Please submit both the deployed Heroku link to your homework AND the link to the Github Repository! ​

friend-finder's People

Contributors

mlratino avatar

Watchers

 avatar  avatar

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.