Skip to content

kagron/irb

Repository files navigation

IRB image

Aurora University IRB application

Created by Kyle Grondin, Anthony Barrios, and Brandon Pichen

Ruby 2.4.1

Rails 5.1.4


The Institutional Review Board (IRB) is a web application designed to connect the investigator with Aurora University’s Institutional Review Board easily and efficiently. The purpose of the IRB web app is to provide a platform where investigators at the university can submit an application for ethics and safety review and Board members can effectively review, discuss, vote, and assign applications among each other.

If you're looking for information on using the software:

For Board Members: IRB Board Manual

For Users: IRB User Manual

For the student(s) who might maintain this: scroll down to Further Guides and References or changing the application process / adding new features. There is also a documentation.md located in this repository for more information about the various files and directories along with common issues and how to troubleshoot them!

This application was developed in the MVC Framework Ruby on Rails and is currently running on a CentOS server. Every line of code is commented ( we think ), and any resources we used are linked below. HTML, CSS, ad Jascript/jQuery were also used. Automation was done using the Whenever gem which allows for using CronTab easily in Ruby syntax. We would run rake tasks on a daily basis located in the lib/task folder. Any diagrams/presentations/notes we have will be in the repository as well.

A lot of our functionality came from gems. What and why we used it is in our Gemfile.

Features

  • Login
  • Document Submission: Users can submit an application and attach PDFs to be reviewed
  • Reviewable: Each application can then be seen by board members
  • Assignments: Chair of the board can assign applications to other board members (and delete them if needed)
  • Commenting: Board members can comment on the application and then vote on what state they think it should be
  • Emailing: Emailing the chair when a new application comes in, and email the user when their application is finished reviewing
  • Revisions: Users can then resubmit their application with changes if needed
  • Stamping: Stamp each approved PDF with an approved stamp so the investigator can hand it out to the people being investigated
  • Archival: Every application is archived either after approval or 3 months of inactivity
  • Searching: Search all the applications and sort by date and name
  • Changing Board and Chair Members: The Chair of the board can easily add/remove current board members or add a new chair member
  • Read Only Role: There is also a read only role in case there's a person in the board who just needs to view applications

Requirements to Run Locally

  1. Ruby 2.4.1+
  2. Rails 5.1.4+
  3. ElasticSearch
  4. MySql Community Server
  5. NodeJS
  6. Git

If you're using Linux, we recommend you use RVM or RBEnv for managing your Ruby version and gems (including Rails). For Windows: Download the Ruby Installer here. Once you have Ruby installed, download Rails by typing in gem install rails. For MySQL, theres a windows installer here that you can download. For NodeJS, the installer is here. For more guides, scroll down to Further Guides and Resources.

Getting Started Locally

  1. Clone by typing git clone https://github.com/kagron/irb.git into terminal / command prompt
  2. cd irb
  3. Make sure your config/database.yml file has the correct username and password for your local MySQL user
  4. bundle install
  5. Create databases in mysql by running rake db:create
  6. rake db:create
  7. rake db:migrate
  8. service elasticsearch start
  9. rails s
  10. Open up http://localhost:3000/ in your preferred web browser

If you're on windows, step 8 will be different. For installation on windows go here and for more general information go to the Getting Started guide here. Make sure you install Elastic Search as a service if you're using Linux, otherwise just make sure its running by checking http://localhost:9200/

Accessing the live server

  1. Use Putty (Windows) or terminal (Linux/Mac) to SSH into the server
  2. Hostname: irb.aurora.edu
  3. Password: Will be supplied to whoever is maintaining the app
  4. Files will be located in /var/www/irb
  5. Ruby is installed via RVM
  6. Nginx config file is in /opt/nginx/config/nginx.conf

Deploying/Re-Deploying the application

Currently the deployment is NOT using a script or application to pull from github, so we have do that manually. I also did not set up an SSH key to this github to the server because that gives more access to my github than just the IRB application.

  1. Make sure your latest changes are pushed to either your forked master branch or the master branch here
  2. Change directories into /var/www/irb
  3. Pull the changes into the directory
  4. Migrate any new database changes via rake db:migrate
  5. If the application is being deployed for the first time, make sure the database is clean by running rake db:reset (Note this will also erase everything including users, so make sure to recreate the board members)
  6. Reindex User tables if needed rake searchkick:reindex class=User
  7. Restart the nginx server by typing in service nginx restart. If deploying to a new server, you will likely need to set the rails environment to production instead of development
  8. Check the website
  9. If needed, nginx logs everything to /var/log/nginx/error.log if it's stricly a nginx error, otherwise your errors will likely end up in /var/www/irb/log/production.log if in production, otherwise it's /var/www/irb/log/development.log.

Implementing AU's Single Sign On

Truthfully, when designing this application, Single Sign in was always considered but we were never entirely sure how to prepare for it. So currently, users will have to register and log in. If you need to implement Single Sign On, we suggest still using our users table because that is what our application is based around. In order to do that, you could perhaps treat them as "profiles" instead of regular users. What we mean by this, is that when a user logs in using Single Sign On, they still get a user created in our database but it is instead treated as a profile. This way, you dont need to go through the entire application changing authorization and/or figuring out permissions. Permissions work by checking the current user and determining whether they have permissions based on a boolean value stored in the database. If you were to use Single Sign On, you would not have alteration priviliges to Aurora University's database and thus, the application breaks.

Some files to look at:

  • /app/controllers/registrations_controller.rb - This is a file that overrides the Devise controller. We use this to modify how registrations are handled. You might be able to just do everything in the sign_up_params method
  • /app/models/user.rb - This is the file related to the Users model. You might be able to add some things in here
  • Devise - This is the gem that we used for User authentication. It provides everything we needed and can be accessed via rails helper methods. For any questions/guides/concerns, check this place first.

Further Guides and Helpful References

Changing the Application Process / Adding other features

This application is personalized to the Aurora University Institutional Review Board. In order to add / remove parts of the application process, the documents table will need to be changed. Each application is called a 'document' in our database. Ruby on Rails uses an Active Record model to abstract the database. So in order to modify the application/document, you will need to create a migration which can be read about here. Once the table is modified, the model is located in app/models/document.rb and the controller for modifying various actions is in app/controllers/documents_controller.rb! If you do not know about MVC logic, a link to MVC frameworks is linked above.

Other features will likely require JavaScript / other tables in the MySQL Database. Anything that needs to be saved from page to page should be in session variables or saved in a table. Anything that pertains to how the application behaves ( examples being validation, fancy animations when doing something, AJAX ) should be done in CSS/JavaScript/AJAX. For starters, we recommend looking into SASS for CSS related stuff, Axios for AJAX related stuff, and React/Angular/VueJS for anything else Javascript related.

If it is related to automation, take a look at how Whenever works. It allows for easy Cron jobs using Ruby syntax. You can use this to run Rake tasks in any interval possible.

If all else fails, try looking up a gem to do what you want! There's thousands of gems and there's generally something out there for what you need done.

Contribution

Thank you for considering contributing to our Institutional Review Board web application. Feel free to fork and create a pull request! The documents table was created specifically for Aurora University's Institutional Review Board, so in order to truly utilize the application, the application process should be customized to the board.

License

The Institional Review Board is open-sourced software licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published