Skip to content

Latest commit

Β 

History

150 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Spotifust banner

🎧 Spotifust

A multi-platform, ultra-lightweight Spotify client built entirely from scratch in Rust.

CI Release License Rust iced Platform

Last Commit Repo Size Issues PRs Welcome Lines of Code

⚑ Single process β€’ πŸ¦€ 100% Rust β€’ 🎡 Embedded librespot β€’ πŸ“¦ No Electron β€’ No Chromium β€’ No Node.js


πŸ“Œ What is this?

Spotifust started from a simple but slightly stubborn idea: why does a music player need to load an entire browser inside it? This project ditches heavy web engines (Electron/Chromium) and native OS wrappers (WinUI 3/WinRT) to deliver a single-process application with hardware-accelerated graphics and embedded audio streaming, straight from Rust.

No Node.js running behind the scenes, no full Chromium instance rendering four buttons. One binary, one process, and the GPU doing what it does best.


✨ Features

  • 🎡 Native Spotify playback β€” Stream directly via embedded librespot, no browser engine
  • πŸ–₯️ Cross-platform β€” Windows (.msi), macOS (.dmg), and Linux (.tar.gz)
  • ⚑ Ultra-lightweight β€” Target baseline under 25 MB RAM
  • 🎨 GPU-accelerated UI β€” Powered by iced with tiny-skia rendering
  • πŸ” Secure auth β€” PKCE OAuth flow, credentials stored in your OS keychain
  • 🧩 Modular architecture β€” Clean MVU (Model-View-Update) following the Elm pattern
  • πŸ“¦ Zero runtime dependencies β€” No Node.js, no JVM, no Python, no bundled browser

πŸ› οΈ Tech Stack

Component Technology Description
GUI Framework iced v0.14 Cross-platform GUI based on the Elm Architecture, focused on type-safety
Renderer tiny-skia (via iced) Software 2D rendering with optional GPU acceleration
UI Layout iced::widget::canvas Custom 2D canvas for draggable, resizable fluid cards
Spotify Web API rspotify v0.16 Async Spotify Web API wrapper for search, playlists, metadata
Audio Streaming librespot v0.8 Embedded engine for session management, DRM decryption, chunk fetching
Audio Playback rodio v0.21 Cross-platform audio output to system sound drivers
Async Runtime tokio v1.52 Multi-threaded async event loop for I/O-bound operations
Error Handling thiserror v2 Derive macro for central AppError enum with per-subsystem variants
Credential Storage keyring v4 OS-level secure credential store (Credential Manager / Keychain / Secret Service)

πŸ—οΈ Architecture

Unlike traditional applications, Spotifust does not run separate sidecar processes. The entire ecosystem lives inside a single monolithic Rust binary:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Single Process                       β”‚
β”‚                                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   Message    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚  iced App   │◄────────────►│   Model (State)   β”‚     β”‚
β”‚  β”‚  View/Updateβ”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜                        β–²               β”‚
β”‚         β”‚ Canvas                        β”‚ mpsc           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
β”‚  β”‚  Card Layoutβ”‚              β”‚  tokio::spawn      β”‚     β”‚
β”‚  β”‚  Engine     β”‚              β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚  β”‚   librespot   β”‚ β”‚     β”‚
β”‚                               β”‚  β”‚   session     β”‚ β”‚     β”‚
β”‚                               β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚     β”‚
β”‚                               β”‚          β”‚ PCM     β”‚     β”‚
β”‚                               β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β” β”‚     β”‚
β”‚                               β”‚  β”‚  rodio sink   β”‚ β”‚     β”‚
β”‚                               β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚     β”‚
β”‚                               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. The Elm Engine (Model-View-Update): iced drives the state. The Model holds the application data, the View renders the canvas primitives, and the Update processes incoming asynchronous events smoothly.
  2. The Canvas Layout System: Instead of standard flexbox-style UI containers, the main dashboard uses a low-level Canvas widget with a custom spatial data structure tracking bounding boxes for each modular card, handling hardware input events directly for dragging and resizing.
  3. In-Process Audio Core: librespot is compiled directly as an internal module. It establishes direct TCP/TLS connections with Spotify's infrastructure, performs AES-128 DRM decryption internally, and feeds decoded PCM arrays directly into the system's hardware audio buffers via a bounded channel.

πŸ“‚ Project Structure

