This is a sample Ruby on Rails application intended to assist in the evaluation of my development skills. The project includes the following features :
- Open ID and Database User Authentication
- Data Import via uploaded file, including data normalization
- (not implemented yet) JQuery based batch loading of images, scrolling, and ordering
- Unit Tests
Imagine that company X has just acquired a new company Y. Unfortunately, company Y has never stored their data in a database and instead uses a plain text file. We need to create a way for the new subsidiary to import their data into a database. The application should provide a web interface that accepts file uploads, normalizes the data, and then stores it in a relational database.
Some sample requirements:
- The app must accept (via a form) a tab delimited file with the following columns: purchaser name, item description, item price, purchase count, merchant address, and merchant name. You can assume the columns will always be in that order, that there will always be data in each column, and that there will always be a header line. An example input file named example_input.tab is included in this repo.
- Your app must parse the given file, normalize the data, and store the information in a relational database.
- After upload, your application should display the total amount gross revenue represented by the uploaded file.
- Allow the user to store a url to an image of an item
- Allow the user to attach items to a catalog of items
- Present a screen containing 3 items from a catalog, load batches of 3 until screen is full.
- As user scrolls down, load additional 3 items at a time
- Allow user to sort the items by drag-and-drop (allow multiple drag via click)
- Allow user to save the new order of items so that when page is reloaded order is maintained
- Implement methods to retrieve batches of images and store the order as API methods
The application should:
- Handle authentication or authorization
- Be easy to setup and run on Linux, Mac OS X, or Windows.
- Not require any for-pay software.
The application does not need to:
- be aesthetically pleasing
To install the sample application execute the following commands :
% cd /home/username/projects (or to where you would like to install the application)
% git clone https://github.com/jkgit/sample-ror-application.git
% cd sample-ror-application
% rake db:migrate
First start the rails server :
% rails server
Then :
- Open a browser and go to url http://localhost:3000/
- On the sign up page you can register an acount one of two ways : Create a username and password by clicking on the "Register" link at the top of the page or the "Sign up" link at the bottom of the page. Sign in with an Open Id url, example https://www.google.com/accounts/o8/id.
- Either registration method will return you to welcome page after a successful log in.
- Click "Import my data"
- Click "Choose File" and in popup browse to the location where you installed the data-engineering app, then browse to test/fixtures/files/ select "example_input.tab" and select "Open"
- Click "Upload"
- Result page should show a notice at the top that your purchases were imported and give you the total gross number. it will also list the purchases in the system.
Execute the following commands in your shell or command line (or IDE)
% rake db:reset
% rake db:test:load
% rake test
This sample application takes advantage of 3rd party gems (no point reinventing the wheel):
- Devise - Authentication
- Active Scaffold - CRUD screens
- Roo - Spreadsheet support