LeagueSide Exercise

This is my attempt at the LeagueSide exercise.

Usage

Note

This uses Ruby, Rails, and SQLite.
For instructions on installing Ruby click here.
For instructions on installing Rails click here.
For instructions on installing SQLite click here

Setup

Clone the repo and go into the leagueside folder
Run the following to start up the app:

bundle install
rails db:create
rails webpacker:compile
rails s

You can visit http://localhost:3000/leagues/new to create a new league
To search visit http://localhost:3000.leagues/search?radius=[radius]&coordinates=[coordinates]&budget=[budget].json
This returns a json of the leagues within the radius that are under the budget

  • Radius is the number in miles from the coordinates that you want to search
  • Coordinates is a latitude/longitude pair that is comma separated (ex. 38.456,-72.924)
  • Budget is a number that represents the total budget to spend
    Example: http://localhost:3000/leagues/search?radius=15&coordinates=35.7803977,-78.6390989&budget=10000.json