mirror of
https://github.com/xpltdco/media-rip.git
synced 2026-06-02 07:44:30 -06:00
Page:
Development-Guide
No results
1
Development-Guide
xpltd_admin edited this page 2026-04-03 23:05:51 -06:00
Development Guide
| Meta | Value |
|---|---|
| Repo | xpltdco/media-rip |
| Page | Development-Guide |
| Audience | developers, agents |
| Last Updated | 2026-04-04 |
| Status | current |
Testing
Backend (pytest)
cd backend
pip install -r requirements.txt
pytest tests/ -v -m "not integration"
14 test files covering: API routes, database, download service, SSE broker, sessions, config, models, themes, health, purge, output templates.
Frontend (Vitest)
cd frontend
npm install
npx vitest run
5 test files covering: Pinia stores, SSE composable, type definitions.
Linting
cd backend && ruff check .
cd frontend && npx vue-tsc --noEmit
CI/CD
CI (.github/workflows/ci.yml)
Runs on every push/PR to main:
- Backend: ruff lint + pytest
- Frontend: vue-tsc + vitest
- Docker: smoke build (no push)
Publish (.github/workflows/publish.yml)
Triggers on v*.*.* tags:
- Multi-arch build (amd64 + arm64)
- Push to
ghcr.io/xpltdco/media-rip - Creates GitHub Release
Code Patterns
Adding an API Endpoint
- Create/edit router in
backend/app/routers/ - Add Pydantic models in
backend/app/models/ - Register router in
backend/app/main.py - Add
Depends(get_session_id)for session-scoped endpoints - Add frontend API call in
frontend/src/api/client.ts
Adding a Theme
- Create CSS file in
frontend/src/themes/ - Define all CSS custom properties (copy existing theme as template)
- Import in
frontend/src/main.ts - Add to theme picker component
Adding a Background Service
- Create service in
backend/app/services/ - Initialize in
main.pylifespan context - Attach to
app.statefor access in route handlers - Clean up in lifespan shutdown
Conventions
- Python: async/await throughout, Pydantic for validation, ruff for linting
- TypeScript: Vue 3 Composition API, Pinia stores, strict mode
- Files: snake_case (Python), PascalCase (Vue components), camelCase (TS utilities)
- Testing: pytest markers for integration tests (
@pytest.mark.integration)