Skip to content

Commit e539391

Browse files
kdmccormickclaude
andcommitted
feat!: Rename backend -> platform-plugin-sample
Why? * platform-plugin- is a standard backend plugin prefix which Tutor recognizes. * By including the word `sample`, it's more obvious for users of this repo how to adapt it into their own backend plugin (by replacing all occurances of "sample") Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7d753b3 commit e539391

62 files changed

Lines changed: 148 additions & 151 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/backend-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
defaults:
1212
run:
13-
working-directory: "./backend"
13+
working-directory: "./platform-plugin-sample"
1414

1515
jobs:
1616
run_tests:
@@ -46,4 +46,4 @@ jobs:
4646
token: ${{ secrets.CODECOV_TOKEN }}
4747
flags: unittests
4848
fail_ci_if_error: true
49-
working-directory: "./backend"
49+
working-directory: "./platform-plugin-sample"

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,22 @@ jobs:
4444
git_committer_name: "github-actions"
4545
git_committer_email: "actions@users.noreply.github.com"
4646
changelog: "false"
47-
directory: './backend'
47+
directory: './platform-plugin-sample'
4848

4949
- name: Publish | Upload to GitHub Release Assets
5050
uses: python-semantic-release/publish-action@v10.5.3
5151
if: steps.release.outputs.released == 'true'
5252
with:
5353
github_token: ${{ secrets.OPENEDX_SEMANTIC_RELEASE_GITHUB_TOKEN }}
5454
tag: ${{ steps.release.outputs.tag }}
55-
directory: './backend'
55+
directory: './platform-plugin-sample'
5656

5757
- name: Upload | Backend Distribution Artifacts
5858
uses: actions/upload-artifact@v4
5959
if: steps.release.outputs.released == 'true'
6060
with:
6161
name: backend-distribution-artifacts
62-
path: backend/dist
62+
path: platform-plugin-sample/dist
6363
if-no-files-found: error
6464

6565
- name: Build | Tutor Plugin
@@ -102,12 +102,12 @@ jobs:
102102
id: artifact-download
103103
with:
104104
name: backend-distribution-artifacts
105-
path: backend/dist
105+
path: platform-plugin-sample/dist
106106

107107
- name: Publish to PyPi
108108
uses: pypa/gh-action-pypi-publish@release/v1
109109
with:
110-
packages-dir: backend/dist
110+
packages-dir: platform-plugin-sample/dist
111111
user: __token__
112112
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}
113113

CLAUDE.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This is a **sample plugin repository** that demonstrates all major Open edX plug
1313
- **Target Audience**: Developers new to Open edX plugin development
1414

1515
**Repository Structure:**
16-
- `backend/` - Django app plugin with models, APIs, events, and filters
16+
- `platform-plugin-sample/` - Django app plugin with models, APIs, events, and filters
1717
- `frontend/` - React component for MFE slot customization
1818
- `tutor/` - Tutor plugin for easy deployment
1919
- Each directory has comprehensive README.md files with TOCs
@@ -25,21 +25,21 @@ This is a **sample plugin repository** that demonstrates all major Open edX plug
2525
- Keep examples realistic but not overly complex
2626

2727
**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
28+
- `platform-plugin-sample/openedx_sample_plugin/apps.py` - Plugin registration and Django integration
29+
- `platform-plugin-sample/openedx_sample_plugin/signals.py` - Open edX Events handlers
30+
- `platform-plugin-sample/openedx_sample_plugin/pipeline.py` - Open edX Filters implementation
31+
- `platform-plugin-sample/openedx_sample_plugin/models.py` - CourseArchiveStatus model (business logic)
32+
- `platform-plugin-sample/openedx_sample_plugin/views.py` - REST API endpoints consumed by frontend
3333
- `frontend/src/plugin.jsx` - React component that replaces course list slot
34-
- `tutor/sample_plugin.py` - Deployment configuration (currently basic template)
34+
- `tutor/openedx_sample_plugin.py` - Deployment configuration (currently basic template)
3535

