Giter Club home page Giter Club logo

match-up's Introduction

Match Up

A compatibility-based friend finder application. Match Up takes in results from a users' surveys, then compares their answers with potential matches, and matches them with the best overall option.

Once you answer all questions and submit, you will be Matched Up with another user. This project uses a few simple but effective algorithms to calculate the lowest variance between the users.

Technologies Used

  • Node.js
  • Express.js
  • JavaScript
  • jQuery
  • Bootstrap
  • Body-Parser (node package)
  • Path (node package)
  • AJAX, JSON, and a custom API.

Code Example

This project uses a few simple but effective algorithms to calculate the lowest variance between the users. Snippet below.

const matches = require("../data/matches.js"); 
const add = (a, b) => parseInt(a) + parseInt(b);

let apiScoreOptions = [];
let apiScoreTotals = matches[i].scores.reduce(add);
let matchDiff = apiScoreTotals - totalNew;
let matchDiffAbs = Math.abs(matchDiff);
apiScoreOptions.push(matchDiffAbs);

let lowestVariance = Math.min(... apiScoreOptions);
let matchUp;
let matchUpPhoto;

for (var i = 0; i < matches.length; i++) {

   let apiScoreTotals = matches[i].scores.reduce(add);
   let matchDiff = apiScoreTotals - totalNew;
   let matchDiffAbs = Math.abs(matchDiff);

      if (matchDiffAbs <= lowestVariance)  {
        matchUp = matches[i].name;
        matchUpPhoto = matches[i].photo;
      }
}

How to use

  • Step 1: Fork this repository and clone it to your local environment.
  • Step 2: Navigate to the cloned repo/folder and run npm init. Once the repo is initialized, run npm install. This will download all of the necessary dependencies.
  • Step 3: run node server.js, navigate to localhost:8080 on your favorite web browser, and the application should be up and running.
  • Step 4 (bonus): Open the files in your favorite text editor and customize the application even more!
  • Step 5 (bonus): Try it out here: https://young-oasis-64436.herokuapp.com/

match-up's People

Contributors

taqwar 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.