# Lightify

Lightify is a Windows desktop music client built around a Tauri frontend, a Rust host layer, Spotify Web API control, a local librespot-based playback engine, and an OnTheSpot-based downloader bridge.

## Shipped State

The active product target is the Tauri build under `lightify-tauri/`.

- Frontend shell: `lightify-tauri/src/index.html`, `lightify-tauri/src/styles.css`, `lightify-tauri/src/app.js`
- Backend host: `lightify-tauri/src-tauri/src/main.rs`
- Local playback engine: `lightify-audio/src/main.rs`
- Downloader bridge: local OnTheSpot web bridge managed by the Rust host

The older Python entry points at the repo root still exist, but they are legacy surfaces, not the active target for current product work.

## Current Architecture

Lightify currently runs as three cooperating subsystems:

1. Spotify control and browsing
   The Rust host handles auth, playlist/library/search calls, device selection, Beatport-to-Spotify matching, queue commands, and diagnostics through Spotify Web API and app-managed commands.

2. Local playback
   `lightify-audio` is a separate Rust subprocess that registers as a Spotify Connect device and plays audio locally. The Tauri host starts it, sends tokens over stdin, and relays playback events back to the frontend.

3. Downloads
   The Rust host manages a local OnTheSpot bridge for download enqueueing, queue inspection, retry/cancel/delete operations, and downloader-account status.

## What Exists Today

- Library browsing for playlists, liked tracks, albums, artists, recent tracks, queue, and downloads
- Search across tracks, playlists, artists, and albums
- Beatport chart fetch/import and Beatport-to-Spotify matching
- Local Spotify Connect playback through `lightify-audio`
- Queue mirroring for Lightify-managed track playback and playlist-context playback
- Diagnostics and debug report export
- Download enqueueing and queue management through the OnTheSpot bridge

## What Does Not Exist Yet

The documents under `lightify-tauri/docs/` include future-state plans that are not yet implemented in the shipped Tauri app:

- `music-library-design.md`
  Planned owned-media library, `.lfy` container, local DB, and local streaming API

- `native-shell-parity-plan.md`
  Planned browser-free native Rust shell to replace the current Tauri/WebView2 shell

- Parts of `ux-roi-polish-plan.md`
  Some polish work is implemented, but several items remain in progress or not yet started

## Repo Layout

```text
lightify-tauri/
  src/                Tauri frontend shell
  src-tauri/          Tauri Rust host
  docs/               Product plans and roadmap documents

lightify-audio/
  src/                Local librespot playback engine

Lightify.py
LightifyR.py          Legacy Python-era entry points
```

## Product Notes

- The current app is Spotify-first. It does not yet implement the owned-media architecture described in `music-library-design.md`.
- Search and Beatport matching currently share Spotify search rate-limit behavior because both depend on Spotify search endpoints.
- Debug report export writes `lightify-debug.md` next to the running executable.

## Related Docs

- `lightify-tauri/docs/ux-roi-polish-plan.md`
- `lightify-tauri/docs/music-library-design.md`
- `lightify-tauri/docs/native-shell-parity-plan.md`
