Training e-Support Service using Ruby on Rails.
Ruby HTML JavaScript CSS Other
Failed to load latest commit information.
app Get Event JSON response up to date with latest API version Feb 22, 2017
bin Added custom registrations controller to override devise. Apr 5, 2016
config Get Google Analytics code from secrets.yml. Fixes #427 Feb 22, 2017
db Merge branch 'master' into edit_dashboard Feb 6, 2017
lib Altered debugging code. Feb 3, 2017
public Added events to swagger doc Jun 21, 2016
scripts Added timezone field to event.rb #375. Nov 24, 2016
solr Readding solr conf stuff. Apr 22, 2016
test Test EditSuggestion worker Feb 8, 2017
vendor/assets Fixed masonry tiles with images being squashed together. #114, #136 Jul 25, 2016
.gitignore Re-add production environment config to git Feb 3, 2017
.rubocop.yml Added Rubocop :robot_face: Nov 18, 2016
.ruby-gemset Fix RVM ruby version and gemset Apr 29, 2016
.ruby-version Updated ruby to same version as scrapers Jul 25, 2016
.travis.yml Moved some config options into "tess.yml" Feb 3, 2017
Gemfile Get sitemap host from config, and link to various index pages. #421 Feb 21, 2017
Gemfile.lock Get sitemap host from config, and link to various index pages. #421 Feb 21, 2017
LICENCSE Added license file. Feb 29, 2016 Add description of rake tasks Feb 13, 2017
README.rdoc Initial commit, devise working with email. Sep 25, 2015
Rakefile Initial commit, devise working with email. Sep 25, 2015 Initial commit, devise working with email. Sep 25, 2015 Added a line to restart the TeSS webapp to the update script Oct 26, 2016


ELIXIR's Training e-Support Service using Ruby on Rails.

TeSS is a Rails 4 application.

Build Status


Below is an example guide to help you set up TeSS in development mode. More comprehensive guides on installing Ruby, Rails, RVM, bundler, postgres, etc. are available elsewhere.

System Dependencies

TeSS requires the following system packages to be installed:

  • PostgresQL
  • ImageMagick
  • A Java runtime
  • A JavaScript runtime

To install these under an Ubuntu-like OS using apt:

$ sudo apt-get install postgresql imagemagick openjdk-8-jre nodejs

RVM, Ruby, Gems

RVM and Ruby

It is typically recommended to install Ruby with RVM. With RVM, you can specify the version of Ruby you want installed, plus a whole lot more (e.g. gemsets). Full installation instructions for RVM are available online.

TeSS was developed using Ruby 2.2 and we recommend using version 2.2 or higher. To install it (after you installed RVM) and set up a gemset 'tess', you can do something like the following:

rvm install ruby-2.2-head rvm use --create ruby-2.2-head@tess


Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed for your Ruby application.

To install it, you can do:

$ gem install bundler

Note that program 'gem' (a package management framework for Ruby called RubyGems) gets installed when you install RVM so you do not have to install it separately.


Once you have Ruby, RVM and bundler installed, from the root folder of the app do:

$ bundle install

This will install Rails, as well as any other gem that the TeSS app needs as specified in Gemfile (located in the root folder of the TeSS app).


Install postgres and add a postgres user called 'tess_user' for the use by the TeSS app (you can name the user any way you like). Make sure tess_user is either the owner of the TeSS database (to be created in the next step), or is a superuser. Otherwise, you may run into some issues when running and managing the TeSS app.

Normally you'd start postgres with something like (passing the path to your database with -D):

$ pg_ctl -D ~/Postgresql/data/ start

From command prompt:

$ createuser --superuser tess_user

Connect to your postgres database console as database admin 'postgres' (modify to suit your postgres database installation):

$ sudo -u postgres psql

From the postgres console, set password for user 'tess_user':

postgres=# \password tess_user

If your tess_user is not a superuser, make sure you grant it a privilege to create databases:

postgres=# ALTER USER tess_user CREATEDB;

Handy Postgres/Rails tutorials:


TeSS uses Apache Solr to power its search and filtering system.

To start solr, run:

$ bundle exec rake sunspot:solr:start

You can replace start with stop or restart to stop or restart solr. You can use reindex to reindex all records.

$ bundle exec rake sunspot:solr:reindex


On macOS these can be installed and run as follows:

brew install redis
redis-server /usr/local/etc/redis.conf
bundle exec sidekiq

For a Redis install on a Linux system there should presumably be an equivalent package.

The TeSS Application

From the app's root directory, copy config/example_secrets.yml to config/secrets.yml.

$ cp config/example_secrets.yml config/secrets.yml

Edit config/secrets.yml (or config/database.yml - depending on your preference) to configure the database name, user and password defined above.

Edit config/secrets.yml to configure the app's secret_key_base which you can generate with:

$ bundle exec rake secret

Create the databases:

$ bundle exec rake db:create:all

Create the database structure and load in seed data:

Note: Ensure you have started Solr before running this command!

$ bundle exec rake db:setup

Start the application: $ bundle exec rails server

Access TeSS at:


(Optional) Run the test suite:

$ bundle exec rake db:test:prepare

$ bundle exec rake test

Live deployment

Although designed for CentOS, this document can be followed quite closely to set up a Rails app to work with Apache and Passenger:

To set up TeSS in production, do:

bundle exec rake db:setup RAILS_ENV=production

which will do db:create, db:schema:load, db:seed. If you want the DB dropped as well:

bundle exec rake db:reset RAILS_ENV=production

(which will do db:drop, db:setup)

unset XDG_RUNTIME_DIR may need setting in ~/.profile or similar if rails console moans about permissions.

Delete all from Solr if need be and reindex it:

curl http://localhost:8983/solr/update?commit=true -d '<delete><query>*:*</query></delete>'

bundle exec rake sunspot:solr:reindex RAILS_ENV=production

Create an admin user and assign it appropriate 'admin' role bu looking up that role in console in model Role (default roles should be created automatically).

The first time and each time a css or js file is updated:

bundle exec rake assets:clean RAILS_ENV=production

bundle exec rake assets:precompile RAILS_ENV=production

Restart your Web server.

Basic API

A record can be viewed as json by appending .json, for example:


The materials controller has been made token authenticable, so it is possible for a user with an auth token to post to it. To generate the auth token the user model must first be saved.

To create a material by posting, post to this URL:


Structure the JSON thus:

    "user_email": "",
    "user_token": "your_authentication_token",
    "material": {
        "title": "API example",
        "url": "",
        "short_description": "This API is fun and easy",
        "doi": "Put some stuff in here"

A bundle install and rake db:migrate, followed by saving the user as mentioned above, should be enough to get this working.

Rake tasks

To find suggestions of EDAM topics for materials, you can run this rake task. This requires redis and sidekiq to be running as it will add jobs to a queue. It uses BioPortal Annotator web service against the materials description to create suggestions

bundle exec rake tess:add_topic_suggestions