Repository navigation
Backend and REST API
The original backend is in ydl-api. It is a legacy Python 3.6 / Django 2 / Django REST Framework application, backed by MariaDB in the restored local environment.
π¦ ydl-api/
β£ π ydl_api/
β β£ π manage.py
β β£ π api/
β β β£ π models.py # Users, courses, messages, resources, etc.
β β β£ π serializers.py # REST response shapes
β β β£ π views.py # ViewSets and endpoints
β β β£ π urls.py
β β β£ π migrations/
β β β π management/commands/
β β β π seed_demo.py # Fictional repeatable sample content
β β£ π quiz/
β β β£ π models.py
β β β£ π serializers.py
β β β π views.py
β β π ydl_api/
β β£ π settings.py
β β π urls.py
β£ π api-docs/
β β£ π openapi.json # Archived exported API contract
β β£ π index.html # Static Swagger UI shell
β β£ π app.js
β β π vendor/ # Versioned Swagger UI runtime
β£ π scripts/
β β£ π export_openapi.py
β β π prepare_api_docs.sh
β£ π Pipfile
β π Pipfile.lock
The public OpenAPI 2.0 export describes the original Django API. The major groups include:
| Group | Representative paths | Purpose |
|---|---|---|
| Authentication |
POST /token/auth/, /token/refresh/, /token/verify/
|
JWT-based session operations |
| Users and enrollment |
GET /users/, GET /users/{id}, PUT /students/{user}
|
User accounts and student course memberships |
| Courses |
GET/POST /courses/, GET/PUT/PATCH/DELETE /courses/{id}
|
Course content and management |
| Announcements | GET/POST /announcements/ |
News on the landing page |
| Forum |
GET/POST /posts/, GET/PUT/PATCH/DELETE /posts/{id}
|
Discussions and posts |
| Messages | GET/POST /messages/ |
User messages |
| Quiz |
GET/POST /quiz/tests/, GET/PUT/PATCH/DELETE /quiz/tests/{id}
|
Quiz definitions and tasks |
| Resources |
GET/POST /resources/, /resources/{id}
|
Learning materials |
These are examples from the exported schema, not a guarantee of secure or usable live endpoints. The archived schema can differ from features simulated in the latest browser-only demo.
Open Swagger Reference Β· Download OpenAPI JSON
flowchart TD
User["User"] --> Student["Student / course enrollment"]
User --> Teacher["Teacher"]
Teacher --> Course["Course"]
Student --> Course
Course --> Post["Forum posts"]
Course --> Quiz["Quiz tests and tasks"]
Course --> Event["Calendar entries"]
Course --> Resource["Learning resources"]
Post --> Reply["Replies / child posts"]
Conceptual relationships; refer to models.py for exact fields and Django relationships.
The Swagger UI reference is generated from the locally running Django endpoint /?format=openapi, sanitized to use api.example.invalid as a non-operational host, and published as static JSON + UI files. Try it out is disabled. There is no public API server.
flowchart LR
Local["Local Django /?format=openapi"] --> Export["export_openapi.py"]
Export --> JSON["api-docs/openapi.json"]
JSON --> Swagger["Read-only Swagger UI"]
Swagger --> Pages["GitHub Pages /ydl-api/"]
The historical backend is not a modern production-ready service. Some legacy endpoint permissions were permissive; do not expose it publicly without a dedicated security review and modernization. The static UI is safe as a non-executable reference only because no live backend is provided and submissions are disabled.
Do not publish old database dumps, real accounts, secrets, credentials or environment files.
Next: Local development Β· Deployment and hosting
Young & Digital Learning Β· Interactive demo Β· Archived API reference Β· Source repositories Β· Fictional demonstration data Β· Academic portfolio