Skip to content

BYU-ODH/yvideo-py

Repository files navigation

yvideo-py

Experimental repo to rewrite Y-video using Django and HTMX

Development Setup

Prerequisites

  • uv package manager

Installation

  1. Clone the repository:
git clone <repository-url>
cd yvideo-py
  1. Install dependencies including development tools:
uv sync --dev
npm ci  # eslint and dependencies
uv run python -m playwright install chromium
  1. Set up pre-commit hooks:
uv run pre-commit install
  1. Create secret_settings.py from secret_settings_template.py. Populate secret_settings.py with the correct values

  2. Run database migrations:

uv run manage.py migrate
  1. Seed deterministic development data and copy checked-in sample media files:
uv run manage.py seed_demo_data

The deterministic demo dataset includes a local admin with netid devadmin and password devadmin. The seed command copies the checked-in sample mp4 files from demo_media/ into MEDIA_ROOT.

If you want to wipe local state and rebuild from the current models, use:

bash scripts/dangerously_reset_local_state.sh --bootstrap

That removes the local SQLite database, generated media under media/, and any local derived files in media/. It does not touch demo_media/, committed migrations, or yvideo/secret_settings.py.

If you want a one-click local app login for that admin, enable DEV_QUICK_LOGIN_ENABLED = True in yvideo/secret_settings.py and visit /login/dev/quick/ on localhost. The route returns 404 unless both DEBUG and DEV_QUICK_LOGIN_ENABLED are true, and it is only usable from localhost or 127.0.0.1.

Running the Development Server

Start the Django development server:

uv run manage.py runserver

The application will be available at http://localhost:8000

Development Tools

  • Pre-commit hooks: Automatically run linting and formatting on commit
  • Ruff: Fast Python linter and formatter
  • ESLint: Javascript/CSS/JSON linter

To manually run pre-commit on all files (this is the command used in Github Actions):

uv run pre-commit run --all-files

For local database-backed Django tests, run:

uv run manage.py test

That uses the normal project settings and migration graph.

For browser-backed end-to-end tests against the deterministic demo dataset, run:

uv run pytest tests/e2e --browser chromium

The pytest Playwright e2e suite runs headless Chromium, enables the local dev quick-login route for the test server, seeds demo data before each test, and runs in CI as a separate job instead of inside pre-commit.

To upgrade dependency versions, use the following commands:

uv sync --upgrade
uv sync --upgrade --dev

npm update

Check to make sure that the version numbers stored in pyproject.toml and package.json are exact, i.e. == instead of >=/^/etc.

About

Neither clojure nor react

Resources

License

Stars

Watchers

Forks

Contributors