How z4no/spotify-in-a-social-way works
Project Type and Purpose
• This is a web-based backend service (Flask) that handles Spotify OAuth2 authentication and exposes API endpoints for playlist, track, and player operations.
• It serves as an intermediary between external clients (e.g., a Discord bot or other non-browser apps) and the Spotify API, storing tokens and user data in Firebase.
File Structure
• Top-level modules:
• main.py – Flask app entry point
• BaseManager.py, Encripter.py, User.py – core utility classes (DB management, token encryption, user model)
• Subdirectories (Flask Blueprints):
• player/player_operations.py
• playlist/playlist_operations.py
• tracks/tracks_operations.py
• Frontend assets:
• static/ (CSS)
• templates/ (HTML + JS)
• Config & dependencies: requirements.txt, .gitignore, .env expected for client secrets
Key Architecture Insights from the README
• OAuth2 flow is web-based: users authenticate via the Flask frontend, which then obtains access & refresh tokens.
• Tokens and collaborative-playlist metadata live in Firebase.
• The service exposes RESTful endpoints to external consumers (Discord bot, CLI, etc.).
• Cryptography module secures sensitive data at rest.