3636
## Build/Lint/Test Commands
3737
- Make sure to set the following so that test output is not too verbose: `export PYTEST_ADDOPTS="--disable-warnings --no-header --tb=short"`
38-
- Backend testing: `cd backend && pytest` or `cd backend && make test`
39-
- Run a single test: `cd backend && pytest tests/test_models.py::test_placeholder`
40-
- Quality checks: `cd backend && make quality`
41-
- Install requirements: `cd backend && make requirements`
42-
- Compile requirements: `cd backend && make compile-requirements`
38+
- Backend testing: `cd platform-plugin-sample && pytest` or `cd platform-plugin-sample && make test`
39+
- Run a single test: `cd platform-plugin-sample && pytest tests/test_models.py::test_placeholder`
40+
- Quality checks: `cd platform-plugin-sample && make quality`
41+
- Install requirements: `cd platform-plugin-sample && make requirements`
42+
- Compile requirements: `cd platform-plugin-sample && make compile-requirements`
4343

4444
## Code Style Guidelines
4545
- Python: Follow PEP 8 with max line length of 120

README.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ This sample plugin showcases the **Open edX Hooks Extension Framework**, which a
2929

3030
| Plugin Type | What It Does | Official Documentation | Sample Code | When To Use |
3131
|-------------|--------------|------------------------|-------------|-------------|
32-
| **Django App Plugin** | Add models, APIs, views, and business logic | [How to create a plugin app](https://docs.openedx.org/projects/edx-django-utils/en/latest/plugins/how_tos/how_to_create_a_plugin_app.html) | [`backend/`](./backend/) | Adding new functionality, APIs, or data models |
33-
| **Events (Signals)** | React to platform events | [Open edX Events Guide](https://docs.openedx.org/projects/openedx-events/en/latest/) | [`backend/sample_plugin/signals.py`](./backend/sample_plugin/signals.py) | Integrating with external systems, audit logging |
34-
| **Filters** | Modify platform behavior | [Using Open edX Filters](https://docs.openedx.org/projects/openedx-filters/en/latest/how-tos/using-filters.html) | [`backend/sample_plugin/pipeline.py`](./backend/sample_plugin/pipeline.py) | Customizing business logic, URL redirects |
32+
| **Django App Plugin** | Add models, APIs, views, and business logic | [How to create a plugin app](https://docs.openedx.org/projects/edx-django-utils/en/latest/plugins/how_tos/how_to_create_a_plugin_app.html) | [`platform-plugin-sample/`](./platform-plugin-sample/) | Adding new functionality, APIs, or data models |
33+
| **Events (Signals)** | React to platform events | [Open edX Events Guide](https://docs.openedx.org/projects/openedx-events/en/latest/) | [`platform-plugin-sample/openedx_sample_plugin/signals.py`](./platform-plugin-sample/openedx_sample_plugin/signals.py) | Integrating with external systems, audit logging |
34+
| **Filters** | Modify platform behavior | [Using Open edX Filters](https://docs.openedx.org/projects/openedx-filters/en/latest/how-tos/using-filters.html) | [`platform-plugin-sample/openedx_sample_plugin/pipeline.py`](./platform-plugin-sample/openedx_sample_plugin/pipeline.py) | Customizing business logic, URL redirects |
3535
| **Frontend Slots** | Customize MFE interfaces | [Frontend Plugin Slots](https://docs.openedx.org/en/latest/site_ops/how-tos/use-frontend-plugin-slots.html) | [`frontend/`](./frontend/) | UI customization, adding new components |
3636
| **Brand Packages** | Customize theming | [Open edX Brand Package Interface](https://github.com/openedx/brand-openedx) | [`brand/`](./brand/) | UI theming |
3737
| **Tutor Plugin** | Deploy plugins easily | [Tutor Plugin Development](https://docs.tutor.edly.io/) | [`tutor/`](./tutor/) | Simplified deployment and configuration |
@@ -46,9 +46,13 @@ This sample plugin showcases the **Open edX Hooks Extension Framework**, which a
4646
### Option 1: Development with Tutor (Recommended)
4747

4848
```bash
49-
# Backend plugin setup
50-
tutor mounts add "$PWD/backend"
51-
tutor dev launch # Rebuilds image, runs migrations, reboots containers.
49+
# Bind-mount backend source into Tutor image and containers.
50+
# Tutor automatically recognizes the `platform-plugin-*` prefix and knows to
51+
# treat it as an openedx-platform plugin.
52+
tutor mounts add "$PWD/platform-plugin-sample"
53+
54+
# Rebuild image, run migrations, reboot containers:
55+
tutor dev launch
5256

5357
# Frontend Plugin Setup (for learner-dashboard MFE development)
5458
npm install $PWD/frontend
@@ -60,7 +64,7 @@ npm start
6064

6165
```bash
6266
# In your edx-platform directory
63-
pip install -e /path/to/sample-plugin/backend
67+
pip install -e /path/to/sample-plugin/platform-plugin-sample
6468

6569
# Enable Learner Dashboard MFE
6670
# Go to http://localhost:18000/admin/waffle/flag/
@@ -87,9 +91,9 @@ python manage.py lms migrate
8791
Use the table above to identify which type of plugin matches your needs. You can combine multiple types in one plugin.
8892

8993
### 3. Study the Sample Code
90-
- **Backend**: Start with [`backend/sample_plugin/apps.py`](./backend/sample_plugin/apps.py) to understand plugin registration
91-
- **Events**: Examine [`backend/sample_plugin/signals.py`](./backend/sample_plugin/signals.py) for event handling patterns
92-
- **Filters**: Review [`backend/sample_plugin/pipeline.py`](./backend/sample_plugin/pipeline.py) for behavior modification
94+
- **Backend**: Start with [`platform-plugin-sample/openedx_sample_plugin/apps.py`](./platform-plugin-sample/openedx_sample_plugin/apps.py) to understand plugin registration
95+
- **Events**: Examine [`platform-plugin-sample/openedx_sample_plugin/signals.py`](./platform-plugin-sample/openedx_sample_plugin/signals.py) for event handling patterns
96+
- **Filters**: Review [`platform-plugin-sample/openedx_sample_plugin/pipeline.py`](./platform-plugin-sample/openedx_sample_plugin/pipeline.py) for behavior modification
9397
- **Frontend**: Explore [`frontend/src/plugin.jsx`](./frontend/src/plugin.jsx) for UI customization
9498

9599
### 4. Run This Sample
@@ -103,9 +107,9 @@ Each directory contains detailed README.md files with adaptation guidance.
103107
```
104108
sample-plugin/
105109
├── README.md # This file - overview and quick start
106-
├── backend/
110+
├── platform-plugin-sample/
107111
│ ├── README.md # Backend plugin detailed guide
108-
│ ├── sample_plugin/
112+
│ ├── openedx_sample_plugin/
109113
│ │ ├── apps.py # Django plugin configuration
110114
│ │ ├── models.py # Database models example
111115
│ │ ├── views.py # REST API endpoints
@@ -122,7 +126,7 @@ sample-plugin/
122126
│ └── package.json # NPM package configuration
123127
└── tutor/
124128
├── README.md # Tutor deployment guide
125-
└── sample_plugin.py # Tutor plugin configuration
129+
└── openedx_sample_plugin.py # Tutor plugin configuration
126130
```
127131

128132
## Development Workflows
@@ -135,10 +139,10 @@ sample-plugin/
135139
- Add API endpoints in `views.py`
136140
- Implement event handlers in `signals.py`
137141
- Create filters in `pipeline.py`
138-
3. **Testing**: `cd backend && make test`
139-
4. **Quality**: `cd backend && make quality`
142+
3. **Testing**: `cd platform-plugin-sample && make test`
143+
4. **Quality**: `cd platform-plugin-sample && make quality`
140144

141-
**Detailed Guide**: See [`backend/README.md`](./backend/README.md)
145+
**Detailed Guide**: See [`platform-plugin-sample/README.md`](./platform-plugin-sample/README.md)
142146

143147
### Frontend Plugin Development
144148

@@ -164,7 +168,7 @@ This sample shows how backend and frontend plugins work together:
164168
### Backend + Frontend Integration
165169

166170
```python
167-
# backend/sample_plugin/views.py - Provides API
171+
# platform-plugin-sample/openedx_sample_plugin/views.py - Provides API
168172
class CourseArchiveStatusViewSet(viewsets.ModelViewSet):
169173
# API implementation
170174
```

frontend/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ if (response.data && Array.isArray(response.data)) {
305305
### Prerequisites
306306

307307
1. **MFE Setup**: Have a learner dashboard MFE running locally
308-
2. **Backend Plugin**: Install the backend plugin (see [`../backend/README.md`](../backend/README.md))
308+
2. **Backend Plugin**: Install the backend plugin (see [`../platform-plugin-sample/README.md`](../platform-plugin-sample/README.md))
309309
3. **Node.js**: Version 16+ with npm or yarn
310310

311311
### Local Development Setup
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)