Giter VIP home page Giter VIP logo

rollcall-attendance's Introduction

Roll Call Attendance Tracker

Dependencies

  • Ruby 2.2
  • PostgreSQL
  • Redis

Development setup

Roll Call can be run locally on your machine or with Docker. These instructions assume you are using Docker.

1. Setup Canvas:

You need to have a local Canvas install running, and it needs to be in docker (otherwise having rollcall post back to it will not work, it needs a domain both it and the browser can reach).

Follow our general Docker setup here: https://github.com/instructure/canvas-lms/blob/stable/doc/docker/getting_docker.md

And our Canvas in Docker setup here: https://github.com/instructure/canvas-lms/blob/stable/doc/docker/developing_with_docker.md

Once you have a dockerized Canvas up and running, you need to add a developer key to Canvas for rollcall to connect with. As an admin account, go to http://canvas.docker/accounts/<id>/developer_keys, create one with a tool_id of "rollcall" and a redirect url of http://rollcall.docker/canvas_oauth. Once it's been created, get the ID number (an integer) from the index page along with the token and add them as CANVAS_KEY and CANVAS_SECRET, respectively, in .env.

2. Docker build + Database migrations:

Now you should be able to build your containers with:

docker-compose build

You can get your database prepped for development with the normal rake tasks, you just have to run them in the container:

docker-compose run --rm web bundle install
docker-compose run --rm web bundle exec rake db:create
docker-compose run --rm web bundle exec rake db:migrate

3. Run it!

You should be able to start everything with:

docker-compose up

This will start up 5 containers: a web process to hit with your browser, a worker process to consume jobs, a postgres data store, a redis cache, and a fakes3 server so you don't need AWS resources. When they're running, you can visit your app in the browser by going to:

http://rollcall.docker

8. Add Roll Call to Canvas:

In Canvas, go to Account >> Settings >> Apps, click "Add App", and use the following settings:

Configuration Type: By URL
Name: Roll Call
Consumer Key: 12345
Shared Secret: secret
Config URL: http://rollcall.docker/configure.xml

You can change the consumer key and shared secret by overriding LTI_KEY and LTI_SECRET in docker-compose.yml.

You're all set!

Running Tests (With Docker!)

Rollcall has three test suites (RSpec, Cucumber, & Jasmine).

Make sure your test database is in the right state before trying to run them:

docker-compose run --rm web bundle exec rake db:test:prepare

Now you can run your rspec tests in the web container like this:

docker-compose run --rm web bundle exec rake spec

You can watch your jasmine specs run by starting your docker-compose config, and then navigating to the ./jasmine directory:

docker-compose up

And then visit in your browser: http://rollcall.docker/jasmine

but that kind of sucks for rerunning. Run your javascript tests from the command line like this:

docker-compose run --rm web bundle exec rake jasmine:ci

Finally, you can run your cucumber tests, but it's kind of hacky. For linux (which the container is) you need to wrap a cucumber run in "xvfb-run" for capybara-webkit to work correctly, but something in that process is making output redirection not work right, so you won't see the output if you just run "docker-compose run --rm web xvfb-run bundle exec cucumber".

We've found you can get around this by telling docker-compose you want it to run a bash script, and having the bash script kick off the xvfb-run command, so run this to see your cuke output:

docker-compose run --rm web bash bin/cucumber

Running the Whole Suite

If you want to run the whole suite of tests, like a CI would, just run:

./build.sh

and watch the output fly by. It builds the docker image and runs in sequence the rspec tests, the jasmine tests, and the cukes. Failures in any should exit the script with a non-zero exit code.

Avatars

You can enable or disable the avatars service in Canvas via the Rails console in canvas-lms:

# from the canvas-lms directory
docker-compose run --rm web bundle exec rails c

Account.find_each { |a| a.enable_service(:avatars) ; a.save }
- or -
Account.find_each { |a| a.disable_service(:avatars) ; a.save }

rollcall-attendance's People

Contributors

simonista avatar

Watchers

Chris Rodriguez avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.