$ show Yooooomi/your_spotify
Your_Spotify is a self-hosted web application that tracks your Spotify listening history and provides a rich dashboard for exploring statistics. It consists of a React frontend (with Redux, MUI, Recharts) and an Express backend (with MongoDB, Mongoose, JWT auth). The system polls Spotify's recently played endpoint every two minutes and also supports importing historical data from Spotify's privacy exports. Users can view top songs, artists, albums, listening time breakdowns, collaborative affinity between users, and create Spotify playlists from their stats. The architecture is a monorepo with two main apps (client and server) deployed via Docker. The codebase is well-structured with clear separation of concerns, reusable UI components, and custom server-side patterns like a queued HTTP client and a write lock mechanism. However, there are no visible tests, and some aggregation pipelines are complex.
The LLM identified 3 files worth highlighting for reuse:
A priority-based HTTP request queue that respects rate limits (429 retry) and allows concurrent requests with configurable concurrency. It wraps axios and provides a clean interface for making prioritized API calls. This pattern is reusable in any Node.js project that needs to interact with rate-limited APIs.
A simple promise-based mutex (longWriteDbLock) that ensures exclusive access to critical write operations. It uses a queue of resolvers to serialize async tasks. This is a lightweight, reusable concurrency primitive for any Node.js application needing to prevent race conditions.
A React component that displays an image with a loading placeholder and handles load errors gracefully. It uses a simple state machine (loading, loaded, error) and can be extracted as a standalone component for any React project needing robust image rendering.