Index of Portland’s many cafés and coffee shops.
You need to have Ruby 2.2.0 installed. Hopefully you have RVM installed so you can just run rvm install 2.2.0
. Once you've done this, you're going to need to install the application's dependencies by running bundle install
.
Now you should be close to running. You'll need access the Google Developer Console in order to turn on access to the Places API. Create your key and place it in a file at the root of the project named .env. You should also make sure to populate it with whatever environment you're currently working in. It should look like this:
API_KEY='your api key here'
CURRENT_ENVIRONMENT='development'
You also need to start up a list of places you want to ignore in the results. You'll inevitably have some. This is achieved by adding to your .env file:
UNDESIRABLE_LOCATIONS=McDonalds,Starbucks
All you have to do is set up the database and it's ready to go. Just run rake db:create
and rake db:schema
. Your database is set and you can run rake radar
. This will generate the results.json file in the base of the Angular application. Go wild.
Rake everywhere
Building and working on the project requires getting this software set up on your machine:
- Sass: You’ll need the Ruby gem variant of Sass to build the project’s stylesheets. If you have Ruby on your machine you can run:
```shell
$ gem install sass
```
Refer to the [installation guide](http://sass-lang.com/install) for more details.
- Node.js (or equivalent): The project uses gulp to run tasks, which operates on Node.js. Visit the site to download it, or, if you have Homebrew you can run:
```shell
$ brew install node
```
- Bower: Front-end assets are managed using this package manager, which requires Node.js and npm (comes automatically with Node.js). It also requires git, which it’s safe to assume is already installed. Run the following command to install Bower:
```shell
npm install -g bower
```
- Karma (semi-optional): the project’s tests are run through Karma, which requires Node.js. If you want to run tests, which is optional but suggested, it’s assumed you have the Karma CLI installed. Run the following to do so:
```shell
$ npm install -g karma-cli
```
- Node packages: Install the JavaScript modules for tasks with the following:
```shell
$ npm install
```
- Front end components: Install the scripts and styles required to run and display the app:
```shell
$ bower install
```
The application is based on Yeoman’s gulp-webapp generator, so tasks mostly follow the originals:
To start developing, run:
$ gulp serveThis will fire up a local web server, open http://localhost:9000 in your default browser and watch files for changes, reloading the browser automatically via LiveReload.
To make a production-ready build of the app, run:
$ gulp
If you followed setup step regarding Karma, simply run:
karma start
…from the project root. Karma will spin up Chrome, automatically run the unit tests, and watch files for changes. (Use the --single-run
flag to run tests once and not watch files.)