The new backend for Talk
Build & start the docker containers:
docker-compose build
docker-compose up
open http://localhost:3000/
Alternatively use docker to run a testing environment bash shell and run test commands, run:
docker-compose run --service-ports --rm -e RAILS_ENV=test talkapi bash
- Install the gem dependencies for the application
bundle install
- Setup the test database **
RAILS_ENV=test bundle exec rake db:create
RAILS_ENV=test bundle exec rake db:schema:load
RAILS_ENV=panoptes_test bundle exec rake db:create
RAILS_ENV=test bundle exec rake panoptes:db:create_tables
RAILS_ENV=test bundle exec rake panoptes:db:setup
bundle exec rspec
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
-
Schemas - app/schemas
- Uses JSON Schema and JSON Schema Builder
- Conforms to the JSON Schema spec
- What request structure is expected and allowed in create and update actions
- Board
- Comment
- Conversation
- Discussion
- Moderation
- Subject
- Tag
- User
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
Using the gem https://github.com/clio/ten_years_rails to help with the upgrade path https://www.youtube.com/watch?v=6aCfc0DkSFo
docker-compose -f docker-compose-rails-next.yml build
docker-compose -f docker-compose-rails-next.yml run --service-ports --rm talkapi bash
## To run bash in test env
docker-compose -f docker-compose-rails-next.yml run --service-ports --rm -e RAILS_ENV=test talkapi bash
BUNDLE_GEMFILE=Gemfile.next bundle install
OR
next bundle install
Check the issues for what's in development.
Copyright 2014-2015 by the Zooniverse
Distributed under the Apache Public License v2. See LICENSE