Included in this repository is my solution to LivingSocial's Software Engineer Challenge. It makes use of Ruby on Rails to solve the three primary goals of:
- accepting (via webform) a tab-delimited file of purchase data,
- parsing the file, normalizing the data, and storing in a relational DB, and
- displaying the total amount gross revenue represented by the file.
It additionally performs the bonus requirement of implementing authentication.
To set up the application on your (Linux or OS X) system:
- Clone the repository.
- Install Ruby 2.1.0 if not already installed. (Optionally use rvm or rbenv to specify a Ruby environment for your Ruby binary & gemset.)
cdinto the top-level repo folder, and runbundle installto install the gems needed by the app.- Run
bundle exec rake db:setupto create your database and prepare its schema. - Run
bundle exec rails serverto run the server.
- Open localhost:3000 in your web browser.
- Click the "Get started" button to create a new user account.
- After signing up, you will be taken to the CSV upload page. Use the form to upload a CSV matching the format specified by the challenge. (Optionally upload a file not matching the format to see how error cases are handled.)
- After performing a successful upload, you will be taken to the merchants page where you can verify the gross revenue represented by the file as well as all data imported to date. Item and purchase data is nested under each merchant.
Unit and controller tests are implemented via RSpec and
make use of FactoryGirl and
Faker. The test suite can be run from the
command line via bundle exec rspec.