A comprehensive, modular system for automated music library management, including downloading, rule-based tagging, ML analysis, and listening history tracking (scrobbling).
The project has been refactored into specialized, lightweight Docker containers sharing a common base image. This ensures high performance and easy maintenance.
music-manager: The central "Music Manager" & "Control Center". Consolidates management, authentication, ratings, scrobbling, and stats into a single FastAPI service.muma-base: Shared foundation containing core music logic and common dependencies.
muma-scanner: High-performance library scanning and database synchronization.muma-tagger: Rule-based metadata enforcement and genre inference engine.muma-downloader: Automated fetches from YouTube and SoundCloud.muma-telegram: Dedicated worker for Telegram-based music discovery.muma-importer: Archive extraction and automated file movement.muma-ml-analyzer: Machine learning pipeline for BPM, key, and mood detection.
muma-tools: Collection of maintenance and database utility scripts.
The core of the system that handles the lifecycle of music files:
- Downloaders: Automated fetching from YouTube, SoundCloud, and Telegram.
- Importer: Monitors incoming files, extracts archives, and moves them to the library.
- Tagger: A rule-based engine that cleans metadata, guesses missing tags (artist, title, genre) from filenames, and enforces library standards.
- Common: Shared utilities and the internal API.
A central dashboard and API for the system:
- Consolidates management, authentication, ratings, scrobbling, stats, and artist image enrichment.
- Provides a unified API endpoint for frontends and external services.
- View release notes, track system versions, and manage system status.
- Integrates the Artist Image Fetcher for high-quality metadata enrichment.
The easiest way to run the entire stack is using Docker Compose.
- Docker and Docker Compose
- Current user in the
dockergroup (for building images) - Docker Hub account and
docker login(if pushing images to the registry) sshpass(optional, for automated remote deployment)- A MariaDB/MySQL database (included in compose)
- Clone the repository.
- Run
./install.shto setup your environment (installs Docker and creates.env). - Configure your
.envfile with your paths, database credentials, and optional remote host settings. - Build and deploy the system:
./install.sh
If you are modifying the code and need to rebuild and redeploy the system:
- Full pipeline (Build + Publish + Deploy):
./install.sh- Uses
scripts/affected.shto detect which modules have changed if no modules are specified. - Skips builds and pushes for unedited modules to save time.
- Automatically deploys the updated stack to production.
- New: Use
--semi-remoteto offload heavy builds (app,ml,tools) to the remote LXC container (192.168.1.40). - New: Use
--remoteto perform the entire build on the remote LXC container. - New: Use
--app=<app>or positional arguments to target specific modules (e.g.,./install.sh --app=user rating). - New: Use
./install.sh managerto view music library statistics from the terminal.
- Uses
- Individual steps:
- Build:
./build.sh - Publish:
./publish.sh - Deploy:
./deploy.sh
- Build:
You can configure deployment in .env:
- Portainer Webhook: Set
PORTAINER_WEBHOOK_URL.- Business Edition: Supports "Stack Webhooks" (triggers a full stack redeploy).
- Community Edition: Supports "Service Webhooks" (trigger per service). If you have multiple services, you might prefer the SSH method.
- SSH: Set
REMOTE_HOST,REMOTE_USER, etc. The script will automatically discover your Docker Compose configuration (even if managed by Portainer), transfer it securely, and redeploy the stack. If the stack does not exist yet, it will be created using the localdocker-compose.ymltemplate. This method is highly recommended for multi-host setups and Community Edition users.
Tip: Use DEPLOY_TARGET_NAME in .env to give your deployment target a friendly name (e.g., "Production Stack"). The system now uses this to automatically manage stack naming and discovery across different repositories.
You can also target specific components with build.sh and publish.sh:
./build.sh ml(ML Analyzer only)./build.sh tools(Tools only)./build.sh app(Main Application only)
The following services will be available:
- Music Manager / Control Center: Port 8000 (main API) / 8003 (Dashboard)
- phpMyAdmin: Port 8002 (to inspect the database)
- Firefox (GUI): Port 7003
The system is split into modular Docker Compose files for better resource management:
docker-compose.yml: Core infrastructure (MariaDB, phpMyAdmin, Control Center).docker-compose.workers.yml: Background workers (Importer, YouTube/SoundCloud/Telegram downloaders, Tagger).docker-compose.tools.yml: Utility services (Fetchers, ML Analyzer, Firefox).
A SQL dump of the MariaDB database is automatically created during every deployment. Manual backups can be triggered using:
./tools/backup_db.shBackups are stored in /muma/backups on the host machine. The script uses docker exec to perform the dump within the running database container.
Start the entire stack:
docker-compose -f docker-compose.yml -f docker-compose.workers.yml -f docker-compose.tools.yml up -dStart only core services:
docker-compose up -dView logs for a specific service:
docker-compose -f docker-compose.yml -f docker-compose.workers.yml logs -f importer_worker├── services/ # Backend microservices
│ ├── music_manager/ # Consolidated Core API & Dashboard
│ │ ├── artist_image_fetcher/ # Artist image enrichment logic
│ │ └── frontend/ # Svelte-based Control Center
│ ├── downloader/ # YouTube, SoundCloud, Telegram workers
│ ├── importer/ # File movement and extraction
│ ├── tagger/ # Rule-based tagging engine
│ ├── ml-analyzer/ # ML audio feature extraction
│ ├── scanner/ # Library scan and sync
│ └── common/ # Shared logic and internal API
├── modules/ # Specialized/Standalone modules
├── docs/ # Detailed documentation and diagrams
└── tools/ # Utility scripts
For specific information on each module, please refer to their respective READMEs:
- Ecosystem Architecture
- API Specification
- System Overview
- Deployment Guide
- Database Schema
- Data Flow
- Style Guide
- Machine Learning Pipeline
This project is primarily designed for personal use, tailored to specific workflows for electronic music (Hardcore, Hardstyle, etc.).
Check the tools/ directory for utility scripts like process_genres.py.
Run tests using pytest:
pytest