Thank you for your interest in contributing to Youtarr! This document will help you get started with contributing to the project. We welcome contributions of all kinds, from bug fixes and new features to documentation improvements and test coverage.
- Quick Start for Contributors
- Ways to Contribute
- Development Workflow
- Coding Standards
- Pull Request Process
- CI/CD Information
- Testing Guidelines
- Database Migrations
- Getting Help
- Project Resources
- License
- Docker & Docker Compose - Required for development and testing
- Node.js 18+ - For building the application
- Git - Version control
- Bash shell - Git Bash for Windows users
# Clone the repository
git clone https://github.com/DialmasterOrg/Youtarr.git
cd Youtarr
# Build the development Docker image
./scripts/build-dev.sh
# Start the development environment
./scripts/start-dev.sh
# Access the app at http://localhost:3087For detailed setup instructions and troubleshooting, see the Development Guide.
Found a bug? Check the GitHub Issues to see if it's already reported. If not, create a new issue with:
- Steps to reproduce
- Expected vs actual behavior
- Your environment (OS, Docker version, etc.)
- Relevant logs or screenshots
Have an idea for a new feature? Open an issue to discuss it before starting development. This is especially important for:
- Features requiring more than ~1,000 lines of code
- Changes to the build system, testing framework, or core architecture
- UI/UX redesigns or navigation changes
- New dependencies or third-party integrations
Why discuss first?
- Ensures the feature aligns with the project direction
- Prevents duplicate work
- Allows the maintainer to suggest the best approach
- Avoids investing time in changes that may not be accepted
For small, obvious improvements (typo fixes, minor bug fixes), feel free to submit a PR directly.
Documentation is crucial for user adoption. Contributions that improve clarity, fix errors, or add missing information are highly valued. This includes:
- Installation and setup guides
- Configuration documentation
- Troubleshooting guides
- Code comments and inline documentation
We maintain a 70% minimum test coverage threshold. Contributions that add tests for uncovered code or improve existing tests are welcome.
Help expand platform compatibility (new NAS systems, architectures) or improve media server integrations (Plex, Kodi, Jellyfin, Emby).
Youtarr uses a Docker-based build-and-test workflow. This is different from typical Node.js development:
- No hot reload: Code changes require rebuilding the Docker image
- Build-test-iterate cycle: Make changes → rebuild → test in Docker
- Production-like environment: Ensures consistency between development and production
# Build the development image (after making code changes)
./scripts/build-dev.sh
# Start the development environment
./scripts/start-dev.sh
# View logs
docker compose logs -f
# Stop the environment
./stop.shAlways run tests from the project root:
# Run all tests
npm test
# Run backend tests only
npm run test:backend
# Run frontend tests only
npm run test:frontend
# Run specific test file
npm run test:frontend -- client/src/hooks/__tests__/useStorageStatus.test.ts
npm run test:backend -- server/modules/__tests__/videosModule.test.jsImportant: Tests run on your host machine (not in Docker) since they're isolated unit tests. The Docker environment is for integration testing and running the full application.
For more details on the development setup, see DEVELOPMENT.md.
We use Conventional Commits format, which automatically determines version bumps:
feat:- New feature (triggers minor version bump)fix:- Bug fix (triggers patch version bump)docs:- Documentation only changesstyle:- Code style changes (formatting, whitespace)refactor:- Code refactoring without behavior changestest:- Adding or updating testschore:- Build process, dependencies, toolingBREAKING CHANGE:- In commit body or footer (triggers major version bump)
Examples:
feat: add support for multi-language subtitles
fix: resolve database connection timeout on startup
docs: update installation guide with troubleshooting steps
test: add integration tests for download module
- ESLint: Enforced for both frontend (TypeScript/React) and backend (Node.js)
- TypeScript: Full type checking required for frontend code
- Indentation: 2 spaces
- Line endings: Unix (LF)
- Quotes: Single quotes preferred
- Semicolons: Required
Code style is automatically checked by pre-commit hooks and CI.
- Minimum Coverage: 70% for both frontend and backend
- Current Coverage: 84% backend, 83% frontend
- All tests must pass: No skipped tests allowed (
test.skip()is not permitted) - React Testing Library: Use Testing Library queries, avoid direct DOM access
Husky automatically runs these checks before each commit:
- ESLint (frontend and backend)
- TypeScript type checking
- Frontend tests
If any check fails, the commit is blocked. Fix the issues and try again.
Youtarr uses a dev → main branching model to ensure stable releases:
feature/xxx ──┐
│
feature/yyy ──┼──→ dev (bleeding edge) ──→ main (stable releases)
│
fix/zzz ──────┘
| Branch | Purpose | Docker Tag |
|---|---|---|
main |
Stable, released code | latest, vX.X.X |
dev |
Integration branch for upcoming release | dev-latest, dev-rc.<sha> |
feature/*, fix/* |
Individual changes | None |
- Feature development: Branch from
dev, create PR back todev - RC builds: Merging to
devautomatically builds release candidate images - Releases: PR from
dev→maintriggers a full release - Hotfixes: Can merge directly to
main(then merge back todev)
-
Create a feature branch from
dev:git checkout dev git pull origin dev git checkout -b feat/your-feature-name # or git checkout -b fix/issue-description -
Make your changes following the coding standards above
-
Test thoroughly:
- Run all tests locally and ensure they pass
- Test in the Docker environment (
./scripts/build-dev.sh && ./scripts/start-dev.sh) - Verify coverage meets the 70% threshold
-
Update documentation if you've:
- Changed configuration options
- Added new features
- Modified setup/installation steps
- Changed environment variables
Keep PRs focused and reviewable. Large PRs are difficult to review and risky to merge. Follow these guidelines:
- Target: Under 1,000 lines changed (excluding generated files, lock files)
- Hard limit: 25 files - PRs touching more than 25 files need prior discussion
- One feature per PR - Don't bundle unrelated changes
These are hard requirements for all PRs:
- No merge conflicts - Rebase your branch on the latest
devbefore submitting - CI must pass - All automated checks must be green (linting, tests, type checking)
- No bypassing checks - Never use
--no-verify,test.skip(), or comment out tests - Coverage maintained - Don't delete tests without adding equivalent coverage
Open a GitHub issue or Discord discussion before starting work on:
| Change Type | Why Discuss First? |
|---|---|
| Build system changes | Affects entire codebase |
| Testing framework changes | Affects all tests |
| Major dependencies | Long-term maintenance |
| Architecture changes | Affects future PRs |
| Large refactors | Risk of regressions |
If your feature requires many changes, split it into sequential PRs:
- Infrastructure PR - Build/config changes only
- Core feature PR - Minimal implementation
- Enhancement PRs - Additional features, polish
- Test migration PR - Only after feature is stable
Each PR should be independently reviewable and mergeable.
- Don't delete existing tests without adding equivalent coverage first
- Don't modify CI/workflow files in feature PRs (submit those separately)
- Don't combine unrelated features in a single PR
- Don't make "while I'm here" changes - stay focused on the stated goal
When you're ready, push your branch and create a pull request targeting the dev branch on GitHub. Your PR will be reviewed by the maintainer.
PR Checklist:
- PR targets
devbranch (notmain) - PR has no merge conflicts (rebased on latest
dev) - CI passes (linting, tests, type checking all green)
- Tests pass locally (
npm test) - Coverage meets 70% threshold
- No bypassed checks (no
--no-verify,test.skip, or commented tests) - Conventional commit format used
- ESLint passes (
npm run lint) - TypeScript compiles without errors (
npm run lint:ts) - PR is focused on a single feature/fix (not bundled changes)
- PR touches fewer than 25 files (or discussed with maintainer first)
- No workflow/CI file changes (submit those separately)
- Existing tests are preserved (or equivalent coverage added)
- Documentation updated if needed
- Tested in Docker environment
- No commented-out code or debug statements
-
Automated CI checks run on your PR:
- ESLint (frontend + backend)
- TypeScript type checking
- Backend tests (70% coverage required)
- Frontend tests (70% coverage required)
- Coverage report posted as PR comment
-
Code review by the maintainer
- Feedback may be provided for improvements
- Additional changes may be requested
-
Merge to dev
- Once approved, your PR is merged to
dev - A release candidate (RC) Docker image is automatically built
- RC images are tagged as
dev-latestanddev-rc.<commit-sha>
- Once approved, your PR is merged to
-
Release to main
- When ready, the maintainer creates a PR from
dev→main - Merging to
maintriggers the full release workflow - Version bumps are automatic based on commit message prefixes
- Production Docker images are tagged as
latestandvX.X.X
- When ready, the maintainer creates a PR from
Every PR (to dev or main) triggers automated checks:
- ESLint: Code style and linting
- TypeScript: Type checking and compilation
- Backend Tests: Jest tests with coverage reporting
- Frontend Tests: React Testing Library tests with coverage
- Coverage Thresholds: Both frontend and backend must maintain 70% coverage
The CI system automatically posts a coverage report as a comment on your PR, showing:
- Current coverage percentages
- Coverage changes from the base branch
- Which files are covered/uncovered
If CI checks fail:
- ESLint failures: Run
npm run lintlocally to see errors - TypeScript errors: Run
npm run lint:tsto check types - Test failures: Run
npm testto see which tests failed - Coverage drops: Add tests to increase coverage above 70%
When code is merged to dev, an RC build is automatically triggered:
- Builds multi-architecture Docker images (amd64 + arm64)
- Pushes to Docker Hub with tags:
dialmaster/youtarr:dev-latest(always the latest dev build)dialmaster/youtarr:dev-rc.<commit-sha>(specific RC build)
These RC images allow testing bleeding-edge features before stable release.
When code is merged from dev to main, a production release is triggered:
- Analyzes conventional commit messages to determine version bump
- Updates version in
package.json - Generates
CHANGELOG.mdentries - Creates GitHub release with release notes
- Builds multi-architecture Docker images (amd64 + arm64)
- Publishes to Docker Hub with tags:
dialmaster/youtarr:latest(stable release for end-users)dialmaster/youtarr:vX.X.X(specific version)
You don't need to worry about versioning or releases - just use the correct commit message prefix.
- Write meaningful tests: Test behavior, not implementation details
- No skipped tests: All tests must run and pass (no
test.skip()) - Use descriptive test names: Clearly describe what is being tested
- Follow AAA pattern: Arrange, Act, Assert
When writing frontend tests:
- Use Testing Library queries:
getBy...,queryBy...,findBy... - Avoid direct DOM access: No
querySelector,parentElement, etc. - Query by role when possible:
getByRole('button', { name: 'Submit' }) - Use
screenfor queries: Import from@testing-library/react
- Mock external dependencies: axios, WebSocket, etc.
- Use
jest.fn()for mock functions: Allows assertion on calls - Mock React components with
React.createElement: Avoids JSX hoisting issues - Clean up mocks:
jest.clearAllMocks()inbeforeEach
# Run a specific test file
npm run test:frontend -- path/to/test.test.ts
# Run tests matching a pattern
npm run test:frontend -- --testNamePattern="should fetch data"
# Run tests in watch mode (during development)
npm run test:frontend -- --watchUse waitFor from Testing Library for async operations:
import { waitFor } from '@testing-library/react';
await waitFor(() => {
expect(result.current.loading).toBe(false);
});For more detailed testing patterns and examples, refer to the test files in the codebase and the Development Guide.
Create a migration when you:
- Add, remove, or modify database tables
- Change column types or constraints
- Add or remove indexes
- Modify associations between models
Always use the migration script:
./scripts/db-create-migration.sh your-migration-nameOr using npm:
npm run db:create-migration -- --name your-migration-nameNever manually create migration files. The script ensures proper timestamping and configuration.
- One change per migration: Keep migrations focused and atomic
- Include both up and down: Always implement rollback logic
- Test migrations: Run them locally before committing
- UTF-8 support: Use
charset: 'utf8mb4'for full Unicode support (including emoji)
For more information on database management, see DATABASE.md.
We value collaboration over surprise PRs. Before investing significant time:
- Check existing issues - Is someone already working on this?
- Open a discussion issue - Describe what you want to build
- Wait for feedback - The maintainer may have context you don't
- Start small - A working prototype PR is better than a complete rewrite
- Small bug fixes (< 100 lines): Just submit the PR
- Medium features (100-1000 lines): Open an issue first
- Large changes (1000+ lines): Discuss on Discord or issue before coding
- Architectural changes: Always discuss first, regardless of size
- Issues: Typically responded to within 2-4 days
- PRs: Review within 1 week (complex PRs may take longer)
- Discord: Usually 1-2 day response time during active hours
Don't interpret silence as approval to proceed with major changes.
- Discord Server: Join our Discord community for real-time help and discussion
- GitHub Issues: For bug reports, feature requests, and questions
- Existing Issues: Search before creating new issues to avoid duplicates
- Development Guide - Comprehensive development documentation
- Troubleshooting Guide - Common issues and solutions
- Installation Guide - Setup and installation
- Configuration Reference - All configuration options
If you get stuck or need help:
- Check the documentation links above
- Search existing GitHub issues
- Create a new issue with details about your problem
- Installation Guide
- Development Guide
- Configuration Reference
- Database Management
- Troubleshooting
- Media Servers
Youtarr is licensed under the ISC License. See LICENSE.md for full details.
By contributing to Youtarr, you agree that your contributions will be licensed under the same ISC License.
Thank you for contributing to Youtarr!