Git Product home page Git Product logo

ccxcon's Introduction

CCXCon

Build Status

Deploy

CCXCon is a simple API serves as an interface between edX running instances and different MIT apps.

At a high level, it takes information from multiple edX backends, and produces a single data stream. Going the other way, it takes data along this same single data stream and will route it to the correct edX backend.

Implements the APIs as described here http://docs.ccxcon.apiary.io/

Setup

You can run the entire project through docker.

pip install docker-compose
docker-compose up

From there, you can visit the minimal web-ui at https://localhost.daplie.com:8077/ (which proxies back to localhost, but has valid certificates).

Tests

You can run the tests via the command docker-compose run web tox.

Authorization

To be authorized to make requests to CCXCon, you use OAuth2. OAuth2 clients can be made in the django-admin. If you're doing server-to-server oauth (edX and teachers' portal cases), you'll want to create a user representing them, and an oauth app tied to that user. The Authorization type should be "Client Credentials". You can read more about that in the OAuth2 spec.

ccxcon's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ccxcon's Issues

More automated release process.

We should have an automated release process. It should handle all the steps until we get to a PR for the release branch. From there, users will review and test as necessary. When that PR is merged, the build happens without further intervention.

When courses are created, post the updates to a backend server via webhooks

We need a way to notify teacher's portal that things exist.

At minimum, we need the ability to get the uuid and title, plus the same for all submodules.

This should probably use some known header that we could verify on the teacher's portal side, so theoretically multiple consumers could take that incoming webhook.

Tests are broken on OSX

They break on the dredd step. Not sure why. Happy to help someone debug, but I don't have a mac. If you want to pair on it, let me know.

Support for querying specific item ids

We currently only have support for fetching individual records or all the records. We should have a filtering mechanism in place, which will be used by TP to get a list of courses to display that are purchasable.

Error on attempt to create user

Steps:

  • Fresh install of ccxcon from master.
  • Create superuser at commandline (got the error there too, but it worked)
  • Log into admin
  • Add user (form loads properly)
  • Fill out form and click save.

See error below.

ProgrammingError at /admin/auth/user/add/
relation "courses_userinfo" does not exist
LINE 1: INSERT INTO "courses_userinfo" ("user_id", "edx_instance") V...
                    ^
Request Method: POST
Request URL:    https://192.168.99.101:8077/admin/auth/user/add/
Django Version: 1.9
Exception Type: ProgrammingError
Exception Value:    
relation "courses_userinfo" does not exist
LINE 1: INSERT INTO "courses_userinfo" ("user_id", "edx_instance") V...
                    ^
Exception Location: /usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py in execute, line 64
Python Executable:  /usr/bin/python
Python Version: 2.7.6
Python Path:    
['/src',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/local/lib/python2.7/dist-packages/newrelic-2.54.0.41',
 '/usr/lib/python2.7/dist-packages',
 '/src']
Server time:    Fri, 11 Dec 2015 19:45:21 +0000

Run pylint and pep8 in tox

This would provide a way to run the tests, pylint and pep8 checks locally at the same time. In LORE we use pytest-pylint and pytest-pep8 for this.

Place the version in a VERSION text file, or remove `setup.py`

There are two places where a version is stated: ccxcon/settings.py and setup.py. We can store the version in a VERSION file and have that be the source of truth for the version, as a simple solution.

This also has the benefit of making updating the version as trivial as it can be with a release script (echo "$major.$minor.$patch" > VERSION)

But also, is there a reason we should keep setup.py? I'm cool with having it even just for onlookers who want to see some useful metadata, but I'm not sure if people will want to run CCXCon by installing it into a python environment (always possible, though). Thoughts?

Disable unused REST actions

We should consider disabling PATCH/PUT/DELETE on courses and also POST for modules, if no client has a reasonable use for them, so we don't have to worry about handling those cases.

Boolean key in docker-compose.yml

I'm getting these messages when running docker-compose up:

WARNING: There is a boolean value in the 'environment' key.
Environment variables can only be strings.
Please add quotes to any boolean values to make them string (eg, 'True', 'yes', 'N').
This warning will become an error in a future release. 

WARNING: There is a boolean value in the 'environment' key.
Environment variables can only be strings.
Please add quotes to any boolean values to make them string (eg, 'True', 'yes', 'N').
This warning will become an error in a future release. 

Add robust logging

Log to:

  • Loglevel to syslog
  • Loglevel to console
  • Email all error-level logs

And have the loglevel be environment configurable.

Subtask of #10.

protect against overwritten defaults

CCXCon has descriptions for courses. This comes from edX.
Users can update these descriptions.
If the user publishes their course again, it will overwrite.

How do we want to fix this? Maybe store updated descriptions in teacher's portal?

changes for POST to /api/v1/coursexs/

Some changes are needed for POST requests to the endpoint /api/v1/coursexs/

  • image_url needs to support just a path
  • edx_instance should not be provided by the client
  • author_name should accept null values
  • course_id needs to be added to the list of fields: course_id is a string representation of a course locator on EDX and it is unique

run dredd in a liveservertestcase

This will prevent the tests from clobbering your actual db.
Additionally, we can remove the explicit dredd step from our travis file, which should speed up the build.

Allow portal to authenticate to ccxcon

A portal (like the teachers portal) needs to securely communicate with the ccxcon in order to query courses for the catalog and to create new custom courses.

Version listed on deployments

It would be nice if we could hit an endpoint (or it was written into the base template or admin or something) to get the current version deployed. This would help with validating that a particular change was on ccxcon-ci, for instance.

Initial pre-release

The initial pre-release rc/0.0.0 should work out any kinks in our release process and open the road for all of our future releases.

We should add in some release process documentation and adhere to that, similar to lore. Thoughts @pwilkins ?

Subtask of #10

After creating master course, request modules

As a teacher/coach/customer I'd like to be able to see the names of modules/chapters in a course and purchase them.

When the CCXCon token is added to a course in an edX instance, edX will POST to the CCXcon and create a master course record. The CCXCon will then make a request back to edX to get a list of modules/chapters which it can make available to the Teachers Portal.

Application level healthcheck

We should have an application-level heartbeat route which can be used for health checking by monitoring services.

The body of the response should be machine readable and contain:

  1. The status of each connected component of the application (databases, external application APIs, etc).
  2. The elapsed time for each component health check to complete.

Return status of the health check request:

  • 200 if everything is fine.
  • 500 if one or more components is in a known degraded state (e.g. connection timed out).

Not strictly required for, but related to #10.

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.