Code Monkey home page Code Monkey logo

snapfresh's Introduction

SnapFresh Build Status Code Climate

Installation and Setup

Install Dependencies

Dependencies

  • Postgres
  • Git
  • Ruby

For Ruby and Git, a good tutorial can be found at Jumpstart Lab Tutorials

For Postgres, see install options depending on your operating system below and follow the instructions.

Setup

$ git clone https://github.com/SnapFresh/SnapFresh.git
$ cd SnapFresh
$ bundle install
$ cp config/database.yml.example config/database.yml
$ bundle exec rake db:nuke_pave

Installing Postgres

Mac Users

Recommended installation is with Postgress.app or Homebrew. See relative sites for instructions on installation.

Window Users

Download and follow the instructions from Postgres. When promoted, you will want to install the local version, not the remote server.

Linux

For Fedora:

$ sudo yum install postgresql-server postgresql-client postgresql-docs postgresql-devel

Database Configuration

For Mac users, be sure to add the following to config/database.yml in order to avoid port errors.

development:
  host: localhost

test:
  host: localhost

You may need to add or modify additional configurations in database.yml depending on how Postgres is setup.

A for develoment purposes, a username and password are not required unless Postgres is setup to require them. The fields can either be left blank or removed.

Development Data

If you only want data for development purposes, then db:sample will load a small amount (200 records) that will probably be sufficient for development purposes.

$ rake db:sample

Production Data

Download a new data set and load into the database.

$ rake db:datarefresh

A line should print out every 10K rows that are refreshed - this way you can check on the progress of the script which takes at least 10 min to run.

Alternate Production Data Load

Alternate way to load the full data (if above steps dont work for some reason):

  1. Run ruby db/cronjob.rb to fetch all data files, unzip and then produce a single CSV file called "all.csv".

  2. Bulk-load into postgres, using this command.

$ grep -v '"NULL"' all.csv | psql allincomefoods_dev -c "copy retailers (name, lon, lat, street, city, state, zip, zip_plus_four) from stdin null as 'NULL' csv;"
  1. Remove all the .zip and .csv files that were created as part of the download process.

//00T! You should be all installed and stuff now.

Docker

Requirements:

  • Docker
  • Docker Compose

Runnning in Docker

  1. $ docker-compose up -d
  2. Open in browser on Docker host IP on port 3000

Testing in Docker

  1. $ docker-compose -f docker-compose.test.yml build
  2. docker-compose -f docker-compose.test.yml up --no-deps -d postgres
  3. docker-compose -f docker-compose.test.yml up --no-deps snapfresh

Contribution Guidelines

  1. Create a feature branch from develop: git checkout -b feature/myfeature develop or git flow feature start myfeature
  2. Commit and push your changes
  3. Submit a pull request to the develop branch

License/Copyright

License INFO: - Note, this license applies to all files within the SnapFresh/SnapFresh repo. It is an OSI approved license.

Copyright [2011] [Ysiad Ferreiras, Aaron Bannert, Jeremy Canfield and Michelle Koeth]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

You may obtain a copy of the License

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

See LICENSE for details.

snapfresh's People

Contributors

abannert avatar davidx avatar jwieringa avatar kwals avatar mabundo avatar michellekoeth avatar onezerojeremy avatar rmalecky avatar shrtlist avatar tommarkallen avatar ysiadf avatar zph avatar zr2d2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snapfresh's Issues

Acceptance Tests

Roughly, acceptance should exist that:

  • jQuery App
  1. Enter address
  2. Click submit
  3. Check for results

We can use either the ruby selenium driver or capybara. See http://elementalselenium.com/tips for tips on the ruby selenium driver.

Status of the project?

Hey folks—

Curious if you could update the Code for America set about the status of the SnapFresh project—both this iOS version, as well as the webapp (could you point me to that repo?).

There is a group of us working for CfA that are focused largely on low-income citizens enrolled in SNAP and Medicaid. Here are some of our nascent projects:

Enrollment:
https://github.com/codeforamerica/calfresh-and-so-clean

Check your EBT balance via SMS:
https://github.com/codeforamerica/balance

Don't wait on hold when you call HSA:
https://github.com/codeforamerica/connect

Find EBT retailers, and coming soon, ATMs where there is no fee:
https://github.com/fureigh/ebt-near-me

Obviously, we are interested getting a better understanding the status and future of SnapFresh because of that last one.

Hello // Production Enviroment // Upgrades

Hello,

I'm new around here, I'm a friend of @JerseyCoder and would like to take sometime to upgrade RoR and Ruby for snapfresh.org.

Here's the idea:

  • Upgrade Rails to 3.2.x
  • Upgrade to Ruby 2.0

@abannert Michelle said you would be a good person to ask about the production environment.

Questions:

  • Deployment: Is Capistrano being used for deployment? I ran into some issues locally, so I'm wondering if it's currently being used.
  • Via Michelle I've learned production is Ruby 1.8.7 (officially depreciated), can the server be upgraded to Ruby 2.0?

I'm here to get work done, so if there's anything I can do please let me now.

Cheers!
Jason

iOS app crashes after map zooms in

The iOS app is crashing. It starts up and shows the map, asks for location, starts to zoom to current location and then crashes. I'm guessing it's a parse error in the response from the server, now that the yelp data is missing.

Back link for nearaddy view

We need a link that will allow users to go back to the index (search) page from the results page. Then, we need the translation for such a link (e.g. "Back" in Chinese and Spanish)

Add analytics code for SMS requests

Tropo sends a URI over to our rails server, but no html template is ever rendered. So use of snapfresh SMS service cant be captured since there's no html to render for a just SMS request? This issue needs to be researched - that is, how Google analytics can work with a call against the webserver that does not return a html view...

Localized "Redo search in this area" reverts to English

Steps to reproduce:

  1. Launch app in Chinese or Spanish
  2. Pan map view to bring up "Redo search in this area" (localized) button
  3. Tap button to initiate search
  4. Pan map view to bring up "Redo search in this area" (non-localized) button

Setup Travis CI

  1. Enable Travis CI Service Hooks to Github Repo
  2. Update travis.yml to complete builds
  3. Update Readme to Travis build links

Upgrade Rails

Upgrade Path:

  • Complete #33 (Acceptance tests)
  • Upgrade to 3.1 which includes converting to the asset pipeline
  • Upgrade to 3.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.