Your Spotify is a self-hosted application that tracks what you listen and offers you a dashboard to explore statistics about it! It's composed of a web server which polls the Spotify API every now and then and a web application on which you can explore your statistics.
- You have to own a Spotify application ID that you can create through their dashboard
- You need to provide the Server environment the public AND secret key of the application (cf. Installation)
- You need to provide an authorized redirect URI to the
docker-compose
file
A tutorial is available at the end of this readme.
Follow the docker-compose-example.yml to host your application through docker
version: "3"
services:
app:
image: yooooomi/your_spotify_server
container_name: express-mongo
restart: always
ports:
- "8080:8080"
links:
- mongo
depends_on:
- mongo
environment:
- API_ENDPOINT=http://localhost:8080 # This MUST be included as a valid URL in the spotify dashboard
- CLIENT_ENDPOINT=http://localhost:3000
- SPOTIFY_PUBLIC=__your_spotify_client_id__
- SPOTIFY_SECRET=__your_spotify_secret__
- CORS=http://localhost:3000,http://localhost:3001
#- CORS=all
#- MONGO_ENDPOINT=mongodb://mongo:27017/your_spotify
mongo:
container_name: mongo
image: mongo
volumes:
- ./your_spotify_db:/data/db
web:
image: yooooomi/your_spotify_client
container_name: web
restart: always
ports:
- "3000:3000"
environment:
- API_ENDPOINT=http://localhost:8080
You can edit the CORS for the server:
all
will allow every sourceorigin1,origin2
will alloworigin1
andorigin2
For Your spotify to work you need to provide a Spotify application public AND secret to the server environment. To do so, you need to create a Spotify application here.
- Click on Create a client ID
- Fill out all the informations
- Copy the public and the secret key into your
docker-compose
file under the name ofSPOTIFY_PUBLIC
andSPOTIFY_SECRET
respectively - Add an authorized redirect URI corresponding to your server location on the internet adding the suffix /oauth/spotify/callback,
- use the
EDIT SETTINGS
button on the top right corner of the page. - add your URI under the
Redirect URIs
section
- i.e:
http://localhost:3000/oauth/spotify/callback
orhttp://home.mydomain.com/your_spotify_backend/oauth/spotify/callback
- use the
You can now block new registrations from the settings page if you created an account. Every account can block or allow new registrations.