Giter Club home page Giter Club logo

cityvoice-survey-builder's Introduction

CityVoice Survey Builder

Running Locally

  • Clone the repo
  • Install Ruby 2.2.2 if not already installed (with rvm, rvm install 2.2.2)
  • Install dependencies with bundle install
  • Set dummy environment variables:
  • HEROKU_OAUTH_ID
  • HEROKU_OAUTH_SECRET
  • Install redis (brew install redis on OSX using homebrew)
  • Set REDISTOGO_URL to redis://localhost:6379 (or whatever your local connection is)
  • Run the app with bundle exec rackup and open your browser to http://localhost:9292

Testing

Test the builder with RSpec:

rspec

Deployment

Non-CFA users shouldn't need to deploy this, but for documentation purposes, here goes!

First, go to your account page on Heroku and under 'API Clients' click the 'Register API Client' button.

There, set the Name (whatever you want) and the OAuth Callback URL (this will be /callback on your deployment, for example: https://my-cityvoice-builder-instance.herokuapp.com/callback )

Once you've done that, note the 'ID' and 'SECRET' it gives you.

Now, clone this repo and cd into the folder. From there, create a Heroku app with your own name and the multi buildpack:

$ heroku create --buildpack https://github.com/ddollar/heroku-buildpack-multi.git my-cityvoice-builder-name

Now, configure your Builder app with the ID and SECRET from above:

$ heroku config:set HEROKU_OAUTH_ID=lolmyoauthid
$ heroku config:set HEROKU_OAUTH_SECRET=lolmysecret

Now push!

$ git push heroku master

Lastly, provision Heroku's RedisToGo add-on:

$ heroku addons:add redistogo:small

(Details and pricing [$39/mo for the small add-on shown above] can be found at: https://addons.heroku.com/RedisToGo )

Copyright Code for America Labs 2014, MIT License

cityvoice-survey-builder's People

Contributors

daguar avatar migurski avatar phae avatar waltz avatar jmadans avatar

Stargazers

shkfnly avatar J avatar Leonard Bogdonoff avatar Manbir avatar Pantelis Koukousoulas avatar

Watchers

Chris avatar  avatar Michael Cowden avatar Erica avatar Mike Rotondo avatar Tom Dooner avatar Rapi Castillo avatar Ben Golder avatar Tomas Apodaca avatar Norris Hung avatar James Cloos avatar Matthew Loveless avatar  avatar  avatar Jennifer Pahlka avatar Christopher Whitaker avatar Charlie Weems avatar Jenn Thom avatar Erie Meyer avatar  avatar Josh Stroud avatar Ricardo Kreyhsig avatar Christa Hartsock avatar  avatar Devon Hirth avatar  avatar Shannon Byrne avatar Kerry Rodden avatar Jen Long avatar Mike Hernandez avatar alsomanya avatar Cyd Harrell avatar  avatar Tiffany Andrews avatar Allison Morgan avatar  avatar Amelia Hoover Green avatar Jason Marshall avatar  avatar B. Seeger avatar Fritz Jooste avatar  avatar  avatar Zoe Blumenfeld avatar Cypress Borg avatar Amita Shukla avatar Greg avatar  avatar  avatar Monique avatar  avatar Hashim Mteuzi avatar Yejee Arin Choi avatar Britney Epps avatar Paige O'Connor avatar  avatar

cityvoice-survey-builder's Issues

Change Redis tier on Heroku

Currently "Small" (100mb, $39/month) — will want to adjust based on usage; can probably make big for launch and then bring down to lower tier a few weeks after

Create and connect to a CfA subaccount

Right now the builder prompts the user to set up their CityVoice survey with a number from a free,trial Twilio account. The trial accounts give every survey respondent calling in a confusing "please upgrade your account" prompt. This will deter City staff users from pushing out their survey.

To avoid the prompt message, Twilio has advised us to set up sub-accounts for users that give them access to CfA credits. This requires a few significant changes in the builder:

  • Remove direction to set up a Twilio account
  • Create subaccount for the city with request to the Twilio API
  • Connect the phone number to the Heroku through automation OR serve up a login to the Twilio subaccount for a user to do themselves

Related documentation for creating subaccountsI: https://www.twilio.com/docs/howto/subaccounts

Test to see if addl' help text improves audio quality

Test whether adding additional help text at two points in the recording flow reduces attempts and quality of the recording:

1.Additional static text below:
"For a clear recording go to a quiet place; use headphones with a microphone if on hand"

2.After clicking record:
Add a 5 second countdown with direction to speak slowly and clearly.

screen shot 2015-01-15 at 12 32 17 am

Edit landing page text

Update text to:

  • Clarify expectation that the user has all of their locations and questions figured out before they start the builder
  • Nix the telephone as a necessity to start the builder
  • Add direction to read user manual and contact cityvoice@ before getting started.

landingpage_text

Incorrect instructions at end of setup

They tell you to add a phone number, but that’s not right. Tell people go visit the App URL and look for the number, or display the phone number in the builder flow.

User should configure phone number first

Will need to write to app_content_set.csv; right now, the app in web just shows the default phone number

This will probably need to go at the "push" point (pushing to Heroku)

Edit final copy for calling in

The current copy at the end of your build says you can call in with location code 001 to try out the survey.

001 isn't a test location — it's just the first location. While I think it's still useful for people to call in after their deploy, we should rephrase the text and give instructions on how to reset the database (not hard, but it is command line-y).

Gracefully handle Heroku app errors

App build response: {"id"=>"invalid_params", "message"=>"You've reached the limit of 5 apps for unverified accounts. Add a credit card to verify your account."}

Remove "short name" input for agree/disagree questions

Right now, for Agree/Disagree questions we ask the user to provide both the text of the question as well as a "short name":

screen shot 2014-08-19 at 9 01 23 am

The CityVoice backend requires a short name, and it is shown as a header inside the CityVoice web interface, i.e.:

screen shot 2014-08-19 at 9 03 04 am

@migurski suggested removing the "short name" fields from the Builder — totally reasonable effort-minimization for a "trial" deploy — but opening an issue to discuss this.

If I do this, I will probably simply make the short names "Question 1", "Question 2", etc.

Resolve Heroku Platform API error

More postmortem-y, but BLUF:

  • Heroku's Platform API was changed to make the default stack a new one (Cedar-14 instead of Cedar)
  • The new stack withdrew support from CityVoice's Ruby version, which broke new builds

I've confirmed my fix for this (by explicitly deploying to the older Cedar stack). I am also attempting to bump CityVoice to Ruby 2.1.3 and see if it causes problems. If not, I will upgrade the master CityVoice repo and update the builder to use Cedar-14.

cc @cydharrell

Allow locations to be deleted

Particularly needed because if someone doesn't put in the city they may get something way out there — this'll let them do some trial and error.

Give clear details on the built app

For example

  • Want to tell users they can download their tarball at /USERTOKEN/tarball/download within some timeframe (and that they can then follow the deploy instructions at XYZ in the Readme to further customize+deploy their version)
  • Want to tell users how to delete their app

Audio file saving broken

Reported by @jmadans, for some reason the builder is having trouble reading (or possibly writing) audio files to disk prior to loading them into Redis.

Here's what's going on in the logs:

screen shot 2015-04-15 at 7 05 55 pm

The relevant code is here:

    wav_path = params["data"][:tempfile].path
    mp3_path = "/tmp/#{user_token}_audio_#{audio_name}.mp3"
    # Convert wav to mp3
    system("lame -V 2 #{wav_path} #{mp3_path}")
    # Read mp3 as binary and put in Redis
    raw_mp3_binary_data = IO.binread(mp3_path)

It's blowing up on the IO read saying there's no file there.

This is odd — my guess is it's something related to a platform upgrade (ie, how shelling out is working) because otherwise nothing has changed in the code.

@migurski — do you have any thoughts?

Add links to 'location list' and 'sign generator'

Right now our beautiful functionality for making CityVoice surveys relevant in the digital world are completely hidden in the builder.

Let's add links at the end of the builder to wayfind people to their next steps.

Add instructions for customizing instance deployed through the builder

Because this builder app deploys to Heroku, we'll want "bridge" instructions for a user to be able to:

  1. git clone from their Heroku deploy to their local computer
  2. Further customize (links to documentation in main repo will suffice)
  3. Reset the database to clear any data from when they tested the instance

This way, users can keep the locations/questions they configured using the builder app, but make further customizations.

Let callers *finish* open-ended answers

"You will have thirty seconds to your record your comments?"

I don’t know what thirty seconds feels like, neither do most people. Can we let people finish their answer to the open ended question by hitting the # key?

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.