No description
Find a file
2021-10-04 14:34:50 -04:00
.github/workflows Deliberately introduce failing test to verify automatic deploy 2021-09-10 11:08:27 -04:00
app Update to Bootstrap 5, basic styling 2021-10-04 14:34:50 -04:00
bin first commit 2017-02-23 12:52:56 -05:00
config we have a gauge! next up, let's style the page 2021-10-01 13:32:10 -04:00
data Update survey response csvs to use ISO 8601 date format 2021-09-27 15:00:45 -04:00
db Update Gemfile.lock and schema to reflect later version 2021-09-24 11:52:22 -04:00
lib rake data:load_survey_responses loads all csv files in the data/survey_responses/ directory 2021-09-22 21:03:12 -04:00
log first commit 2017-02-23 12:52:56 -05:00
public faq, 2018 nonlikert values 2019-01-11 16:19:07 -05:00
scripts Create scripts for common admin tasks 2021-09-28 09:53:36 -04:00
spec Update to Bootstrap 5, basic styling 2021-10-04 14:34:50 -04:00
tmp first commit 2017-02-23 12:52:56 -05:00
vendor/assets first commit 2017-02-23 12:52:56 -05:00
.editorconfig we have a gauge! next up, let's style the page 2021-10-01 13:32:10 -04:00
.gitignore Restore source control tracking of Gemfile.lock 2021-09-22 08:54:27 -04:00
.rspec user and recipient and tests 2017-02-25 11:00:27 -05:00
.ruby-version Update Ruby version to 2.7.4 2021-08-31 11:08:27 -04:00
config.ru first commit 2017-02-23 12:52:56 -05:00
Gemfile Update to Bootstrap 5, basic styling 2021-10-04 14:34:50 -04:00
Gemfile.lock Update to Bootstrap 5, basic styling 2021-10-04 14:34:50 -04:00
Procfile adding procfile 2019-07-16 17:01:27 -04:00
Rakefile first commit 2017-02-23 12:52:56 -05:00
README.md Updated readme file. Removed legacy readme sections 2021-09-28 17:56:02 +02:00

edcontext

This project contains three pieces:

  • A webapp for visualizing and understanding MCIEA survey data
  • Tasks for processing and indexing raw survey data
  • Experimental work to conduct survey samples via text message

This is a Rails project, deployed on Heroku.

Live app: https://mciea-dashboard.herokuapp.com/ Live dashboard: http://mciea-dashboard.herokuapp.com/districts/winchester/schools/winchester-high-school/dashboard?year=2020-21

Local development

Install Postgres and running first.

(MacOS, Optional), you can use Homebrew:

$ brew install postgres
$ brew services start postgresql

Linux:

Install postgres. Known working version is version 13

https://www.postgresql.org/download/

Once postgres is installed and running, install the required gems and then migrate the database.

$ bundle install
$ bundle exec rake db:create db:migrate db:seed

At this point you can run the app and login. There won't be any data yet though; keep reading!

The seed file populates the following tables

Name Description
School School ids are only unique to their district. More than one school has an id of 1
District Districts and schools have attached slugs. We find search for these models by their slugs
SqmCategory The legacy name here is Category. It still exits in the database. We wanted the freedom to make changes and still preserve the legacy site until the end of the engagement.
Measure In the bar graph measures represent a single bar
SurveyItem This table has an attribute prompt that is the question asked

SurveyItemResponses does not get populated at this stage.

Database

Postgres

Gems

Name Description
puma webserver
pg postgres
sassc-rails sass compiler
jquery-rails legacy, allows use of jquery
jbuilder legacy, build json objects
haml legacy, write views in haml syntax
bootstrap css framework
newrelic_rpm legacy?, application monitoring
devise authentication
omniauth authentication
twilio-ruby legacy, text messaging
activerecord-import faster database imports

External APIs

None yet. Hoping to integrate with Powerschool and Aspen for school administrative data.

Javascript libraries

None yet

css

Bootstrap 5

Loading Data

SurveyItemResponses is the most important table to understand.

SurveyItemResponses is the data that will change year to year and makes up the majority of the database records. Roughly 150,000 SurveyItemResponses per year.

# locally
bundle exec rake data:load_survey_responses

# on heroku staging environment
heroku run -a mciea-beta rake data:load_survey_responses

# on heroku production environment
heroku run -a mciea-dashboard rake data:load_survey_responses

Running tests

Prepare the test database.

bundle exec rake db:test:prepare

If you need to look at the rails console for the test environment

RAILS_ENV=test rails c
$ bundle exec rake

Continuous Integration

Pushing commits to the main branch triggers auto-deployment to the staging environment.

Deployments to production must be done through the Heroku web interface or via the Heroku command line