How hrkfdn/ncspot works
Project type and purpose
• This is a Rust‐based, terminal/console (ncurses) Spotify client (“ncspot”) that uses the librespot library to talk to Spotify’s service.
• It provides a full‐featured CLI UI, authentication, search, playback control, IPC socket, and optional MPRIS integration.
File structure
• Top‐level: Cargo.toml, build.rs (build script), doc/ (documentation), src/ (core application), xtask/ (custom build/dev tasks).
• src/ breaks down into:
• application.rs, main.rs, cli.rs, command(s).rs – entry point + command parsing
• config.rs, serialization.rs – config loading & data formats
• spotify_api.rs, spotify.rs, spotify_worker.rs, spotify_url.rs, authentication.rs – Spotify protocol layer + worker thread
• events.rs, ext_traits.rs, traits.rs – event bus & internal APIs
• ipc.rs, mpris.rs – external control interfaces (Unix socket + D-Bus)
• queue.rs, library.rs, sharing.rs – core playback & library logic
• model/ – domain models (Album, Artist, Track, Playlist, etc.)
• ui/ – ncurses‐based UI modules (layout, views, modals, status bar, keybindings)
• panic.rs, theme.rs, utils.rs – error handling, theming, common helpers
README for additional insights
• Confirms use of ncurses + librespot, premium-only features, vim keybindings, IPC socket for remote control.
• Mentions resource footprint and cross‐platform packaging.
Detail is key
• Iterate: start broad, then add sub‐components (e.g., list UI screens or Spotify API vs. worker).