Simple FastAPI server that signs in with Spotify and shows your live now-playing track.
- Create a Spotify app: https://developer.spotify.com/dashboard
- Set the redirect URI to
http://localhost:8000/callbackin the Spotify app. - Create a Slack app: https://api.slack.com/apps
- Add a redirect URL:
http://localhost:8000/slack/callback - Under OAuth & Permissions, add user scopes:
users.profile:read,users.profile:write - Copy
.env.exampleto.envand fill in your values. - Install dependencies:
pip install -r requirements.txt- Run the server:
uvicorn main:app --reload --port 8000- Tokens and sync preferences are stored in a local SQLite file (default
app.db). - Background sync runs on the server every 5 seconds and keeps Slack updated even when the tab is closed.
- This is not production hardened. Use HTTPS and server-side storage in production.
DB_PATHto change the SQLite file location (defaultapp.db).SYNC_INTERVAL_SECto change the sync cadence (default5).