GithubHelp home page GithubHelp logo

pairr's Introduction

Pairr (/per-r/)

Turing School Final Assessment

We had 24 hours to build a fully-functional and tested web application that acted as "tinder for programmers"

The criteria for the feature set can be seen here

Thoughts

For myself, the hardest part of designing the application was the architectural relationships between users when they were matched and whether or not they "approved" or "rejected" each other. When a user matches with another user, the database needs to know they've seen each other so as to not attempt to match them again.

To keep track of which users have already seen each other, I kept an ActiveRecord column of type array that, for any given user, would initially hold all other user ids in the database. This would be applied to each user upon their creation and then randomized to shuffle their perspective matches. Each time the current user matched with someone else, that user's id would be removed from the current user's potential matches array attribute. The problem here, which I unfortunately ran out of time to solve, was when new users were coming into the site, how to add them to all other user's potential matches array.

The second half of this issue was how to store a "potential match" between users. I used a match model containing columns for the current user's id, the potential match user's id, and a match status, which was set to pending when a user "approved" of the match, and rejected if they "rejected" the match. When the second user came around, if they too "approved" of the match (setting the match status to pending from there end as well), the match would immediately change to "approved", and both users would be notified of their love for each other.

Had I more time, I would have liked to refactoring the matches_controller#update method which is push 20 lines of code...not pretty. A lot of the logic could be pushed down into the model or even parsed out into it's own separate object. My spec harness is also less than optimal. Always room for improvement.

Installation

clone and bundle

git clone https://github.com/indiesquidge/pairr; cd pairr
bundle install

database setup

rake db:create db:migrate db:seed

(seed data file found here)

pairr's People

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.