/Trade-Chain

Web app to allow users to participate in huge multi person trades

Primary LanguageRuby

Trade Chain

Ruby on Rails RESTful web app that allows users to participate in large multi-person trades (aka math trades). Users can create and/or join in trades. They may add items to trades they have chosen to participate in. For each item, they need to add a name and a description, and a relative ‘value’. They may also add unlimited images. They then select other items in the trade that they’d be interested in receiving. They place a relative ‘value’ on each of those too. The relative values determine what items he might get. He will always receive items that he considers of higher value than those he is trading away. On the date of the trade, the user can see which items he is to give to which users and which he is receiving from others.

Essentially, we end up with a distributed weighted graph where ideally we’d like to find the lowest average cost cycles where a user loops back around on himself. For now, however, I use a depth first search that ignores the edge costs and avoids cycles that don’t lead back to the root node.

Features/Gems Used:

  • helper method to display You or Your (takes a bool to determine which) whenever user would otherwise see their username
  • unlimited images per item – dragonfly gem
  • user authentication – * devise gem
  • user friendly urls – friendly_id gem
  • bootstrap-sass
  • unicorn for production
  • sqlite3 for devolpment and testing
  • simple_form
  • faker for populating fake data
  • factory_girl for testing purposes