spotifust/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.rs              # Entry point & bootstrap
β”‚   β”œβ”€β”€ app.rs               # iced Application (MVU loop)
β”‚   β”œβ”€β”€ error.rs             # Central AppError enum (thiserror)
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   └── auth.rs          # PKCE OAuth flow & token management
β”‚   β”œβ”€β”€ audio/
β”‚   β”‚   β”œβ”€β”€ mod.rs
β”‚   β”‚   β”œβ”€β”€ engine.rs        # Playback control & track queue
β”‚   β”‚   β”œβ”€β”€ session.rs       # librespot session management
β”‚   β”‚   └── sink.rs          # rodio audio output sink
β”‚   └── ui/
β”‚       β”œβ”€β”€ mod.rs
β”‚       β”œβ”€β”€ icons.rs          # SVG icon definitions
β”‚       β”œβ”€β”€ login.rs          # Login screen view
β”‚       β”œβ”€β”€ main_layout.rs    # Main dashboard canvas layout
β”‚       └── theme.rs          # Color palette & styling
β”œβ”€β”€ assets/                   # App icons & resources
β”œβ”€β”€ installer/                # WiX MSI installer sources
β”œβ”€β”€ docs/                     # Additional documentation
β”œβ”€β”€ scripts/                  # Developer & CI scripts
β”‚   β”œβ”€β”€ build.sh             # Unix packaging script
β”‚   β”œβ”€β”€ build.ps1            # Windows packaging script
β”‚   β”œβ”€β”€ test.sh              # Unix test runner
β”‚   └── test.ps1             # Windows test runner
β”œβ”€β”€ install.sh                # End-user Linux installation script
β”œβ”€β”€ Cargo.toml
└── TODO.md                   # Development backlog & roadmap

πŸš€ Getting Started

Prerequisites

  • Rust 1.85 or later (2024 edition)
  • A Spotify Premium account (required: Spotify's streaming API doesn't allow full playback on free accounts)

Build from source

git clone https://github.com/gefydev/spotifust.git
cd spotifust
cargo build --release

Tip

Always build in --release mode. Debug builds with GPU rendering perform significantly worse and don't represent the real experience.

Run

cargo run --release

On first launch, it'll ask for your Spotify Premium credentials to initialize the librespot session. Once authenticated, the session gets cached locally for future launches.

Environment variables (optional)

If you're registering your own app in the Spotify Developer Dashboard to use rspotify with your own API credentials:

export SPOTIFY_CLIENT_ID="your_client_id"

Note

Spotifust uses the Authorization Code Flow with PKCE β€” no client secret is required for the desktop app's own auth.


πŸ“¦ Downloads

Pre-built binaries are available on the Releases page with the following naming convention:

Platform File Architecture
πŸͺŸ Windows spotifust-windows-x86_64-{version}.msi x86_64
🍎 macOS spotifust-macos-aarch64-{version}.dmg Apple Silicon
🍎 macOS spotifust-macos-x86_64-{version}.dmg Intel
🐧 Linux spotifust-linux-x86_64-{version}.tar.gz x86_64
🐧 Linux spotifust-linux-x86_64-{version}.deb Debian/Ubuntu

Linux Installation

Download the .tar.gz, extract it, and run the included ./install.sh script to install the app and register the spotifust:// protocol handler automatically. Alternatively, install the .deb package directly on Debian-based systems.

Building installers locally

  • Windows: Run .\scripts\build.ps1 in PowerShell. Requires the WiX v4 Toolset installed via dotnet tool install --global wix.
  • macOS: Run ./scripts/build.sh. Creates an .app bundle and packages it into a .dmg.
  • Linux: Run ./scripts/build.sh. Compresses the release binary into a .tar.gz archive.

πŸ§ͺ Testing & CI

To ensure your code meets the quality standards of the project, we provide unified test scripts. They format the code, run clippy, run tests, and optionally perform dependency audits and typo checks.

# Unix
./scripts/test.sh

# Windows (PowerShell)
.\scripts\test.ps1

The CI pipeline runs automatically on every push and PR:

Workflow Trigger Purpose
CI Push / PR Build, clippy, tests
Release Tag v* Build artifacts for all platforms & publish GitHub release
CodeQL Push / PR / Schedule Security & code quality analysis
Cargo Audit Push / Schedule Dependency vulnerability scanning
Cargo Deny Push / PR License & advisory compliance
Typos Push / PR Spell check across the codebase
Link Check Push / PR Verify all URLs in docs are alive

πŸ—ΊοΈ Roadmap

Read TODO.md for the current development backlog and roadmap.


🀝 Contributing

PRs are welcome! If you're planning to touch the audio core or the canvas engine, open an issue first to discuss the approach before sending code β€” those are the most delicate parts of the project.

Read CONTRIBUTING.md for guidelines.

Contributors

Spotifust contributor panel

πŸ“„ License

This project is licensed under the GNU General Public License v3.0.


πŸ“Š Project Analytics

Statistics

Repo analytics

Star History

Star History Chart

About

Lightweight Spotify client built from scratch in Rust

Topics

Resources

Contributing

Stars

7 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages