Repository is archived
No commit activity in last 3 years
No release in over 3 years
Enables users to manage arms/trials, groups, users, participants, and memberships.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.18
~> 3.5.0.beta3
= 0.40
~> 0.9.1
~> 0.7

Runtime

~> 1.9
~> 3.1.3
~> 0.5
 Project Readme

ThinkFeelDoDashboard

Build Status security

This is a rails engine that allows for the CRUDing and Enrolling of participants, the CRUDing of users and their roles, groups, assigning coaches to participants and assigning participants to groups, and assiging moderators to groups (and thus indirectly arms).

Mockups

Membership & Enrollment Mockups

Download

git clone https://github.com/NU-CBITS/think_feel_do_dashboard.git [name of folder]

Assumptions

This engine expects there to be multiple models:

  1. Participant: a Devise-like API available and an authenticatable Participant class stored in a participants table;
  2. Arms: an Arm class stored in the arms table and has a title:string and belongs to a project. Arms are also determined to be social or not via is_social:boolean
  3. Group: a Group class stored in the groups table and has a title:string and is dependent on belonging to an arm.
  4. Membership: a Membership class that stores a group_id:integer and participant_id:integer in the memberships table. Each membership as a start_date:date and end_date:date that determines if the participant [membership] is active
  5. User: a Devise-like API available and an authenticatable User class stored in a users table but referred to as coaches;
  6. CoachAssignment: a CoachAssignment class that stores the participant:integer and user_id:integer in the coach_assignments table;
  7. Reports and class that depend on reports. The Reports module references ContentModules and ThinkDoFeelEngine. Accessing the index page of reprots /think_feel_do_dashboard/reports will not break, but downloading CSVs will break unless the host application has ContentModules and the ThinkDoFeelEngine.

Installation

Update your Gemfile:

gem 'think_feel_do_dashboard', git: 'git://github.com/NU-CBITS/think_feel_do_dashboard.git'

Update gems:

bundle install

Add the routes by configuring your routes.rb file:

Rails.application.routes.draw do
  ...
  mount ThinkFeelDoDashboard::Engine => "think_feel_do_dashboard"
  ...
end

Note: You will have access to additional routes.

  1. home: /think_feel_do_dashboard
  2. arms: /think_feel_do_dashboard/arms
  3. groups: /think_feel_do_dashboard/groups
  4. participants: /think_feel_do_dashboard/participants
  5. memberships: /think_feel_do_dashboard/participants/1/groups
  6. coach_assignments: /think_feel_do_dashboard/participants/1/coaches
  7. reports: /think_feel_do_dashboard/reports

Add the appropriate password concern to the app/models/user.rb file:

class User < ActiveRecord::Base
  include ThinkFeelDoDashboard::Concerns::Password
  ...
end

You may have to create a user.rb file containing a User model and extend it from another engine's User model app/models/user.rb. For instance,

require File.expand_path("../../app/models/user",
                         AnotherEngine::Engine.called_from)

# Extend User model.
class User
  include ThinkFeelDoDashboard::Concerns::Password
end

Add the appropriate password and validation concerns to the app/models/participant.rb file:

class Participant < ActiveRecord::Base
  include ThinkFeelDoDashboard::Concerns::Participant
  include ThinkFeelDoDashboard::Concerns::Password
  ...
end

You may have to create a participant.rb file containing a Participant model and extend it from another engine's Participant model app/models/participant.rb. For instance,

require File.expand_path("../../app/models/participant",
                         AnotherEngine::Engine.called_from)

# Extend Participant model.
class Participant
  include ThinkFeelDoDashboard::Concerns::Participant
  include ThinkFeelDoDashboard::Concerns::Password
end

Add the appropriate group concern to the app/models/group.rb file:

class Group < ActiveRecord::Base
  include ThinkFeelDoDashboard::Concerns::Group
  ...
end

You may have to create a group.rb file containing a Group model and extend it from another engine's Group model app/models/group.rb. For instance,

require File.expand_path("../../app/models/group",
                         AnotherEngine::Engine.called_from)

# Extend Group model.
class Group
  include ThinkFeelDoDashboard::Concerns::Group
end

Add the appropriate membership concern to the app/models/membership.rb file:

class Membership < ActiveRecord::Base
  include ThinkFeelDoDashboard::Concerns::Membership
  ...
end

You may have to create a membership.rb file containing a Membership model and extend it from another engine's Membership model app/models/membership.rb. For instance,

require File.expand_path("../../app/models/membership",
                         AnotherEngine::Engine.called_from)

# Extend Membership model.
class Membership
  include ThinkFeelDoDashboard::Concerns::Membership
end

Install the engine's migrations into the host application and migrate:

bundle exec rake think_feel_do_dashboard:install:migrations
bundle exec rake db:migrate

You will have to include any .css or .js files in the host app's to be precompiled app/config/initializers/assets.rb. For example,

...
Rails.application.config.assets.precompile += %w(think_feel_do_dashboard.css think_feel_do_dashboard.js)
...

Be sure to restart your server after you mkae the modifications.

Or you can run the migration locally for your spec/dummy:

bin/rake db:migrate

Dependencies

ruby: 2.1.2

rails: ~> 4.1.7

Configuration

Application Name: ThinkFeelDoDashboard

Github Repo: https://github.com/NU-CBITS/think_feel_do_dashboard

Production Url: N/A

Staging Url: N/A

Confluence: N/A

Database initialization/creation

Make sure you are in the top level folder; i.e., think_feel_do_dashboard. Then run:

bundle exec rake app:db:drop app:db:create app:db:migrate

Seeding Database with engine specific fixtures

app:seed:with_think_feel_do_dashboard_fixtures

Running Specs

After you migrate the database, you may have to update the engine's testing environment:

  bundle exec rake app:db:drop app:db:create app:db:migrate RAILS_ENV=test

Compelete setup (drops and creates the database, runs migrations, and seeds the database with fixtures):

  bundle exec rake setup

Because we have combined brakeman, rubocop, and rspec, you can just run the rake command to run everything:

bundle exec rake

Publishing to RubyGems

Build the think_feel_do_dashboard gem

gem build think_feel_do_dashboard.gemspec

Publish to rubygems.org

gem push think_feel_do_dashboard-x.x.x.gem

View the published think_feel_do_dashboard gem here

Services

N/A

Deployment Instructions to Host

See the "Installation" instructions above.