Public | Automated Build

Last pushed: 8 days ago
Short Description
Talk-Api
Full Description

Talk-Api

The new backend for Talk



Setting up

By default, Vagrant runs in the staging environment, so you'll want to add configurations:

  • database.yml

      staging:
        adapter: postgresql
        encoding: unicode
        pool: 5
        database: talk_staging
        username: talk
        host: <%= ENV['PG_PORT_5432_TCP_ADDR'] %>
        password: <%= ENV['TALK_DB_PASSWORD'] %>
    
  • panoptes.yml

      staging:
        host: 'https://panoptes-staging.zooniverse.org'
    
  • secrets.yml

      staging:
        secret_key_base: <%= ENV['SECRET_KEY_BASE'] %>
    

Then start everything up with

  bundle
  vagrant up
  open http://localhost:3000/

If you're running outside of vagrant and just want to run the specs ensure you've created all the databases and tables(foreign) via the following commands:

  1. RACK_ENV=test bundle exec rake db:create
  2. RACK_ENV=test bundle exec rake db:schema:load
  3. RACK_ENV=panoptes_test bundle exec rake db:create
  4. RACK_ENV=test bundle exec rake panoptes:db:create_tables
  5. RACK_ENV=test bundle exec rake panoptes:db:setup

See .travis.yml for more details.

Layout

The app is built to conform to the JSON API spec

  • Serializers - app/serializers
    • Uses RestPack Serializer
    • What attributes are included in the response ?user_id=1234
    • What associations can be side loaded ?include=comments,board
    • What links can be followed from the resource
  • Policies - app/policies
    • Uses Pundit
    • Who has permissions to perform actions
    • What records are visible to a user

Resources

  • Board
  • Comment
  • Conversation
  • Discussion
  • Moderation
  • Subject
  • Tag
  • User

Panoptes

Talk is built to integrate with Panoptes

Authentication is provided by signing your requests with a Bearer-Token

Some resources (User, Subject) are proxied from Panoptes

To-Do

Check the issues for what's in development.

License

Copyright 2014-2015 by the Zooniverse

Distributed under the Apache Public License v2. See LICENSE

Docker Pull Command
Owner
zooniverse
Source Repository