About this project

YourSpotify is a self-hosted application composed of a web server and a web client. The server periodically polls the Spotify Web API to record the user's listening activity, storing data in a MongoDB database. The web application presents a dashboard for exploring statistics about listening habits. Deployment is primarily via Docker Compose, with three services: the server (Go), the web client (React), and MongoDB. Configuration is handled through environment variables including Spotify API credentials (public and secret keys), endpoint URLs, timezone, and optional Prometheus authentication. To use the application, users must create a Spotify Developer application, configure the redirect URI (e.g., http://localhost:8080/oauth/spotify/callback), and provide the credentials to the server. The server handles OAuth authentication and token refresh automatically. Historical listening data can be imported from Spotify's privacy data exports. Two import methods are supported: standard privacy data (last year of history, up to 5 days to process) and full privacy data (entire account history, up to 30 days). The import process uses caching to minimize Spotify API requests and can be retried if interrupted. Features include per-user timezone settings, registration control (admin can disable new sign-ups), re-authentication if Spotify access is revoked, and CORS configuration for multi-origin frontends. The project includes a Prometheus metrics endpoint and structured logging.