$ show openedx/openedx-platform
The Open edX Platform is a modular monolith for online learning, comprising two Django services: the Learning Management System (LMS) for learners and the Content Management System (CMS, called Studio) for course authors. In production, the LMS serves courseware, manages enrollments, grades, certificates, discussions, and user identity, while the CMS provides authoring tools for creating and organizing course content using XBlocks (plugin learning components). Both services use Celery for asynchronous tasks such as grade recalculation, certificate generation, and email notifications, and rely on MySQL and MongoDB for data storage, with Elasticsearch for search and Memcached/Redis for caching. Key entry points include manage.py for management commands, WSGI for HTTP serving, and Celery workers for background jobs. REST APIs are versioned (v0–v3) for contentstore, course blocks, grades, enrollments, and more. The frontend uses a mix of Backbone.js and React with Webpack for asset bundling. External dependencies include Django, Django REST Framework, Celery, MySQL, MongoDB, Elasticsearch, S3 for file storage, OAuth2 providers, SAML identity providers, video services (YouTube, 3Play Media), and analytics services (Segment, Braze). The architecture follows a plugin-based pattern with stevedore entry points for XBlocks, course tabs, block structure transformers, and course apps. Configuration models (e.g., ConfigurationModel, StackedConfigurationModel) enable database-backed feature toggles and per-context settings. The codebase includes extensive testing with pytest, factory_boy, Jasmine, and pact contract tests, though some legacy frontend code (Backbone, RequireJS) and migration sprawl indicate ongoing modernization efforts.
The LLM identified 5 files worth highlighting for reuse:
Base class for processing course block structures using a collect/transform lifecycle. Subclasses implement collect() to gather data and transform() to modify the block structure. This pattern is reusable for any tree-processing pipeline and demonstrates clean separation of concerns.
Provides reusable Django models (WaffleFlagCourseOverrideModel, WaffleFlagOrgOverrideModel) for per-course and per-org feature flag overrides, with admin forms for easy management. This pattern solves the common problem of context-specific feature toggles in multi-tenant applications.
Adds a get_cached() method to Django models that automatically caches instances and invalidates on save/delete. This is a simple but effective pattern for reducing database queries without external caching libraries.
Custom mongoengine fields (CourseKeyField, UsageKeyField) for storing Open edX course and usage keys in MongoDB. These fields handle serialization and deserialization of opaque keys, and can be reused in any project that needs to store these key types.
A custom DRF parser that implements JSON Merge Patch (RFC 7396) semantics for PATCH requests. This allows partial updates with clear semantics, and can be reused in any DRF project needing merge patch support.