Git Product home page Git Product logo

doubtfire-api's Introduction

Doubtfire Logo

Doubtfire API Build Status CircleCI

A modern, lightweight learning management system.

Table of Contents

  1. Getting Started
  2. Install Script
  3. Manual Install
  4. Environment Variables
  5. Getting up and Running
  6. Running Rake Tasks
  7. PDF Generation Prerequisites
  8. Testing
  9. Contributing
  10. License

Getting started

Clone Repository

First, clone the doubtfire-api repository to your local machine:

$ git clone https://github.com/doubtfire-lms/doubtfire-api

Install script

The install script will try to setup the development environment for either macOS or Linux, and can be found in the root of the project as setup.sh. Execute it as follows:

$ cd ./doubtfire-api
$ ./setup.sh

Manual install

The manual installation guide can be found on the wiki for: Linux, macOS, or Docker.

Environment variables

Doubtfire requires multiple environment variables that help define settings about the Doubtfire instance running. Whilst these will default to other values, you may want to override them in production.

Key Description Default
DF_AUTH_METHOD The authentication method you would like Doubtfire to use. Possible values are database for standard authentication with the database, ldap for LDAP, and aaf for AAF Rapid Connect. database
DF_STUDENT_WORK_DIR The directory to store uploaded student work for processing. student_work
DF_INSTITUTION_NAME The name of your institution running Doubtfire. University of Foo
DF_INSTITUTION_EMAIL_DOMAIN The email domain from which emails are sent to and from in your institution. doubtfire.com
DF_INSTITUTION_HOST The host running the Doubtfire instance. localhost:3000
DF_INSTITUTION_PRODUCT_NAME The name of the product (i.e. Doubtfire) at your institution. Doubtfire
DF_SECRET_KEY_BASE The Rails secret key. Default key provided.
DF_SECRET_KEY_ATTR The secret key to encrypt certain database fields. Default key provided.
DF_SECRET_KEY_DEVISE The secret key provided to Devise. Default key provided.
DF_SECRET_KEY_MOSS The secret key provided to Moss for plagiarism detection. This value will need to be set to run rake submission:check_plagiarism (otherwise you won't need it). You will need to register for a Moss account to use this. No default.
DF_INSTITUTION_PRIVACY A statement related to the need for students to submit their own work, and that this work may be uploaded to 3rd parties for the purpose of plagiarism detection. Default statement provided
DF_INSTITUTION_PLAGIARISM A statement clarifying the terms plagiarism and collusion. Default statement provided
DF_INSTITUTION_SETTINGS_RB The path of the institution specific settings rb code - used to map student imports from institutional exports to a format understood by Doubtfire. No default

If you have chosen to use AAF Rapid Connect authentication, then you will also need to provide the following:

Key Description Default
DF_AAF_ISSUER_URL The URL of the AFF issuer, either https://rapid.test.aaf.edu.au for testing or https://rapid.aaf.edu.au for production. https://rapid.test.aaf.edu.au
DF_AAF_AUDIENCE_URL The URL of the AAF registered application. No default - required
DF_AAF_CALLBACK_URL The secure endpoint within your application that AAF Rapid Connect should POST responses to. It must end with /api/auth/jwt to access the Doubtfire JWT authentication endpoint. No default - required
DF_AAF_UNIQUE_URL The unique URL provided by AAF Rapid Connect used for redirection out of Doubtfire. No default - required
DF_AAF_IDENTITY_PROVIDER_URL The URL of the AAF-registered identity provider. No default - required
DF_AAF_AUTH_SIGNOUT_URL The URL to redirect to on sign out in order to log out of AAF Rapid Connect. No default - required
DF_SECRET_KEY_AAF The secret used to register your application with AAF. secretsecret12345

You may choose to keep your environment variables inside a .env file using key-value pairs:

DF_INSTITUTION_HOST=doubtfire.unifoo.edu.au
DF_INSTITUTION_NAME="University of Foo"

You can also keep multiple .env files for different environments, e.g.: .env.production is different to .env.develoment. Doubtfire uses the dotenv gem to make this happen.

Get it up and running!

Once you've installed using either in install script or the manual install steps.

$ bundle exec rails s

You should see all the Doubtfire endpoints at http://localhost:3000/api/docs/, which means the API is running.

Running Rake Tasks

You can perform developer-specific tasks using rake. For a list of all tasks, execute in the root directory:

rake --tasks

Testing

Our aim with testing Doubtfire is to migrate to a Test-Driven Development strategy, testing all new models and API endpoints (although we plan on writing more tests for existing models and API endpoints). If you are writing a new API endpoint or model, we strongly suggest you include unit tests in the appropriate folders (see below).

To run unit tests, execute:

$ rake test

Unit tests are located in the test directory, where model tests are under the model subdirectory and API tests are under the api subdirectory.

Any helpers should be included in the helpers subdirectory and helper modules should be written under the TestHelpers module.

Contributing

Refer to CONTRIBUTING.md

License

Licensed under GNU Affero General Public License (AGPL) v3

doubtfire-api's People

Contributors

akshatbajaj avatar alexcu avatar angusmorton avatar apj avatar avdongle avatar benphilip1991 avatar declan-e avatar dependabot[bot] avatar guoheng-liao avatar hellola avatar hltr avatar jakerenzella avatar justfeedme avatar kkatarya1 avatar lachlanwest avatar llyyer avatar macite avatar ohtake avatar pavbhat avatar samanast avatar thisaraw avatar tounyan avatar vineeshapaul 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.