Connect suppliers, distributors and consumers for the sale and purchase of local produce
Ruby CoffeeScript HTML CSS Other
Switch branches/tags
Latest commit c72d17d Mar 29, 2017 @Em-AK Em-AK committed with mkllnk Run karma task only in test environment
and fails otherwise, as it needs the defaults defined in test environment
Permalink
Failed to load latest commit information.
.tx Transifex configuration file Dec 24, 2015
app better tax aggregation Apr 27, 2017
config Force english locale in test environment Apr 28, 2017
db fix for pull request #1374 Mar 15, 2017
doc Adding the missing bulk buy spec Mar 19, 2014
lib Run karma task only in test environment Apr 28, 2017
log new rails 3.1.4 app Mar 26, 2012
public Adding UK TOS to repo Dec 22, 2016
script Run karma task only in test environment Apr 28, 2017
spec add tests Apr 27, 2017
vendor Upgrading textAngular May 24, 2016
.codeclimate.yml CodeClimate fixes for filter-products branch May 27, 2016
.gitignore Adding package.json with npm dev dependencies for js specs May 24, 2016
.mailmap right mapping of contributer's names in git Feb 7, 2015
.rspec Don't show rspec profile by default Jan 9, 2015
.rspec_parallel Use fuubar with parallel specs for advance notice of failures Jun 17, 2015
.rubocop.yml Add Rubocop config file Feb 9, 2016
.ruby-gemset Rename misc items from openfoodweb to openfoodnetwork Oct 18, 2013
.ruby-version Bumping ruby version to 2.1.5 Nov 5, 2015
.scss-lint.yml Add SCSS lint config Feb 9, 2016
.travis.yml Don't trigger deployment for transifex branch Jul 15, 2016
CONTRIBUTING.md #737: add link to dev wiki Feb 6, 2016
Gemfile Add roo gem Mar 17, 2017
Gemfile.lock update wkhtmltopdf-binary and wicked_pdf Apr 27, 2017
Guardfile Renaming everything to Shop Dec 5, 2013
LICENCE.txt Add AGPL licence Dec 18, 2012
Procfile switch to unicorn. Mar 27, 2012
README.md Run karma task only in test environment Apr 28, 2017
Rakefile Use require_relative introduced in Ruby 1.9.2 Jul 20, 2016
config.ru Rename application from Openfoodweb to Openfoodnetwork Oct 18, 2013
knapsack_rspec_report.json Update knapsack report Jul 28, 2016
package.json Linking to PhantomJS installed on PATH May 24, 2016
zeus.json Configure Travis, remove spork, add simplecov, add turbo sprokets. Jun 7, 2013

README.md

Build Status Code Climate

Open Food Network

The Open Food Network is an online marketplace for local food. It enables a network of independent online food stores that connect farmers and food hubs (including coops, online farmers' markets, independent food businesses etc); with individuals and local businesses. It gives farmers and food hubs an easier and fairer way to distribute their food.

Supported by the Open Food Foundation, we are proudly open source and not-for-profit - we're trying to seriously disrupt the concentration of power in global agri-food systems, and we need as many smart people working together on this as possible.

We're part of global movement - get involved!

Getting started

Below are instructions for setting up a development environment for Open Food Network. More information is in the developer wiki.

If you're interested in provisioning a server, see the project's Ansible playbooks.

Dependencies

  • Rails 3.2.x
  • Ruby 2.1.5
  • PostgreSQL database
  • PhantomJS (for testing)
  • See Gemfile for a list of gems required

Get it

The source code is managed with Git (a version control system) and hosted at GitHub.

You can view the code at:

https://github.com/openfoodfoundation/openfoodnetwork

You can download the source with the command:

git clone https://github.com/openfoodfoundation/openfoodnetwork.git

Get it running

For those new to Rails, the following tutorial will help get you up to speed with configuring a Rails environment: http://guides.rubyonrails.org/getting_started.html .

First, check your dependencies: Ensure that you have Ruby 2.1.5 installed:

ruby --version

Install the project's gem dependencies:

cd openfoodnetwork
bundle install

Configure the site:

cp config/application.yml.example config/application.yml
edit config/application.yml

Create a PostgreSQL user:

  • Login as your system postrgresql priviledged user: sudo -i -u postgres (this may vary on your OS). Now your prompt looks like: [postgres@your_host ~]$
  • Create the ofn database superuser and give it the password f00d:
createuser -s -P ofn

Create the development and test databases, using the settings specified in config/database.yml, and populate them with a schema and seed data:

rake db:setup

Load some default data for your environment:

rake openfoodnetwork:dev:load_sample_data

At long last, your dreams of spinning up a development server can be realised:

rails server

Testing

Tests, both unit and integration, are based on RSpec. To run the test suite, first prepare the test database:

bundle exec rake db:test:prepare

Then the tests can be run with:

bundle exec rspec spec

The site is configured to use Zeus to reduce the pre-test startup time while Rails loads. See the Zeus github page for usage instructions.

Once npm dependencies are installed, AngularJS tests can be run with:

./script/karma run

If you want karma to automatically rerun the tests on file modification, use:

./script/karma start

Credits

Licence

Copyright (c) 2012 - 2015 Open Food Foundation, released under the AGPL licence.