Ibotta Dev Project 20140521

The Project

Your goal is to query the geolocation event data and provide an interesting analysis. Some ideas:

  • Identify "hot" shopping date/times across all users and per retailer
  • Distribution of distance from Customer location (lat/long) to Stores they visit using events
  • Heatmap of store visits
  • Likelihood of customers visiting one retailer visiting others (e.g. Customers who visit Target are 30% more likely to visit Walgreens)
  • Distribution of the number of stores a user visits in given time period
  • Feel free to come up with your own!

Provide repeatable code to generate results. Results should be viewable on a webpage generated by the application. Optionally, provide graphical visualizations for the data. Feel free to use third party charting libraries or d3.js.

If you feel more comfortable working on this project together in a language/framework other than Ruby on Rails feel free to use that. You'll need to load the seed data in the db directory into your database of choice and make sure to provide instructions on how to run the project on another machine.

Ruby on Rails Setup

This application requires:

  • Ruby (1.9.3 or above. Currently setup for Ruby 2.1.2)
  • Rails (4.1.1)

Learn more about Installing Rails.

Here's a quick install procedure for OSX Mavericks:

  1. Ensure XCode and Command Line Tools are installed
  2. Install brew
  3. Install the following brew packages
brew install git node pcre rbenv ruby-build
  1. Ensure your rbenv profile is setup per the instructions printed during brew install, and possibly restart your terminal
  2. cd to the project root directory (where Gemfile is) and setup ruby
cd [project_directory]
rbenv install 2.1.2
rbenv rehash
gem install bundler
  1. initialize the application
bundle install
rake db:migrate
rake db:test:prepare
rake db:seed

Common rails commands:

  • guard automatically runs the rails server as well as runs tests when files change
  • rake db:seed will always reload the given test data (will take a while)
  • rails console an interactive ruby console including the rails environment
  • rails db an interactive database console

Database

This application uses SQLite with ActiveRecord.

The tables given to you are stored in the .seed.csv files, and are loaded to your local sqlite database by the command rake db:seed

If you want to use another database (MySQL), you will need to configure databases.yml and then load the data there.

The database consists of sample data for 4 tables - customers, retailers, stores and events. The associated basic Rails models are included in the RoR project. A few notes:

  • Events are sample geolocation events for our customers (e.g. Enter geofence for a store location). event_at is the timestamp of when the geofence event was triggered on the mobile device. insert_dt is the timestamp of when the data was inserted into the database and can be ignored.
  • Stores and events are bounded by roughly 30 miles around downtown Denver and are from roughly a 3 week timeframe.
  • Lat/long on customers is the latitude and longitude of their home zip code.
  • You may ignore the offers and tasks data for the purposes of this project.

Gems/Frameworks that are included but not mandatory to use

  • Template Engine: Haml or ERB NOTE: Haml is not required so feel free to just use standard ERB templates.
  • Testing Framework: RSpec and Factory Girl
  • Front-end Framework: Twitter Bootstrap 3.0 (Sass, Javascript)
  • Continuous Testing: Guard and Spring

Deliverable

Please provide the code for the assignment either in a private repository (GitHhub or Bitbucket) or as a zip file. If you decide to put the project on a public server (e.g. Heroku) send over a link to that as well.