Code Monkey home page Code Monkey logo

ashoka-survey-web's Introduction

survey-web Build Status

A web application to create and conduct surveys

Terminology

  • Survey - Collection of Questions
  • Question - A specificaton for a piece of info that the survey designer wants to collect.
  • Answer - A piece of information for a question
  • Response - The set of a user's answers for a particular survey

Setup

Database

  • You need to set up a local database. Any of the databases supported by Rails will work, but PostgreSQL is recommended.
  • Some tutorials are here and here. If you're on a mac, use Heroku's Postgres.app
  • Make a copy of the database.yml.sample provided (in the config directory); name it database.yml
  • Fill in the details for your database.

For example, the database.yml will look something like this if you're using Postgres.app:

development:
  adapter: postgresql
  encoding: utf8
  database: survey_web_dev
  pool: 5
  username: 
  password: 
  host: localhost

test:
  adapter: postgresql
  encoding: utf8
  database: survey_web_test
  pool: 5
  username: 
  password:
  host: localhost

production:
  adapter: postgresql
  encoding: utf8
  database: survey_web_prod 
  pool: 5
  username:
  password:
  • Navigate to the survey-web directory from a terminal.
  • Type rails server
  • If the server starts up without complaining, your database is set up correctly.

Gems

  • To install all the libraries required by this application, navigate to the survey-web directory from a terminal.
  • Type gem install bundler and then bundle install

OAuth Provider

This app works with an OAuth Provider that you'll need to set up as well. You can clone it at http://github.com/c42/user-owner

  • Login as super_admin in the user-owner app

  • Click on Add a new application

  • The redirect uri would be http://SURVEY_WEB_URL/auth/user_owner/callback (SURVEY_WEB_URL is the URL where the survey-web app is hosted)

  • You will then have the Application ID and the Secret.

  • Create a config/application.yml file in this (survey-web) app

  • Add the following to it:

OAUTH_ID: # Application ID of the OAuth provider.
OAUTH_SECRET: # Secret of the OAuth provider.
OAUTH_SERVER_URL: # URL where the OAuth Provider instance is hosted.

Finally...

Start the survey-web app by typing rails server from the console.

Troubleshooting

Please check the Troubleshooting section of the wiki, or create an issue if you need any help.

Contributing

  • We use Pivotal Tracker to manage our projects. You can have a look at the bugs and features that you could work on.
  • If you need any help, mail us at [email protected].

Other Notes

Setup delayed_job to Upload Photos to Amazon S3

  • If delayed_job workers aren't running, photos will stay on the app server, and will not be migrated to S3.
  • Setup Carrierwave with your Amazon S3 credentials.
  • Start delayed_job workers using script/delayed_job. Look here for documentation.
  • If you're deploying to EngineYard, a deploy hook is provided in deploy/after_restart.rb.

Setup organization deletion

  • Organizations can be (soft) deleted on user-owner
  • Running rake db:remove_deleted_organizations_data on survey-web will delete all data (surveys, questions, responses etc.) belonging to any soft-deleted organisations
  • Run it in a cron job so that this cleanup doesn't have to happen manually (although it is delayed)

Setup Logentries on Engineyard

To include unicorn and nginx config files as well, follow the instructions provided by EngineYard to upload a custom recipe, but replace configure.rb with the contents of this gist.

ashoka-survey-web's People

Contributors

aakashd avatar arpancj avatar jithugopal avatar kitallis avatar s2bshakti avatar srushti avatar timothyandrew avatar vibinnair avatar who828 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.