bb8b040657
Update docs to reflect that Manage no longer scrapes its own system metrics (slices 1-2). AGENTS.md, REQUIREMENTS.md (decision log + observability section), monitoring-logging-design.md, MIGRATION_PLAN.md. Gate: docs only; backend pytest (173) + frontend build/lint/test (22/63) remain green from slices 1-2.
2.4 KiB
2.4 KiB
AGENTS.md
Layout
- Current app is
backend/(FastAPI) plusfrontend/(Vite React); ignore Streamlit-era commands inCONTRIBUTING.md. - Backend entrypoint:
backend/src/media_library_viewer_api/main.py(media_library_viewer_api.main:app). - Frontend entrypoint:
frontend/src/main.tsx. - Backend uses a
src/layout; tests live inbackend/tests/.
Commands
- Backend setup:
cd backend && python -m venv .venv && source .venv/bin/activate && pip install -e '.[dev]' - Backend run:
uvicorn media_library_viewer_api.main:app --reload --port 8000; if not installed, usePYTHONPATH=src uvicorn media_library_viewer_api.main:app --reload --port 8000. - Backend tests: run
pytestfrombackend/; focused checks can usepytest tests/test_api.pyorpytest -k <expr>; if the package is not installed, usePYTHONPATH=src pytest. - Frontend setup:
cd frontend && npm install - Frontend dev/build/lint:
npm run dev,npm run build,npm run lint;npm run buildalready typechecks viatsc -b. - Focused frontend typecheck:
npx tsc --noEmit - Local dev stack:
docker compose -f docker-compose.dev.yml up --build - Production stack:
docker compose up --build
Repo-Specific Gotchas
- Root compose files rely on environment-variable interpolation, not
env_file; export required values before running them. - Production compose needs the host/cert and OIDC variables from
docker-compose.yml(BACKEND_APP_HOST,FRONTEND_APP_HOST,CERT_RESOLVER, and the frontend OIDC vars). - Dev compose runs with auth off and does not need SSH key material unless you add remote SSH machines.
backend_cachepersists the media index and the managedknown_hostsfile.- SSH host-key checking is strict, but the first successful connect records the host key into backend-managed
known_hosts. - Backend startup validates auth settings, rebuilds managed
known_hosts, and starts the mail queue and backup alert poller. - Machine-level settings now own Jellyfin/Jellyseerr/SSH config; the backend seeds a local machine automatically.
- Remote job templates live in
backend/src/media_library_viewer_api/jobs.py; keep shell quoting intact. - Backend Ruff config is in
backend/pyproject.tomland uses line length 120 with Python 3.11. - Update
docs/REQUIREMENTS.mdwhenever behavior, UX, or architecture changes. - Do not commit
.env,.streamlit/secrets.toml, private keys, or tokens.