How daliges/musicdw works
Project Type and Purpose
• Full-stack web application
• Purpose: Let end-users paste a Spotify playlist URL, match tracks to copyright-free alternatives on Jamendo, preview metadata, and bulk-download MP3s as a ZIP.
File Structure
• Top-level “frontend/” folder: React SPA with components, CSS, and a service wrapper (src/services/api.js).
• Top-level “backend/” folder: FastAPI app
– main.py (app entry point)
– routers/ grouping by feature:
• fetch/ (call Spotify & Jamendo)
• check/ (match logic)
• download/ (ZIP archival & streaming)
– middleware/limiter.py (rate limiting)
– pydantic_models.py (request/response schemas)
• Dockerfile & .gitignore for containerization & dev hygiene
• requirements.txt & package.json for dependencies
• No internal database—state is ephemeral; relies on external APIs.
README for Insights
• Tech Stack confirms React + FastAPI + Spotify/Jamendo APIs
• Example flow clarifies user interactions and sequence
• Setup instructions reveal how the system is run (separate front/back start commands).
Main Components & Relationships
a. Frontend (React SPA)
– Components: FindSongs.js + UI
– Service layer: api.js directs HTTP calls
– Runs in browser at port 3000
b. Backend (FastAPI monolith)
– Entry: main.py
– Middleware: rate limiter
– Routers: orchestrate fetch, match, download
– Data models: Pydantic schemas validate payloads
– ZIP generator streams downloads
c. External Services
– Spotify Web API (playlist metadata & track URIs)
– Jamendo API (search for matching, metadata, audio URLs)
d. Client/User
– Interacts via browser UI → Frontend → Backend → External APIs
– Receives MP3 ZIP download.
Architectural Patterns & Design Principles
• Layered architecture:
– Presentation (React)
– API layer (FastAPI routers)
– Domain logic (matching, download)
– Infrastructure (external HTTP clients, ZIP streaming)
• Clear separation of concerns; no tight coupling
• Stateless servers—scalable behind load-balancers
• Containerizable via Docker