- Python 61.9%
- Vue 19.9%
- TypeScript 7.6%
- CSS 6.6%
- Shell 2.9%
- Other 1%
| appimage | ||
| client | ||
| contributing | ||
| docs | ||
| scripts | ||
| src/swingmusic | ||
| tests | ||
| .dockerignore | ||
| .gitattributes | ||
| .gitignore | ||
| docker-compose.yml | ||
| Dockerfile | ||
| install.sh | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| requirements.txt | ||
| run.py | ||
| setup.py | ||
| swingmusic.spec | ||
| TODO.md | ||
| uv.lock | ||
| version.txt | ||
Swing Music
A self-hosted music server for local files and read-only WebDAV libraries.
master is the Python/Flask version. The same application is being ported to Go
on the go-rewrite branch.
Both versions use the same API, SQLite database and config folder.
This repository is a fork of Swing Music by Swing MX. The original project and its contributors deserve credit for the code and design. This fork is maintained at git.vortexia.wiki/gabriel/swing-music and is not affiliated with or endorsed by upstream.
Features
- Local folders and WebDAV libraries
- Metadata cleanup, album versions and duplicate handling
- Synced lyrics from local files, tags, LRCLIB and NetEase
- BPM, energy, key, danceability and intro/outro analysis
- Smart playlists based on cached analysis
- DJ Mix editor with per-track transitions
- Queue and playlist editing
- Multi-user accounts and roles
- Range streaming, WebDAV playback and optional transcoding
- Stats, listening history and exports
- Offline mode and installable web app
Requirements
- Python 3.11 or newer
- uv
ffmpegandffprobeonPATH- Docker, if you prefer the container setup
Node.js is only needed when changing the web client.
Docker
git clone https://git.vortexia.wiki/gabriel/swing-music.git
cd swing-music
mkdir -p music config
docker compose up -d --build
Open http://localhost:1970 and create the first admin account.
The compose file builds the image locally and mounts:
./musicat/music(read-only)./configat/config
The config folder used by the server is /config/swingmusic. For a WebDAV-only
setup, remove the music volume.
To update:
git pull
docker compose up -d --build
From source
uv sync
uv run swingmusic --host 127.0.0.1 --port 1970 --config ~/.config
The default config parent is ~/.config, and the server creates
~/.config/swingmusic. Use --config <dir> to keep it somewhere else.
Configuration
- Port:
1970, or--port/SWINGMUSIC_PORT - Config parent:
~/.config, or--config - Device name:
SWINGMUSIC_DEVICE_NAME - Cookies over HTTPS:
SWINGMUSIC_COOKIE_SECURE=1
The config folder contains the database, settings, keys, images, playlists and lyrics. Music files are never modified, so back up the config folder instead of the library.
Documentation
Development
uv sync --group dev
uv run pytest -q
To rebuild the embedded client:
cd client
npm ci
npm run build
cd ..
uv run python scripts/build_client.py --version "$(git describe --tags --abbrev=0)"
See Contributing for more details.
Go version
The go-rewrite branch
runs the backend in Go. It reads the same database and config folder as this
branch, but do not run both backends against the same config at the same time.
Credits and license
- Original project: Swing Music by Swing MX
- This fork: git.vortexia.wiki/gabriel/swing-music
This fork is licensed under AGPLv3-or-later, the same as the original project.