Skip to content

Commit 568e7ae

Browse files
committed
docs: Use Claude to build out documentation.
I asked Claude to review all the code and build out documentation that wolud be helpful to someone new to the Open edX ecosystem. This documentation still needs further human review but saving it in a single commit so that we can see what further changes were needed.
1 parent a16cc64 commit 568e7ae

File tree

9 files changed

+2326
-148
lines changed

9 files changed

+2326
-148
lines changed

CLAUDE.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,37 @@
22

33
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
44

5+
## Project Purpose and Context
6+
7+
This is a **sample plugin repository** that demonstrates all major Open edX plugin interfaces. It serves as a comprehensive example for developers new to Open edX plugin development.
8+
9+
**Key Context:**
10+
- **Primary Goal**: Educational - show developers how to extend Open edX without modifying core platform code
11+
- **Plugin Types Demonstrated**: Django App Plugin, Events (signals), Filters, Frontend Slots, Tutor Plugin
12+
- **Real Business Logic**: Course archiving functionality (not just hello-world examples)
13+
- **Target Audience**: Developers new to Open edX plugin development
14+
15+
**Repository Structure:**
16+
- `backend/` - Django app plugin with models, APIs, events, and filters
17+
- `frontend/` - React component for MFE slot customization
18+
- `tutor/` - Tutor plugin for easy deployment
19+
- Each directory has comprehensive README.md files with TOCs
20+
21+
**When Making Changes:**
22+
- Prioritize educational value and clear examples over production optimization
23+
- Always link to official Open edX documentation rather than duplicating it
24+
- Maintain working integration between all plugin types
25+
- Keep examples realistic but not overly complex
26+
27+
**Key Files and Their Relationships:**
28+
- `backend/sample_plugin/apps.py` - Plugin registration and Django integration
29+
- `backend/sample_plugin/signals.py` - Open edX Events handlers
30+
- `backend/sample_plugin/pipeline.py` - Open edX Filters implementation
31+
- `backend/sample_plugin/models.py` - CourseArchiveStatus model (business logic)
32+
- `backend/sample_plugin/views.py` - REST API endpoints consumed by frontend
33+
- `frontend/src/plugin.jsx` - React component that replaces course list slot
34+
- `tutor/sample_plugin.py` - Deployment configuration (currently basic template)
35+
536
## Build/Lint/Test Commands
637
- Make sure to set the following so that test output is not too verbose: `export PYTEST_ADDOPTS="--disable-warnings --no-header --tb=short"`
738
- Backend testing: `cd backend && pytest` or `cd backend && make test`
@@ -21,7 +52,23 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
2152

2253
Always run `make quality` and fix issues before creating a PR to ensure consistent code style.
2354

24-
## API Development Guidelines
25-
- Handle permission checking in viewsets rather than serializers to maintain separation of concerns
26-
- Use `perform_create()` and `perform_update()` in viewsets for business logic and permission validation
27-
- Test API endpoints for both regular user and admin/staff scenarios when permissions are involved
55+
## Code Modification Guidelines
56+
57+
### Educational Constraints
58+
- **Primary Goal**: Preserve teaching value - don't optimize away clarity for performance
59+
- **Official Docs**: Always link to official Open edX documentation rather than duplicating explanations
60+
- **Integration Focus**: Ensure all plugin types continue to work together as demonstration
61+
- **Realistic Complexity**: Keep examples practical but not overly complex
62+
63+
### Code Relationships to Preserve
64+
- **Backend ↔ Frontend**: CourseArchiveStatus API in `views.py` consumed by `frontend/src/plugin.jsx`
65+
- **Events ↔ Models**: Signal handlers in `signals.py` can update models in `models.py`
66+
- **Settings ↔ Filters**: Filter registration in `settings/common.py` must match classes in `pipeline.py`
67+
- **Apps.py ↔ All**: Plugin configuration affects URL routing, settings, and signal registration
68+
69+
### Open edX Plugin Patterns
70+
- **API Development**: Use `perform_create()`/`perform_update()` in viewsets for business logic
71+
- **Settings**: Use additive approach for `OPEN_EDX_FILTERS_CONFIG` to avoid plugin conflicts
72+
- **Frontend**: Use Paragon components and `getAuthenticatedHttpClient()` for platform integration
73+
- **Events**: Import signal handlers in `apps.py ready()` method for proper registration
74+
- **Filters**: Return dictionaries with same parameter names as input, handle all scenarios

0 commit comments

Comments
 (0)