Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

kindlyops/chirpyhire

Repository files navigation

README

Zero to Green

  1. Install xcode command line tools and homebrew
  2. brew install rbenv ruby-build libpq readline yarn
  3. Follow printed instructions on activating rbenv in your shell
  4. RUBY_CONFIGURE_OPTS=--with-readline-dir=brew --prefix readline rbenv install 2.6.2
  5. git clone git@github.com:kindlyops/chirpyhire.git
  6. cd chirpyhire
  7. ruby -v should show version 2.6.2. which ruby should show an rbenv path similar to /Users/emurphy/.rbenv/shims/ruby
  8. gem install foreman
  9. gem install bundler
  10. bundle config --local build.pg --with-opt-dir="/usr/local/opt/libpq"
  11. bundle install
  12. yarn install
  13. rbenv rehash

Set up PostgreSQL and Redis

  1. brew install redis (remember to start redis)
  2. set up https://postgresapp.com with PostgreSQL 10

initialize the environment

  1. rails db:create && rails db:migrate && rails db:seed && rails assets:precompile
  2. rspec
  3. ./start
  4. open localhost:3000

Experimental docker alternatives

  1. Install docker and docker-compose.
  2. Get .env file from a developer. You can use dummy keys to help run tests.
  3. build containers, set up database
docker-compose up -d
docker-compose exec website rails db:create
docker-compose exec website rails db:migrate
docker-compose exec website rails db:seed
docker-compose exec website rails assets:precompile
open localhost:3000

Demoing App

Ensure you have a clean install: rails db:drop && rails db:create && rails db:migrate && rails db:seed Start Local Server: foreman start -f Procfile.dev

TODO: describe how to use the demo environment

Twilio Development

Use ngrok tunnel For Twilio Webhook: ngrok http 3000 Login to Twilio and set SMS Webhook URL to the Dynamic ngrok URL. More info

Stripe Development

Use test keys and test environment.

To run a single rspec test

rspec spec/models/contact_spec.rb

to run the rspec tests for the reminders

rspec spec/lib/reminder/**

Interactive database maintenance

To get a local rails console:

rails console

Find a user

a = Account.find_by_email 'demo@chirpyhire.com'