- In order to use this sample application, clone the repository and cd to it:
git clone https://github.com/3dna/people_view
cd people_view
- Once inside, you must install the project's dependencies with bundler:
bundle install
- Once the bundling process completes, you need to provide database credentials in config/database.yml
cp config/database.yml.example config/database.yml
# edit database.yml to match your configuration. The example file is sufficient to start
- Migrate the database you set up:
bundle exec rake db:migrate db:test:prepare
- Run the server:
bundle exec script/rails server
Now you should be able to use the application, just navigate to http://localhost:3000 by default
Please read the API documentation for more information on API usage.
When you navigate to the sample app root path, you should see an empty page.
- Click "New Nation" to register a nation with this sample application
- At this point you will need an application that has a redirect_uri of the host you are using:
- Go to an API-whitelisted nation's control panel
- Navigate links from Settings > OAuth > New Application
- Name this application, for example "People View Local"
- Set the Redirect URI to the fully qualified domain name and protocol you are using, with the path "callback", ex. "http://localhost:3000/callback"
- Click "Register" and note your client uid and secret key for the next step
- Fill in the details of your nation:
- Give it a meaningful name. ex. Foobar Nation
- Provide the url, including https protocol. ex. https://foobar.nationbuilder.com/
- Provide the client uid and secret key you got from registration of your app
- The file input is for a logo, feel free into upload an image
- When you submit the form you should be redirected to the nation selection page. Select your nation there and it should take you through the authorization process.
- Optionally sign into your nation
- When you accept the request to use the data, you should be redirected to the people list