This is my capstone project. It is currenly in development.
The idea was to write an application which will allow to add tracks to a shared music playlist.
As for a "backend" of this application, I chose spotify
(hence the name of this project).
This project is connecting to Spotify and stream music from it using librespot
crate.
In order for this application to work, you need to have Spotify Premium account.
Additionally, you will need to create an app on Spotify for Developers platform to get SPOTIFY_CLIENT_ID
and SPOTIFY_CLIENT_SECRET
values.
- Register an application on the Spotify for Developers platform.
- Copy
.env.example
into.env
and fill required variables. - Run
cargo build --release
. - Create a directory which will store cached credentials, e.g
.cache
. - Get an authorization tokio and cache it by running the following command:
./target/release/spotify-share get-token --cache-directory <path_to_cache_directory>
- Run web server:
./target/release/spotify-share run-server --ip <ip> --port <port> --cache-directory <path_to_cache_directory>
POST /tracks
<-> Add track to a queue.
POST /tracks/search
<-> Search query. It is currently finds 10 tracks by provided query.
GET /tracks
<-> Returns a list of tracks in the queue.
POST /control/play
<-> Play the current song from beginning (no pause/resume support now).
POST /control/stop
<-> Stop playing the music.
POST /control/next
<-> Play next song from the queue.
POST /control/prev
<-> Play previous song from the queue.
Proper documentation will be generated later, sorry!