Skip to content

Local Development

Re-Krass edited this page Nov 16, 2026 · 1 revision

🐳 Local Development

The integration project ydl contains Docker Compose tooling to run the restored application with a real Django backend and MariaDB database. This is the recommended environment for technical inspection of the legacy full-stack code.

Important local layout

πŸ“¦ ydl/
┣ πŸ“„ compose.yaml              # Frontend, backend, MariaDB services
┣ πŸ“‚ docker/
┃ ┣ πŸ“„ frontend.Dockerfile
┃ β”— πŸ“„ backend.Dockerfile
┣ πŸ“‚ ydl-front/               # Git submodule
┣ πŸ“‚ ydl-api/                 # Git submodule
┣ πŸ“‚ screenshots/
┃ ┣ πŸ“„ capture.cjs            # Playwright automation
┃ ┣ πŸ“„ package.json
┃ β”— πŸ“„ pnpm-lock.yaml
┣ πŸ“„ build-pages.sh           # Separate static frontend build
β”— πŸ“„ README.md

Clone with submodules

git clone --branch feature/local-demo --recurse-submodules \
  https://github.com/YoungAndDigitalLearning/ydl.git
cd ydl

The branch name above reflects the restoration/demo development branch; check the repository for later updates before following it. See Repository Guide for details about pinned submodule commits.

Start the three services

From the main ydl directory, with your locally configured environment variables and Docker Engine running:

docker compose up -d --build
docker compose ps

The restored setup is organized around these services:

Service Typical local endpoint Description
Frontend http://127.0.0.1:8080/ Vue dev server and /api/ reverse proxy
Backend http://127.0.0.1:8000/ Django REST API / local Swagger
Database Internal Compose network MariaDB, not intended for public exposure

Ports and command paths can change with compose.yaml; treat it as the source of truth.

Database and demo content

After the backend and database start and your local environment is configured:

# These commands assume the backend container's working directory
# is the root of the ydl-api submodule.
docker compose exec backend pipenv run python ydl_api/manage.py migrate
docker compose exec backend pipenv run python ydl_api/manage.py seed_demo

The seed_demo management command creates fictional course, user, announcement, calendar and forum/quiz content for screenshots and local testing. If your container uses a different working directory, adjust the relative path to manage.py accordingly.

Do not use legacy SQL files or historic user dumps as production/demo seed material. Review local environment variables and secrets before distributing any logs or backups.

Running and troubleshooting

docker compose logs -f frontend
docker compose logs -f backend
docker compose ps

The browser can use hash routes such as /#/profile/2/allcourses. If a direct URL displays a blank page, inspect the browser console, stored JWT and API initialization; a wrong or expired token is different from a server-side routing issue.

Build the separate public demo

The integration repository also provides build-pages.sh for an optimized static Vue build. That build uses fictional browser data rather than the local Django backend and is not interchangeable with a real production backend deployment.

Next: Screenshots Β· Deployment

Clone this wiki locally