Git Product home page Git Product logo

friendfinder's Introduction

FriendFinder

#Week of 13 HW: Friend Finder - Node and Express Servers

Objectives

  • In this activity you will be building a compatibility-based "Friend Finder" application. (Basically a dating app)

  • The application will take in results from users' surveys then compare their results against all other users who have completed it. The application will then display the name and picture of the user with the best match overall.

  • You will use Express to handle routing and will deploy your application on Heroku so others can fill it out.

  • For a demo of this application see: https://friend-finder.herokuapp.com/

Submission Requirements:

  • When submitting this homework, use the normal GitHub and Heroku process.

Basic Requirements

  • Create a folder called FriendFinder. Inside the folder, organize your directories so it matches the following:

     FriendFinder
     	- app
     		- data
     			- friends.js
     		- public
     			- home.html
     			- survey.html
     		- routing
     			- api-routes.js
     			- html-routes.js
     	- node_modules
     	- package.json
     	- server.js
    
  • Your survey should have 10 questions of your choosing. Answers to the survey questions should be on a scale of 1-5 based on how much the user agrees or disagrees.

  • Your server.js file should use the basic npm packages we've used in class: express, body-parser, path.

  • Your html-routes.js file should include two routes:

    • A GET Route to /survey which should display the survey page.
    • A default USE route that leads to home.html which displays the home page.
  • Your api-routes.js file should include 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.
  • Data in your application should be

    • Saved as an array of objects.

    • Each object should follow roughly the below format:

       {
         "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
        	  ]
       }
      
  • Compatibility should be determined based on the following.

    • Each user's results should be converted into a simple array of numbers (ex: [5, 1, 4, 4, 5, 1, 2, 5, 4, 1]).
    • You will then compare the difference between the user's scores against other users' scores, question by question. You will then 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 (i.e 5-3 and 3-5 should both be 2).
    • The person with the closest match should be the one with the "least" amount of difference.
  • Once you've determined the closest match, display the result back to the user in the form of a modal pop-up.

  • The result should display both the name and picture of the closest match.


friendfinder's People

Contributors

lvanok avatar

Watchers

James Cloos 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.