Giter Club home page Giter Club logo

friendfinder's Introduction

FriendFinder

Connect users to their most compatible friend

Live Heroku Site

FriendFinder is a fullstack web application built with Node.js and Express where the user is asked to submit a name and image link, then fills out a survey of personality questions. Upon pressing submit, the client makes a POST request to the server which pushes the new user to an object array, calculates their best match, and sends the best match back to the client in order to be displayed to the user. The user can also click API Friends List in order to get a raw JSON object containing all of the friends being stored on the server.

The matching algorithm takes the user's answers, scored from 1 to 5, and compares them to the answers of each friend stored on the server. It determines the absolute value of difference between each answer, then adds up these differences to calculate the total difference. As it loops through each friend, it updates the best match based on the lowest total difference between answers. Once the loop is finished, it sends the best match back to the client.

  • Example:
    • User 1: [5, 1, 4, 4, 5, 1, 2, 5, 4, 1]
    • User 2: [3, 2, 3, 4, 1, 2, 5, 3, 4, 1]
    • Total Difference: 2 + 1 + 1 + 0 + 4 + 1 + 3 + 2 + 0 + 0 = 14

Packages used:

Libraries/Frameworks used:

Challenges

We were given a specific directory structure to work with, which separated the main server script, routing logic, and static files. It took a bit of research to figure out how to use the correct paths in different files. The path module was indispensible in building relative filepaths for the routes and static files.

Initially, I calculated the best match by summing each array and comparing the difference from there. However I realized that by doing it this way, users who answered very differently (for example, answering 5 and 1 on opposite questions) would be matched together. In order for the matching algorithm to work properly, the differences between individual questions must be considered. I'll admit that I felt rather silly when I realized my mistake, but it reinforced the importance of testing and pseudocoding.

Potential Changes

  • Incorporate friends into a database for permanent storage (if the server ever restarts, the data is lost)
  • Use Handlebars to serve static content
  • Allow user to browse friends and see how their scores match up
  • More detailed profiles
  • More test questions or different tests to choose from
  • User accounts

friendfinder's People

Contributors

dylan-thomson avatar

Watchers

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