Contributing¶
Thank you for contributing to MediaFusion! This guide covers the development setup, code style expectations, and how to submit changes.
Architecture quick-reference¶
MediaFusion is a Rust + Python project:
| Component | Language | Location |
|---|---|---|
| API server (main HTTP server) | Rust (Axum) | backend/src/ |
| Background worker (scrapers, tasks) | Rust (Taskiq) | backend/src/bin/mediafusion-worker.rs |
| Web scrapers (Scrapy spiders) | Python | api/scrapers/ |
| Frontend (React SPA) | TypeScript | clients/frontend/ |
| Kodi addon | Python | clients/kodi/ |
| Browser extension | JavaScript | clients/browser-extension/ |
Development setup¶
Full instructions are in the Local Development guide. Summary:
git clone https://github.com/mhdzumair/MediaFusion
cd MediaFusion
# 1. Start databases
cd deployment/docker-compose && docker compose -f docker-compose-minimal.yml up -d && cd ../..
# 2. Create .env (see Local Dev guide for required values)
# 3. Run the Rust API with hot-reload
cargo watch --manifest-path backend/Cargo.toml -x 'run --bin mediafusion-api'
Code style¶
Rust¶
# Format
cargo fmt --manifest-path backend/Cargo.toml
# Lint
cargo clippy --manifest-path backend/Cargo.toml
Python¶
TypeScript (frontend)¶
Running tests¶
Adding a new scraper¶
- Background (scheduled) scraper: add a Scrapy spider in
api/scrapers/, register it in the scheduler inbackend/src/jobs/. - Live search source: implement the
LiveScrapertrait inbackend/src/scrapers/and register it in the scraper registry. - Config flag: add a new
IS_SCRAP_FROM_*env var and field inbackend/src/config.rs. - Document it: add a row to the scraper table in Content Sources and the scheduler table in Environment Variables.
Submitting changes¶
- Fork the repository
- Create a branch:
git checkout -b my-feature - Make focused changes — one PR per feature/fix
- Run tests and linters before pushing
- Open a pull request against
main
PR checklist:
- [ ] Tests pass (pytest and cargo test)
- [ ] Code is formatted (ruff format, cargo fmt)
- [ ] New env vars are documented in backend/src/config.rs (doccomments) and in docs/reference/env-reference.md
- [ ] PR description explains why, not just what
Reporting bugs¶
Search GitHub Issues before opening a new one.
Include:
- MediaFusion version (docker inspect or binary --version)
- Deployment method (Docker Compose, binary, etc.)
- Steps to reproduce
- Relevant logs:
Suggesting features¶
Open a GitHub Issue with a clear title, description, and concrete use case. Link to any related issues or prior discussion.
Commit message style¶
Types: feat, fix, refactor, docs, test, chore
Examples:
feat: add Byparr support for Cloudflare-protected indexers
fix: return 404 on unknown stream type instead of 500
docs: update env reference for new DMM hashlist variables
License¶
By contributing, you agree your contributions are licensed under the MIT License.