local food management stuff
Local Orbit is an open source web application and service that empowers food hubs to efficiently sell and distribute local food.
See the docs/
directory for more documentation.
ruby 2.3.8
(use a ruby version manage like rbenv or rvm)git clone [email protected]:LocalOrbit/localorbit.git
, cd localorbit
into itbrew bundle
. Other platforms see requirements in [Brewfile
](./Brewfile).bundle
cp config/application.yml{.example,}
and modify if needed, see Environment variables belowcp config/database.yml{.example,}
and modify if needed (Some modification is probably necessary. Try adding template: template0
)yarn
rake db:setup
- runs db:create
, db:schema:load
and db:seed
rake db:seed:development
- See Test Accounts section for usernames and passwordsrails server
127.0.0.1 localtest.me
to /etc/hosts
./bin/delayed_job run
(caveat: delete jobs from that table first if loading in production data)brew bundle
.)ENV
is generally accessed via figaro in application code. Figaro enforces presence of required ENV
vars via [config/initializers/figaro.rb
](./config/figaro.rb). In development
and local test
environments we populate/customize ENV
via figaro with config/application.yml
(see an [example application.yml](./config/application.yml.example)). For Heroku staging
and production
environments the ENV
vars are populated with Heroku cli. For CircleCI, sensitive ENV
vars like API keys and other secrets are managed via the Circle CI web application, and non-sensitive ENV
vars are managed via the [.circleci/config.yml
](./.circleci/config.yml).
Running rake db:seed:development
makes the following test accounts available
Selling Organization
Email: [email protected]
Password: password1
Buying Organization
Email: [email protected]
Password: password1
Market Manager
Email: [email protected]
Password: password1
Admin
Email: [email protected]
Password: password1
Specs live in spec/javascripts/*.js.coffee
Run suite on command line: bundle exec rake konacha:run
Run suite via browser: bundle exec rake konacha:serve (then visit http://localhost:3500)
Run suite automatically on changes to javascript sources or specs: bundle exec guard
Run rake db:dump:staging
WARNING: This will replace EVERYTHING in your development db with what is currently on staging
Below is a quick overview, for more granular tasks see [production-copy.rake](lib/tasks/production-copy.rake).
If no existing cleansed production dump, all-in-one go:
rake production_copy:stomp_dev_db DOWNLOAD_NEW=YES REALLY=YES
If an existing dump:
rake production_copy:stomp_dev_db REALLY=YES
Or two step
rake production_copy:bring_down
rake production_copy:stomp_dev_db REALLY=YES
Load production data into staging via development, will also sync s3 from production to staging:
rake production_copy:to[staging]
Or if you already have a recent copy of production in development do:
rake production_copy:push_out[staging]
There are binstub helpers in $RAILS_ROOT/bin
that allow for shortcuts when dealing with Heroku environments. See binstubs plugin for usage & more info.
See [development process](docs/development_process.md).