Skip to content

Repository files navigation

SpotifyRoast

A fun web app that roasts your music taste based on a song choice. Using Spotify's API to get song data, LRCLIB for lyrics retrieval, and OpenRouter's AI models to generate hilarious, sarcastic, and personalized roasts of your music preferences.

Features

  • Real-time Song Search: Search the entire Spotify library with instant album artwork previews.
  • AI-Powered Analysis: Get a personalized, savage roast of your music taste based on lyrics and musical features.
  • Streaming Response: Watch the AI "Swork" type out your roast in real-time.
  • Modern Aesthetic: A premium, Spotify-inspired interface with dark/light mode support.
  • Zero-Key Lyrics: Uses LRCLIB for lyrics, meaning one less API key for you to manage.

Tech Stack

  • Backend: Python with FastAPI
  • Frontend: HTML5, Vanilla CSS, JavaScript (ES6+)
  • AI Integration: OpenAI SDK via OpenRouter
  • Package Management: uv (ultra-fast Python package manager)
  • Containerization: Docker & Docker Compose
  • APIs:
    • Spotify: For song data and searching
    • LRCLIB: For free, keyless lyrics retrieval
    • OpenRouter: For accessing frontier AI models (defaults to Gemini 1.5 Flash)

Prerequisites

Before setting up the project, you'll need:

Local Setup

1. Clone the Repository

git clone <repository-url>
cd Spotify-Wrapped

2. Initial Setup

make setup

This will create a .env file from the template.

3. Configure API Credentials

Edit the .env file and add your actual API keys:

# Spotify API Credentials
SPOTIFY_CLIENT_ID=your_id_here
SPOTIFY_CLIENT_SECRET=your_secret_here

# OpenRouter API Key
OPENROUTER_API_KEY=your_key_here

4. Run with Docker

make docker-run

The application will be available at http://localhost:8000.

Alternative: Local Development with uv

If you have uv installed and want to run without Docker:

# Install dependencies
uv sync

# Run the app
uv run uvicorn app.main:app --reload

Available Commands

make help          # Show all available commands
make setup         # Initial setup (creates .env file)
make docker-run    # Build and run with Docker Compose
make docker-stop   # Stop containers
make docker-logs   # View application logs
make docker-shell  # Access container shell
make docker-clean  # Remove containers, images, and volumes
make clean         # Clean Python cache files

Project Structure

Spotify-Wrapped/
├── app/
│   ├── main.py          # FastAPI application and routes
│   ├── spotify.py       # Spotify API integration
│   ├── analyzer.py      # AI analysis logic (LRCLIB + OpenRouter)
│   ├── static/          # CSS, JS, and image assets
│   └── templates/       # Jinja2 HTML templates
├── Makefile             # Development shortcuts
├── pyproject.toml       # Project dependencies (uv)
├── Dockerfile           # Container definition
├── docker-compose.yml   # Docker orchestration
└── .env                 # Environment variables (not tracked)

Contributing

Feel free to submit issues and enhancement requests!

License

This project is for entertainment purposes. Please respect the terms of service for all APIs used.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages