Yamtrack is a Django 5.2 app for self-hosted media tracking with Celery workers and Redis. Tailwind CSS output is currently committed under src/static/css/. Templates currently load src/static/css/main.css (see src/templates/base.html).
devmust be an exact mirror of upstreamFuzzyGrim/Yamtrack:devwith no fork-only commits or edits.- Any local
devdivergence should be reset/fast-forwarded back to upstream before merging. latestis the fork integration branch for day-to-day feature work and upstream sync merges.releaseis for versioned release/container publication flow, not the primary integration branch.
This workspace is the fork dannyvfilms/Yamtrack, branch latest. When syncing upstream dev into latest, treat the merge as a conflict-resolution task where upstream dev brings maintenance changes and latest preserves fork features.
High-level rules:
- Use upstream
devas the source of truth for dependency versions, security/bugfix patches, small refactors, settings/config changes, CSS cleanups, and tests. - Use
latestas the source of truth for fork-specific features and behavior changes. - When logic overlaps, merge intent from both sides rather than choosing one side wholesale.
Important fork features to preserve while merging:
- Statistics/runtime/time-left features: statistics pages, runtime population/caching, episode runtimes, time_left sorting, dropped-show fixes, charts (daily buckets, 30-day played-hours, All Time).
- UI/layout improvements: mobile layouts, filter controls, media card/timeline styling, statistics layout refinements, responsive template updates.
- Preferences/sorting: preferences tab, sort-direction toggles/indicators, ratings-list sort fixes, aggregate-duplicates behavior.
- Plex/import/webhook resilience: Plex-only GUID handling, TMDB episode edge cases, SQLite lock handling during import, auto-pause for stale in-progress items.
- Deployment/infra tweaks: Docker build improvements, Redis-unavailability guard in AppConfig.ready(), README/install updates.
Conflict-resolution steps:
- Scan for conflict markers (
<<<<<<<,=======,>>>>>>>) and resolve every file. - For each conflict, understand both sides; keep upstream maintenance changes and layer them into fork features.
- For views/templates/runtime/statistics/preferences/import/webhook logic, start from
latestbehavior and integrate upstream improvements. - For migration conflicts:
- Same migration numbers on different branches are valid in Django; resolve with merge migrations.
- Keep upstream migration filenames unchanged in
latest. - Renumber only fork-local migrations that are unpushed/unreleased.
- Never rename or rewrite any migration file that exists in
origin/latestor anyv*release tag.
- For lists/configs (.gitignore, CSS classes, INSTALLED_APPS, URLs, etc.), keep the union and deduplicate.
- Remove all conflict markers; run linters/tests and fix underlying issues, not just tests.
- Run hard gates before completing sync:
cd src && python manage.py makemigrations --mergecd src && python manage.py check_migration_hygiene --strictscripts/replay_upgrade_matrix.sh --from-tag <previous_release_tag> --to-ref latest --db sqlite,postgres --with-drift-scenarioscoverage run src/manage.py test app users integrations lists events --parallel
- If a choice is unavoidable, prioritize fork-visible features while honoring upstream data contracts/integrations.
src/Django project code (apps:app,users,lists,integrations,events; config inconfig/).src/templates/andsrc/static/for UI templates and CSS assets.src/db/local SQLite artifacts.docs/agents/issue and workflow notes..github/workflows/CI definitions.Dockerfile,docker-compose*.yml,entrypoint.sh,nginx.conf,supervisord.conffor container runtime.wiki/is a separate Git repository for the project wiki (edit and commit there, not in this repo).
- Keep wiki pages in
wiki/so they can be edited locally and pushed to the wiki repo. - Treat
wiki/as its own git repo (not a submodule); run commits/pushes fromwiki/. - Do not add
wiki/to the main repo index; it should remain untracked here.
docs/agents/media_type_integration.md: playbook for adding new media types safely.docs/agents/music_integration.md: music-specific data model and UI integration notes.docs/agents/pocketcasts_workflow.md: Pocket Casts import/schedule workflow details.docs/agents/migration_sync_playbook.md: required hard-gate flow for upstream syncs and migration drift replay.
- Primary (local dev): run Django from source with Redis, Celery worker/beat, and Tailwind watcher. Use this for code changes.
- Secondary (Docker):
docker-compose*.ymlcurrently uses the prebuiltghcr.io/dannyvfilms/yamtrackimage; use for deployment or quick smoke runs, not for local code changes.
Assumes the working directory is the repo root.
Install dev dependencies:
python -m pip install -U -r requirements-dev.txtStart Redis:
docker run -d --name redis -p 6379:6379 --restart unless-stopped redis:8-alpineCreate .env in the repo root (from README.md):
TMDB_API=API_KEY
MAL_API=API_KEY
IGDB_ID=IGDB_ID
IGDB_SECRET=IGDB_SECRET
STEAM_API_KEY=STEAM_API_SECRET
SECRET=SECRET
DEBUG=TrueRun migrations:
cd src && python manage.py migrateFirst run (auth, if login is required):
cd src && python manage.py createsuperuserRun services (separate terminals, from the repo root):
cd src && python manage.py runservercd src && celery -A config worker --beat --scheduler django --loglevel DEBUGcd src && tailwindcss -i ./static/css/input.css -o ./static/css/main.css --watchBy default, the app runs at http://localhost:8000.
Docker (SQLite, prebuilt image):
docker-compose up -dDocker (Postgres):
docker-compose -f docker-compose.postgres.yml up -dBy default, the app runs at http://localhost:8000.
Notes:
- Docker compose uses the prebuilt image
ghcr.io/dannyvfilms/yamtrack(tags:latest,:release,:dev). docker-compose.ymlstores SQLite data in./dband setsSECRET/REDIS_URLenv vars.docker-compose.postgres.ymlstartspostgres:16-alpineand setsDB_HOST/DB_NAME/DB_USER/DB_PASSWORD/DB_PORT.- Container entrypoint runs
python manage.py migrate --noinputand supervisord runs nginx, gunicorn, celery worker, and celery beat. - View container logs:
docker-compose logs -f yamtrack. - Reverse proxy deployments need
URLSset (seeREADME.md).
- Tailwind CLI install (supported):
brew install tailwindcss(provides thetailwindcssbinary used below). Currently, the repo does not document another install path. - Alternatives:
npm/pnpm/yarn add -D tailwindcssand runnpx tailwindcss ..., or download the standalone Tailwind binary and add it toPATH. - Tailwind input:
src/static/css/input.css. - Currently, templates load
static/css/main.cssviasrc/templates/base.html(this is the CSS the app uses). - Regenerate and commit
src/static/css/main.csswhen Tailwind changes:
cd src && tailwindcss -i ./static/css/input.css -o ./static/css/main.css --watch- Note:
README.mdmay reference output totailwind.css; for local dev and committed CSS, the supported output path issrc/static/css/main.css. - If a local watcher, shell alias, or editor task still writes
src/static/css/tailwind.css, repoint it tosrc/static/css/main.css.tailwind.cssis not a supported output path in this repo. - Tailwind output headers currently show
tailwindcss v4.1.11insrc/static/css/main.css. - Stylelint config:
.stylelintrc. - Djlint config:
pyproject.toml.
Quick confidence (CI lint):
ruff check srcMigration sync confidence (required for upstream dev -> latest syncs):
cd src && python manage.py check_migration_hygiene --strictscripts/replay_upgrade_matrix.sh --from-tag <previous_release_tag> --to-ref latest --db sqlite,postgres --with-drift-scenariosFull confidence (CI test flow):
playwright install
coverage run src/manage.py test app users integrations lists events --parallel
coverage combine
coverage report
coverage xmlNotes:
src/manage.pysetsDJANGO_SETTINGS_MODULE=config.test_settingsfor tests.config.test_settingsuses fakeredis and setsCELERY_TASK_ALWAYS_EAGER=True.- CI only injects secrets (
SECRET,TMDB_API,MAL_API,IGDB_ID,IGDB_SECRET,HARDCOVER_API,COMICVINE_API) if they exist. playwright installis currently only needed for integration tests that import Playwright (src/app/tests/test_integration.py,src/lists/tests/test_integration.py).
- Python target is 3.12 (see
Dockerfileand CI). - Ruff config lives in
pyproject.tomland excludesmigrations/. - Djlint config is in
pyproject.toml; Stylelint config is in.stylelintrc. - After model changes, keep migration files under
src/*/migrations/and runcd src && python manage.py migrate. - Media type changes follow
docs/agents/media_type_integration.md(MediaTypes enum +media_type_configwiring).
- CI fails PRs that modify
.github/workflows/**(see.github/workflows/app-tests.yml).
Short imperative title, then 1–3 bullet clarifications in the body. Optional issue lines: Fixes #123 / Refs #456.
.envcontains secrets and API keys; do not commit it.- Docker entrypoint runs migrations and changes ownership inside the container (
entrypoint.sh). - Docker compose stores data in
./db; local dev SQLite lives undersrc/db/.
- Is there a preferred formatting command (e.g.,
ruff format,djlint,stylelint) beyondruff check? - Is there a supported seed-data command beyond
python manage.py createsuperuser? - Is pytest a supported/required runner (pytest config exists), or is
manage.py testthe only supported flow? - Which environment variables are required to run the full test suite locally (if any beyond defaults)?