Giter VIP home page Giter VIP logo

Local Orbit

CircleCI

See the docs/ directory for more documentation.

Developer Setup

  1. Install ruby 2.3.8 (use a ruby version manage like rbenv or rvm)
  2. Clone this repo git clone [email protected]:LocalOrbit/localorbit.git, cd localorbit into it
  3. Install dependencies (for MacOs) via Homebrew with brew bundle. Other platforms see requirements in Brewfile.
  4. bundle
  5. cp config/application.yml{.example,} and modify if needed, see Environment variables below
  6. cp config/database.yml{.example,} and modify if needed (Some modification is probably necessary. Try adding template: template0)
  7. yarn
  8. rake db:setup - runs db:create, db:schema:load and db:seed
  9. rake db:seed:development - See Test Accounts section for usernames and passwords
  10. rails server
  11. Add 127.0.0.1 localtest.me to /etc/hosts
  12. Go to http://localtest.me:3000 in a browser (we use localtest.me to always point to 127.0.0.1 so we can use subdomains, which localhost doesn't allow.)
  13. Run delayed job in foreground with ./bin/delayed_job run (caveat: delete jobs from that table first if loading in production data)

Other required services to setup

  • See stripe howto for configuring stripe for development.
  • Setup a mailtrap account and put the username and password into your application.yml
  • AWS is used by the app to store images as well as transferring db backups between environments.
    1. Get an invitation to the AWS account
    2. Configure an API key and secret
    3. Configure the AWS cli tools (which should already be installed via brew bundle.)

Environment variables

ENV is generally accessed via figaro in application code. Figaro enforces presence of required ENV vars via config/initializers/figaro.rb. In development and local test environments we populate/customize ENV via figaro with config/application.yml (see an example application.yml). 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.

Production Setup

  • At least one Market must be created before creating Organizations

Test Accounts

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

Javascript Specs

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

Cloning staging for local development

Run rake db:dump:staging

WARNING: This will replace EVERYTHING in your development db with what is currently on staging

Load production data into development or staging

Below is a quick overview, for more granular tasks see production-copy.rake.

Into development

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

Into staging

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]

Heroku Notes

There are binstub helpers in $RAILS_ROOT/bin that allow for shortcuts when dealing with Heroku environments. See binstubs plugin for usage & more info.

Contributing

See development process.

Local Orbit's Projects

localorbit icon localorbit

Local Orbit is an open source web application and service that empowers food hubs to efficiently sell and distribute local food.

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.